From 6f6ec9a783508cf6d0dc46ab7171844b35c0a0df Mon Sep 17 00:00:00 2001 From: zhengchuyi Date: Thu, 30 Jul 2026 14:27:08 +0800 Subject: [PATCH 1/3] fix(frontend): improve agent deletion UX --- frontend/src/App.tsx | 47 +- frontend/src/styles.css | 185 +++++ frontend/src/ui/AgentWorkspace.tsx | 299 +++++-- frontend/src/ui/MyAgents.tsx | 36 +- frontend/tests/agentWorkspace.test.mjs | 69 +- frontend/tests/myAgents.test.mjs | 20 +- ...tor-hLGWnCAj.js => CodeEditor-CTF8aHas.js} | 2 +- ...-3.js => MarkdownPromptEditor-CD1RMBf6.js} | 2 +- veadk/webui/assets/index-Cg6NnCkW.js | 736 ------------------ ...{index-aX9VS-d9.css => index-ClNM_Oc4.css} | 2 +- veadk/webui/assets/index-Mps5FwwT.js | 736 ++++++++++++++++++ veadk/webui/index.html | 4 +- 12 files changed, 1314 insertions(+), 824 deletions(-) rename veadk/webui/assets/{CodeEditor-hLGWnCAj.js => CodeEditor-CTF8aHas.js} (99%) rename veadk/webui/assets/{MarkdownPromptEditor-CU7OD4-3.js => MarkdownPromptEditor-CD1RMBf6.js} (99%) delete mode 100644 veadk/webui/assets/index-Cg6NnCkW.js rename veadk/webui/assets/{index-aX9VS-d9.css => index-ClNM_Oc4.css} (98%) create mode 100644 veadk/webui/assets/index-Mps5FwwT.js diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0e6f2ff8..54fbdcee 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -78,7 +78,11 @@ import { AgentWorkspace, type WorkspaceAgentDraft, } from "./ui/AgentWorkspace"; -import { MyAgents, type MyAgentCardData } from "./ui/MyAgents"; +import { + MyAgents, + invalidateRuntimeAgentCache, + type MyAgentCardData, +} from "./ui/MyAgents"; import { SearchView } from "./ui/Search"; import { buildAgentEntries, @@ -1021,6 +1025,9 @@ export default function App() { const [libraryRuntimePermissions, setLibraryRuntimePermissions] = useState< Record >({}); + const [hiddenRuntimeIds, setHiddenRuntimeIds] = useState>( + () => new Set(), + ); const [runtimeUpdateTarget, setRuntimeUpdateTarget] = useState<{ runtimeId: string; name: string; @@ -1145,8 +1152,17 @@ export default function App() { ); if (targets.length === 0) return; + const pendingRuntimeIds = new Set(targets.map((agent) => agent.runtimeId)); + setHiddenRuntimeIds((current) => { + const next = new Set(current); + for (const runtimeId of pendingRuntimeIds) next.add(runtimeId); + return next; + }); + invalidateRuntimeAgentCache(pendingRuntimeIds); + const deletedRuntimeIds = new Set(); const deletedAgentIds = new Set(); + const failedRuntimeIds = new Set(); const failures: string[] = []; for (const agent of targets) { try { @@ -1157,11 +1173,13 @@ export default function App() { deletedAgentIds.add(agent.id); } catch (cause) { const message = cause instanceof Error ? cause.message : String(cause); + failedRuntimeIds.add(agent.runtimeId); failures.push(`${agent.label}: ${message}`); } } if (deletedRuntimeIds.size > 0) { + invalidateRuntimeAgentCache(deletedRuntimeIds); setConnections(loadConnections()); setLibraryRuntimeIds((current) => { if (!current) return current; @@ -1197,6 +1215,30 @@ export default function App() { setSessionId(""); setAppName(""); } + if ( + agentDetailTarget?.runtime && + deletedRuntimeIds.has(agentDetailTarget.runtime.runtimeId) + ) { + setCreateView(null); + setSkillCenter(false); + setAddAgent(false); + setAddMenu(false); + setSearchView(false); + setManageAgents(false); + setAgentDetailTarget(null); + setFocusedDeploymentTaskId(""); + setFocusedWorkspaceAgentId(""); + setMyAgents(true); + setError(""); + } + } + + if (failedRuntimeIds.size > 0) { + setHiddenRuntimeIds((current) => { + const next = new Set(current); + for (const runtimeId of failedRuntimeIds) next.delete(runtimeId); + return next; + }); } if (failures.length > 0) { @@ -1204,7 +1246,7 @@ export default function App() { const suffix = failures.length > 3 ? `;另有 ${failures.length - 3} 个失败` : ""; throw new Error(`${failures.length} 个 Agent 删除失败:${shown}${suffix}`); } - }, [appName, userId]); + }, [agentDetailTarget, appName, userId]); const refreshAgentLibrary = useCallback(async () => { setAgentLibraryLoading(true); @@ -3239,6 +3281,7 @@ export default function App() { onUseAgent={connectMyAgent} onViewAgentDetails={openMyAgentDetails} connectedRuntimeId={connectedRuntimeId} + hiddenRuntimeIds={hiddenRuntimeIds} /> ) : showManageAgents ? ( ) { + return ( + + ); +} + +function DialogCloseIcon(props: SVGProps) { + return ( + + ); +} + interface EvaluationGroup { id: string; name: string; @@ -576,6 +643,8 @@ export function AgentWorkspace({ const [selectedDraftIds, setSelectedDraftIds] = useState>(() => new Set()); const [deletingAgents, setDeletingAgents] = useState(false); const [deleteError, setDeleteError] = useState(""); + const [deleteConfirmTarget, setDeleteConfirmTarget] = + useState(null); const [feedbackCases, setFeedbackCases] = useState([]); const [feedbackSets, setFeedbackSets] = useState([]); const [feedbackCasesLoading, setFeedbackCasesLoading] = useState(false); @@ -588,6 +657,7 @@ export function AgentWorkspace({ const [focusedCaseId, setFocusedCaseId] = useState(""); const [expandedCaseIds, setExpandedCaseIds] = useState>(() => new Set()); const suppressAgentClickRef = useRef(false); + const deleteCancelButtonRef = useRef(null); const appliedFocusKeyRef = useRef(""); const caseTableRef = useRef(null); const [evaluationGroups, setEvaluationGroups] = useState(DEFAULT_EVALUATION_GROUPS); @@ -994,6 +1064,23 @@ export function AgentWorkspace({ }); }, [filteredDrafts]); + useEffect(() => { + if (!deleteConfirmTarget) return; + const previousOverflow = document.body.style.overflow; + document.body.style.overflow = "hidden"; + deleteCancelButtonRef.current?.focus(); + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === "Escape" && !deletingAgents) { + setDeleteConfirmTarget(null); + } + }; + window.addEventListener("keydown", handleKeyDown); + return () => { + document.body.style.overflow = previousOverflow; + window.removeEventListener("keydown", handleKeyDown); + }; + }, [deleteConfirmTarget, deletingAgents]); + const cases = selectedAgent?.runtimeId ? feedbackCases : DEFAULT_CASES; const visibleCases = cases.filter((item) => { if (item.kind !== caseFilter) return false; @@ -1211,35 +1298,62 @@ export function AgentWorkspace({ setSelectionMode(false); }; - const deleteSelectedItems = async () => { + const deleteSelectedItems = () => { if (selectedDeleteCount === 0 || deletingAgents) return; const runtimeCount = selectedDeletableAgents.length; const draftCount = selectedDeletableDrafts.length; - const confirmText = runtimeCount === 1 && draftCount === 0 - ? `确定删除 Agent "${selectedDeletableAgents[0].label}"?该 Runtime 将被永久删除。` - : runtimeCount === 0 && draftCount === 1 - ? `确定删除草稿 "${selectedDeletableDrafts[0].draft.name || "未命名 Agent"}"?` - : `确定删除选中的 ${selectedDeleteCount} 个项目?${runtimeCount > 0 ? `${runtimeCount} 个 Runtime 将被永久删除。` : ""}`; - if (!window.confirm(confirmText)) return; + setDeleteError(""); + setDeleteConfirmTarget({ + kind: "selection", + title: runtimeCount === 1 && draftCount === 0 + ? "删除 Agent?" + : runtimeCount === 0 && draftCount === 1 + ? "删除草稿?" + : "删除所选项目?", + description: runtimeCount === 1 && draftCount === 0 + ? `"${selectedDeletableAgents[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。` + : runtimeCount === 0 && draftCount === 1 + ? `"${selectedDeletableDrafts[0].draft.name || "未命名 Agent"}" 将从本地草稿中删除。` + : `将删除选中的 ${selectedDeleteCount} 个项目。${runtimeCount > 0 ? `${runtimeCount} 个云端 Runtime 将被永久删除,此操作不可撤销。` : "草稿删除后无法恢复。"}`, + confirmLabel: runtimeCount === 0 && draftCount === 1 ? "删除草稿" : "删除所选", + agents: selectedDeletableAgents, + drafts: selectedDeletableDrafts, + }); + }; + + const confirmDeleteTarget = async () => { + if (!deleteConfirmTarget || deletingAgents) return; setDeletingAgents(true); setDeleteError(""); try { - if (selectedDeletableAgents.length > 0) { + if (deleteConfirmTarget.kind === "selection") { + const { agents: agentsToDelete, drafts: draftsToDelete } = deleteConfirmTarget; + if (agentsToDelete.length > 0) { + if (!onDeleteAgents) throw new Error("当前页面不支持删除已部署 Agent。"); + await onDeleteAgents(agentsToDelete); + } + if (draftsToDelete.length > 0) { + onDeleteDrafts?.(draftsToDelete); + } + setSelectedAgentIds(new Set()); + setSelectedDraftIds(new Set()); + setSelectionMode(false); + if (agentsToDelete.some((agent) => agent.id === activeAgentId)) { + setActiveAgentId(""); + } + if (draftsToDelete.some((item) => item.id === activeDraftId)) { + setActiveDraftId(""); + } + } else if (deleteConfirmTarget.kind === "agent") { if (!onDeleteAgents) throw new Error("当前页面不支持删除已部署 Agent。"); - await onDeleteAgents(selectedDeletableAgents); - } - if (selectedDeletableDrafts.length > 0) { - onDeleteDrafts?.(selectedDeletableDrafts); - } - setSelectedAgentIds(new Set()); - setSelectedDraftIds(new Set()); - setSelectionMode(false); - if (selectedDeletableAgents.some((agent) => agent.id === activeAgentId)) { - setActiveAgentId(""); - } - if (selectedDeletableDrafts.some((item) => item.id === activeDraftId)) { - setActiveDraftId(""); + await onDeleteAgents([deleteConfirmTarget.agent]); + if (activeAgentId === deleteConfirmTarget.agent.id) setActiveAgentId(""); + } else { + if (!onDeleteDrafts) throw new Error("当前页面不支持删除草稿。"); + onDeleteDrafts([deleteConfirmTarget.draft]); + if (activeDraftId === deleteConfirmTarget.draft.id) setActiveDraftId(""); } + setDeleteConfirmTarget(null); } catch (cause) { setDeleteError(cause instanceof Error ? cause.message : String(cause)); } finally { @@ -1247,30 +1361,29 @@ export function AgentWorkspace({ } }; - const deleteSingleAgent = async (agent: AgentEntry) => { + const deleteSingleAgent = (agent: AgentEntry) => { if (!onDeleteAgents || agent.canDelete !== true || deletingAgents) return; - if (!window.confirm(`确定删除 Agent "${agent.label}"?该 Runtime 将被永久删除。`)) { - return; - } - setDeletingAgents(true); setDeleteError(""); - try { - await onDeleteAgents([agent]); - if (activeAgentId === agent.id) setActiveAgentId(""); - } catch (cause) { - setDeleteError(cause instanceof Error ? cause.message : String(cause)); - } finally { - setDeletingAgents(false); - } + setDeleteConfirmTarget({ + kind: "agent", + title: "删除 Agent?", + description: `"${agent.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`, + confirmLabel: "删除 Agent", + agent, + }); }; const deleteSingleDraft = (draftItem: WorkspaceAgentDraft) => { if (!onDeleteDrafts || deletingAgents) return; const name = draftItem.draft.name || "未命名 Agent"; - if (!window.confirm(`确定删除草稿 "${name}"?`)) return; setDeleteError(""); - onDeleteDrafts([draftItem]); - if (activeDraftId === draftItem.id) setActiveDraftId(""); + setDeleteConfirmTarget({ + kind: "draft", + title: "删除草稿?", + description: `"${name}" 将从本地草稿中删除。`, + confirmLabel: "删除草稿", + draft: draftItem, + }); }; const createEvaluationGroup = () => { @@ -1305,6 +1418,7 @@ export function AgentWorkspace({ }; return ( + <>
- {(selectedDraft || selectedAgentUpdateDraft) && ( + {(selectedDraft || selectedAgentUpdateDraft || selectedAgent?.canDelete) && (
{(selectedDraft || selectedAgentUpdateDraft) && ( )} + {selectedAgent?.canDelete && ( + + )}
)} @@ -1991,35 +2118,6 @@ export function AgentWorkspace({ > {selectedDraft || selectedAgentUpdateDraft ? "继续编辑" : "更新"} - {(selectedDraft || selectedAgentUpdateDraft) && ( - - )} - {selectedAgent?.canDelete && ( - - )} )} @@ -2032,6 +2130,71 @@ export function AgentWorkspace({ )} + {deleteConfirmTarget && createPortal( +
{ + if (event.target === event.currentTarget && !deletingAgents) { + setDeleteConfirmTarget(null); + } + }} + > +
+
+
+ +

{deleteConfirmTarget.title}

+
+ +
+
+

+ {deleteConfirmTarget.description} +

+
+
+ + +
+
+
, + document.body, + )} + ); } diff --git a/frontend/src/ui/MyAgents.tsx b/frontend/src/ui/MyAgents.tsx index 2d6afb32..5ac36976 100644 --- a/frontend/src/ui/MyAgents.tsx +++ b/frontend/src/ui/MyAgents.tsx @@ -36,6 +36,23 @@ const runtimePageCache = new Map< string, { page: { runtimes: CloudRuntime[]; nextToken: string }; expiresAt: number } >(); +const EMPTY_RUNTIME_IDS = new Set(); + +export function invalidateRuntimeAgentCache(runtimeIds?: Iterable) { + if (!runtimeIds) { + runtimePageRequests.clear(); + runtimePageCache.clear(); + return; + } + const targetRuntimeIds = new Set(runtimeIds); + if (targetRuntimeIds.size === 0) return; + for (const [key, cached] of runtimePageCache) { + if (cached.page.runtimes.some((runtime) => targetRuntimeIds.has(runtime.runtimeId))) { + runtimePageCache.delete(key); + } + } + runtimePageRequests.clear(); +} function SearchIcon(props: SVGProps) { return ( @@ -196,6 +213,7 @@ export interface MyAgentsProps { onUseAgent: (agent: MyAgentCardData) => Promise; onViewAgentDetails: (agent: MyAgentCardData) => void; connectedRuntimeId?: string; + hiddenRuntimeIds?: ReadonlySet; } export function MyAgents({ @@ -204,6 +222,7 @@ export function MyAgents({ onUseAgent, onViewAgentDetails, connectedRuntimeId = "", + hiddenRuntimeIds = EMPTY_RUNTIME_IDS, }: MyAgentsProps) { const resultsRef = useRef(null); const loadMoreRef = useRef(null); @@ -282,16 +301,21 @@ export function MyAgents({ agent.name.toLocaleLowerCase().includes(normalizedQuery), ) : runtimeAgents; - const connectedIndex = matchingAgents.findIndex( + const availableAgents = hiddenRuntimeIds.size > 0 + ? matchingAgents.filter((agent) => + !agent.runtime || !hiddenRuntimeIds.has(agent.runtime.runtimeId), + ) + : matchingAgents; + const connectedIndex = availableAgents.findIndex( (agent) => agent.runtime?.runtimeId === connectedRuntimeId, ); - if (connectedIndex <= 0) return matchingAgents; + if (connectedIndex <= 0) return availableAgents; return [ - matchingAgents[connectedIndex], - ...matchingAgents.slice(0, connectedIndex), - ...matchingAgents.slice(connectedIndex + 1), + availableAgents[connectedIndex], + ...availableAgents.slice(0, connectedIndex), + ...availableAgents.slice(connectedIndex + 1), ]; - }, [activeType, connectedRuntimeId, query, runtimeAgents]); + }, [activeType, connectedRuntimeId, hiddenRuntimeIds, query, runtimeAgents]); const activeTypeInfo = AGENT_TYPES.find((type) => type.id === activeType); const activeLabel = activeTypeInfo?.label ?? "智能体"; diff --git a/frontend/tests/agentWorkspace.test.mjs b/frontend/tests/agentWorkspace.test.mjs index 286fa18c..1c8f0ddb 100644 --- a/frontend/tests/agentWorkspace.test.mjs +++ b/frontend/tests/agentWorkspace.test.mjs @@ -11,6 +11,10 @@ const workspaceStyles = readFileSync( new URL("../src/ui/AgentWorkspace.css", import.meta.url), "utf8", ); +const appStyles = readFileSync( + new URL("../src/styles.css", import.meta.url), + "utf8", +); const customCreateSource = readFileSync( new URL("../src/create/CustomCreate.tsx", import.meta.url), "utf8", @@ -310,6 +314,10 @@ test("workspace keeps agent deletion in selection mode and the floating detail a assert.match(appSource, /const deleteWorkspaceAgents = useCallback/); assert.match(appSource, /await deleteRuntime\(agent\.runtimeId, agent\.region\)/); assert.doesNotMatch(appSource, /agent\.region \?\? "cn-beijing"/); + assert.match( + appSource, + /deletedRuntimeIds\.has\(agentDetailTarget\.runtime\.runtimeId\)[\s\S]*?setManageAgents\(false\)[\s\S]*?setAgentDetailTarget\(null\)[\s\S]*?setMyAgents\(true\)/, + ); assert.match(appSource, /onDeleteAgents=\{deleteWorkspaceAgents\}/); assert.match(appSource, /const deleteWorkspaceDrafts = useCallback/); assert.match(appSource, /onDeleteDrafts=\{deleteWorkspaceDrafts\}/); @@ -321,25 +329,76 @@ test("workspace keeps agent deletion in selection mode and the floating detail a assert.match(workspaceSource, /const \[selectedDraftIds, setSelectedDraftIds\] = useState>/); assert.match(workspaceSource, /selectedDeletableAgents/); assert.match(workspaceSource, /selectedDeletableDrafts/); - assert.match(workspaceSource, /window\.confirm\(confirmText\)/); - assert.match(workspaceSource, /await onDeleteAgents\(selectedDeletableAgents\)/); - assert.match(workspaceSource, /onDeleteDrafts\?\.\(selectedDeletableDrafts\)/); + const deleteSelectedStart = workspaceSource.indexOf("const deleteSelectedItems"); + const deleteSingleAgentStart = workspaceSource.indexOf("const deleteSingleAgent"); + const deleteSingleDraftStart = workspaceSource.indexOf("const deleteSingleDraft"); + const createEvaluationGroupStart = workspaceSource.indexOf("const createEvaluationGroup"); + assert.ok(deleteSelectedStart >= 0 && deleteSingleAgentStart > deleteSelectedStart); + assert.ok(deleteSingleDraftStart > deleteSingleAgentStart); + assert.ok(createEvaluationGroupStart > deleteSingleDraftStart); + assert.doesNotMatch( + workspaceSource.slice(deleteSelectedStart, createEvaluationGroupStart), + /window\.confirm/, + ); + assert.match(workspaceSource, /const \[deleteConfirmTarget, setDeleteConfirmTarget\]/); + assert.match(workspaceSource, /createPortal\(/); + assert.match(workspaceSource, /function DeleteWarningIcon\(props: SVGProps\)/); + assert.match(workspaceSource, /function DialogCloseIcon\(props: SVGProps\)/); + assert.doesNotMatch( + workspaceSource.slice(0, workspaceSource.indexOf("} from \"lucide-react\"")), + /\bAlertTriangle\b|^\s*X,\s*$/m, + ); + assert.match(workspaceSource, /role="alertdialog"/); + assert.match(workspaceSource, /aria-modal="true"/); + assert.match(workspaceSource, /aria-labelledby="aw-delete-confirm-title"/); + assert.match(workspaceSource, /aria-describedby="aw-delete-confirm-description"/); + assert.match(workspaceSource, /className="studio-confirm-backdrop"/); + assert.match(workspaceSource, /className="studio-confirm-dialog studio-confirm-dialog--danger"/); + assert.match(workspaceSource, /className="studio-confirm-head"/); + assert.match(workspaceSource, /className="studio-confirm-body"/); + assert.match(workspaceSource, /className="studio-confirm-actions"/); + assert.match(workspaceSource, /className="studio-confirm-primary"/); + assert.doesNotMatch( + workspaceSource.slice(workspaceSource.indexOf("deleteConfirmTarget && createPortal")), + /pp-confirm|code-browser/, + ); + assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "selection"/); + assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "agent"/); + assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "draft"/); + assert.match(workspaceSource, /onClick=\{\(\) => void confirmDeleteTarget\(\)\}/); + assert.match(workspaceSource, /await onDeleteAgents\(agentsToDelete\)/); + assert.match(workspaceSource, /onDeleteDrafts\?\.\(draftsToDelete\)/); assert.match(workspaceSource, /aria-pressed=\{selectionMode \? isSelectedForDelete : undefined\}/); assert.match(workspaceSource, /删除所选/); - assert.match(workspaceSource, /const deleteSingleAgent = async/); + assert.match(workspaceSource, /const deleteSingleAgent = \(agent: AgentEntry\) =>/); assert.match(workspaceSource, /const deleteSingleDraft = /); assert.equal(workspaceSource.match(/aria-label="删除 Agent"/g)?.length, 1); assert.match(workspaceSource, /删除草稿/); assert.match(workspaceStyles, /\.aw-selection-toolbar/); assert.match(workspaceStyles, /\.aw-select-marker\.is-checked/); assert.match(workspaceStyles, /\.aw-head-delete/); + assert.doesNotMatch(workspaceStyles, /\.aw-delete-confirm/); + assert.match(appStyles, /\.studio-confirm-dialog\s*\{[\s\S]*?width:\s*min\(420px, calc\(100vw - 40px\)\)/); + assert.match(appStyles, /\.studio-confirm-head\s*\{[\s\S]*?flex:\s*0 0 58px/); + assert.match(appStyles, /\.studio-confirm-head\s*\{[\s\S]*?padding:\s*0 16px 0 18px/); + assert.match(appStyles, /\.studio-confirm-body\s*\{[\s\S]*?padding:\s*24px 20px/); + assert.match( + appStyles, + /\.studio-confirm-actions\s*\{[\s\S]*?padding:\s*12px 16px;[\s\S]*?border-top:\s*1px solid hsl\(var\(--border\)\)/, + ); + assert.match(appStyles, /\.studio-confirm-close:focus-visible/); + assert.match(appStyles, /\.studio-confirm-dialog--danger \.studio-confirm-actions \.studio-confirm-primary/); assert.match( workspaceStyles, /\.aw-head-delete\.studio-update-action:hover:not\(:disabled\)[\s\S]*?color:\s*#fff;/, ); assert.match( workspaceSource, - /className="aw-basic-actions"[\s\S]*?className="aw-update studio-update-action"[\s\S]*?className="aw-head-delete studio-update-action"/, + /className="aw-head-delete"[\s\S]*?aria-label="删除 Agent"/, + ); + assert.doesNotMatch( + workspaceSource, + /className="aw-basic-actions"[\s\S]*?className="aw-head-delete studio-update-action"/, ); }); diff --git a/frontend/tests/myAgents.test.mjs b/frontend/tests/myAgents.test.mjs index 85ce0b4d..39ac1f1f 100644 --- a/frontend/tests/myAgents.test.mjs +++ b/frontend/tests/myAgents.test.mjs @@ -128,6 +128,22 @@ test("loads owned runtimes into the general agents section", () => { assert.match(pageSource, /setRuntimeAgents\(\(current\) => reset \? agents : \[\.\.\.current, \.\.\.agents\]\)/); }); +test("hides deleted Runtime cards and invalidates stale Runtime pages", () => { + assert.match(pageSource, /export function invalidateRuntimeAgentCache/); + assert.match(pageSource, /runtimePageRequests\.clear\(\)/); + assert.match(pageSource, /runtimePageCache\.clear\(\)/); + assert.match(pageSource, /runtimePageCache\.delete\(key\)/); + assert.match(pageSource, /hiddenRuntimeIds\?: ReadonlySet/); + assert.match( + pageSource, + /!agent\.runtime \|\| !hiddenRuntimeIds\.has\(agent\.runtime\.runtimeId\)/, + ); + assert.match(appSource, /const \[hiddenRuntimeIds, setHiddenRuntimeIds\] = useState>/); + assert.match(appSource, /invalidateRuntimeAgentCache\(pendingRuntimeIds\)/); + assert.match(appSource, /invalidateRuntimeAgentCache\(deletedRuntimeIds\)/); + assert.match(appSource, /hiddenRuntimeIds=\{hiddenRuntimeIds\}/); +}); + test("loads more Runtime cards at the scroll sentinel with accessible animation", () => { assert.match(pageSource, /new IntersectionObserver/); assert.match(pageSource, /loadMoreRef/); @@ -256,8 +272,8 @@ test("shows connecting progress and preserves the connected Runtime state", () = test("uses connected Runtime state only for the card action", () => { assert.doesNotMatch(pageSource, /my-agents-connect-banner|请选择一个智能体以对话/); assert.match(pageSource, /agent\.runtime\?\.runtimeId === connectedRuntimeId/); - assert.match(pageSource, /const connectedIndex = matchingAgents\.findIndex/); - assert.match(pageSource, /matchingAgents\[connectedIndex\][\s\S]*?matchingAgents\.slice\(0, connectedIndex\)/); + assert.match(pageSource, /const connectedIndex = availableAgents\.findIndex/); + assert.match(pageSource, /availableAgents\[connectedIndex\][\s\S]*?availableAgents\.slice\(0, connectedIndex\)/); assert.match(appSource, /const connectedRuntimeId =[\s\S]*?currentRuntime\?\.runtimeId \?\?[\s\S]*?connections\.reduce/); assert.match(appSource, /connectedRuntimeId=\{connectedRuntimeId\}/); }); diff --git a/veadk/webui/assets/CodeEditor-hLGWnCAj.js b/veadk/webui/assets/CodeEditor-CTF8aHas.js similarity index 99% rename from veadk/webui/assets/CodeEditor-hLGWnCAj.js rename to veadk/webui/assets/CodeEditor-CTF8aHas.js index 414d77cf..37b01a62 100644 --- a/veadk/webui/assets/CodeEditor-hLGWnCAj.js +++ b/veadk/webui/assets/CodeEditor-CTF8aHas.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-Cg6NnCkW.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-Mps5FwwT.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-CU7OD4-3.js b/veadk/webui/assets/MarkdownPromptEditor-CD1RMBf6.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-CU7OD4-3.js rename to veadk/webui/assets/MarkdownPromptEditor-CD1RMBf6.js index 5d1a9ffa..528b4e1a 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-CU7OD4-3.js +++ b/veadk/webui/assets/MarkdownPromptEditor-CD1RMBf6.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-Cg6NnCkW.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-Mps5FwwT.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ni.map(i=>d[i]); -var l8=Object.defineProperty;var c8=(e,t,n)=>t in e?l8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Lk=(e,t,n)=>c8(e,typeof t!="symbol"?t+"":t,n);function u8(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 xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AI={exports:{}},Pg={},CI={exports:{}},It={};/** - * @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 Yf=Symbol.for("react.element"),d8=Symbol.for("react.portal"),f8=Symbol.for("react.fragment"),h8=Symbol.for("react.strict_mode"),p8=Symbol.for("react.profiler"),m8=Symbol.for("react.provider"),g8=Symbol.for("react.context"),y8=Symbol.for("react.forward_ref"),b8=Symbol.for("react.suspense"),E8=Symbol.for("react.memo"),x8=Symbol.for("react.lazy"),Mk=Symbol.iterator;function w8(e){return e===null||typeof e!="object"?null:(e=Mk&&e[Mk]||e["@@iterator"],typeof e=="function"?e:null)}var II={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RI=Object.assign,OI={};function du(e,t,n){this.props=e,this.context=t,this.refs=OI,this.updater=n||II}du.prototype.isReactComponent={};du.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")};du.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function LI(){}LI.prototype=du.prototype;function $x(e,t,n){this.props=e,this.context=t,this.refs=OI,this.updater=n||II}var Hx=$x.prototype=new LI;Hx.constructor=$x;RI(Hx,du.prototype);Hx.isPureReactComponent=!0;var jk=Array.isArray,MI=Object.prototype.hasOwnProperty,zx={current:null},jI={key:!0,ref:!0,__self:!0,__source:!0};function DI(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)MI.call(t,r)&&!jI.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,G=O[z];if(0>>1;zs(Q,T))nes(fe,Q)?(O[z]=fe,O[ne]=T,z=ne):(O[z]=Q,O[se]=T,z=se);else if(nes(fe,T))O[z]=fe,O[ne]=T,z=ne;else break e}}return j}function s(O,j){var T=O.sortIndex-j.sortIndex;return T!==0?T:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=O)r(u),j.sortIndex=j.expirationTime,t(c,j);else break;j=n(u)}}function _(O){if(g=!1,x(O),!m)if(n(c)!==null)m=!0,C(k);else{var j=n(u);j!==null&&M(_,j.startTime-O)}}function k(O,j){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var T=h;try{for(x(j),f=n(c);f!==null&&(!(f.expirationTime>j)||O&&!D());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var G=z(f.expirationTime<=j);j=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),x(j)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var se=n(u);se!==null&&M(_,se.startTime-j),P=!1}return P}finally{f=null,h=T,p=!1}}var N=!1,A=null,S=-1,R=5,I=-1;function D(){return!(e.unstable_now()-IO||125z?(O.sortIndex=T,t(u,O),n(c)===null&&O===n(u)&&(g?(y(S),S=-1):g=!0,M(_,T-z))):(O.sortIndex=G,t(c,O),m||p||(m=!0,C(k))),O},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(O){var j=h;return function(){var T=h;h=j;try{return O.apply(this,arguments)}finally{h=T}}}})($I);UI.exports=$I;var O8=UI.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 L8=E,gs=O8;function Le(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"),p1=Object.prototype.hasOwnProperty,M8=/^[: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]*$/,Pk={},Bk={};function j8(e){return p1.call(Bk,e)?!0:p1.call(Pk,e)?!1:M8.test(e)?Bk[e]=!0:(Pk[e]=!0,!1)}function D8(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 P8(e,t,n,r){if(t===null||typeof t>"u"||D8(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 $r(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 yr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){yr[e]=new $r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];yr[t]=new $r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){yr[e]=new $r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){yr[e]=new $r(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){yr[e]=new $r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){yr[e]=new $r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){yr[e]=new $r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){yr[e]=new $r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){yr[e]=new $r(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kx=/[\-:]([a-z])/g;function Yx(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(Kx,Yx);yr[t]=new $r(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(Kx,Yx);yr[t]=new $r(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(Kx,Yx);yr[t]=new $r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){yr[e]=new $r(e,1,!1,e.toLowerCase(),null,!1,!1)});yr.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){yr[e]=new $r(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wx(e,t,n,r){var s=yr.hasOwnProperty(t)?yr[t]:null;(s!==null?s.type!==0:r||!(2l||s[a]!==i[l]){var c=` -`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{gy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cd(e):""}function B8(e){switch(e.tag){case 5:return cd(e.type);case 16:return cd("Lazy");case 13:return cd("Suspense");case 19:return cd("SuspenseList");case 0:case 2:case 15:return e=yy(e.type,!1),e;case 11:return e=yy(e.type.render,!1),e;case 1:return e=yy(e.type,!0),e;default:return""}}function b1(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 Gl:return"Fragment";case Wl:return"Portal";case m1:return"Profiler";case Gx:return"StrictMode";case g1:return"Suspense";case y1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VI:return(e.displayName||"Context")+".Consumer";case zI:return(e._context.displayName||"Context")+".Provider";case qx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xx:return t=e.displayName||null,t!==null?t:b1(e.type)||"Memo";case Pa:t=e._payload,e=e._init;try{return b1(e(t))}catch{}}return null}function F8(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 b1(t);case 8:return t===Gx?"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 ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function YI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U8(e){var t=YI(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 Hh(e){e._valueTracker||(e._valueTracker=U8(e))}function WI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wm(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 E1(e,t){var n=t.checked;return Rn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ao(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 GI(e,t){t=t.checked,t!=null&&Wx(e,"checked",t,!1)}function x1(e,t){GI(e,t);var n=ao(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")?w1(e,t.type,n):t.hasOwnProperty("defaultValue")&&w1(e,t.type,ao(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 w1(e,t,n){(t!=="number"||wm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ud=Array.isArray;function bc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=zh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kd={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},$8=["Webkit","ms","Moz","O"];Object.keys(kd).forEach(function(e){$8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kd[t]=kd[e]})});function ZI(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kd.hasOwnProperty(e)&&kd[e]?(""+t).trim():t+"px"}function JI(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ZI(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var H8=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function k1(e,t){if(t){if(H8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Le(62))}}function N1(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 S1=null;function Qx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var T1=null,Ec=null,xc=null;function Vk(e){if(e=qf(e)){if(typeof T1!="function")throw Error(Le(280));var t=e.stateNode;t&&(t=Hg(t),T1(e.stateNode,e.type,t))}}function eR(e){Ec?xc?xc.push(e):xc=[e]:Ec=e}function tR(){if(Ec){var e=Ec,t=xc;if(xc=Ec=null,Vk(e),t)for(e=0;e>>=0,e===0?32:31-(J8(e)/eF|0)|0}var Vh=64,Kh=4194304;function dd(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 Nm(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 l=a&~s;l!==0?r=dd(l):(i&=a,i!==0&&(r=dd(i)))}else a=n&~s,a!==0?r=dd(a):i!==0&&(r=dd(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 Wf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=n}function sF(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=Sd),Jk=" ",eN=!1;function wR(e,t){switch(e){case"keyup":return OF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ql=!1;function MF(e,t){switch(e){case"compositionend":return vR(t);case"keypress":return t.which!==32?null:(eN=!0,Jk);case"textInput":return e=t.data,e===Jk&&eN?null:e;default:return null}}function jF(e,t){if(ql)return e==="compositionend"||!iw&&wR(e,t)?(e=ER(),Vp=nw=Va=null,ql=!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=sN(n)}}function SR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?SR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function TR(){for(var e=window,t=wm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wm(e.document)}return t}function aw(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 VF(e){var t=TR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&SR(n.ownerDocument.documentElement,n)){if(r!==null&&aw(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=iN(n,i);var a=iN(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,Xl=null,L1=null,Ad=null,M1=!1;function aN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M1||Xl==null||Xl!==wm(r)||(r=Xl,"selectionStart"in r&&aw(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}),Ad&&lf(Ad,r)||(Ad=r,r=Am(L1,"onSelect"),0Jl||(e.current=U1[Jl],U1[Jl]=null,Jl--)}function an(e,t){Jl++,U1[Jl]=e.current,e.current=t}var oo={},Sr=fo(oo),Jr=fo(!1),el=oo;function jc(e,t){var n=e.type.contextTypes;if(!n)return oo;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 es(e){return e=e.childContextTypes,e!=null}function Im(){gn(Jr),gn(Sr)}function hN(e,t,n){if(Sr.current!==oo)throw Error(Le(168));an(Sr,t),an(Jr,n)}function DR(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(Le(108,F8(e)||"Unknown",s));return Rn({},n,r)}function Rm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,el=Sr.current,an(Sr,e),an(Jr,Jr.current),!0}function pN(e,t,n){var r=e.stateNode;if(!r)throw Error(Le(169));n?(e=DR(e,t,el),r.__reactInternalMemoizedMergedChildContext=e,gn(Jr),gn(Sr),an(Sr,e)):gn(Jr),an(Jr,n)}var ea=null,zg=!1,Ry=!1;function PR(e){ea===null?ea=[e]:ea.push(e)}function n9(e){zg=!0,PR(e)}function ho(){if(!Ry&&ea!==null){Ry=!0;var e=0,t=qt;try{var n=ea;for(qt=1;e>=a,s-=a,na=1<<32-fi(t)+s|n<S?(R=A,A=null):R=A.sibling;var I=h(y,A,x[S],_);if(I===null){A===null&&(A=R);break}e&&A&&I.alternate===null&&t(y,A),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,A=R}if(S===x.length)return n(y,A),vn&&Ao(y,S),k;if(A===null){for(;SS?(R=A,A=null):R=A.sibling;var D=h(y,A,I.value,_);if(D===null){A===null&&(A=R);break}e&&A&&D.alternate===null&&t(y,A),b=i(D,b,S),N===null?k=D:N.sibling=D,N=D,A=R}if(I.done)return n(y,A),vn&&Ao(y,S),k;if(A===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return vn&&Ao(y,S),k}for(A=r(y,A);!I.done;S++,I=x.next())I=p(A,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&A.forEach(function(F){return t(y,F)}),vn&&Ao(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Gl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case $h:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Gl){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pa&&yN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=Vu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Gl?(b=Wo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=Zp(x.type,x.key,x.props,null,y.mode,_),_.ref=Vu(y,b,x),_.return=y,y=_)}return a(y);case Wl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Fy(x,y.mode,_),b.return=y,y=b}return a(y);case Pa:return N=x._init,w(y,b,N(x._payload),_)}if(ud(x))return m(y,b,x,_);if(Fu(x))return g(y,b,x,_);Zh(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=By(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var Pc=$R(!0),HR=$R(!1),Mm=fo(null),jm=null,nc=null,uw=null;function dw(){uw=nc=jm=null}function fw(e){var t=Mm.current;gn(Mm),e._currentValue=t}function z1(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 vc(e,t){jm=e,uw=nc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qr=!0),e.firstContext=null)}function Fs(e){var t=e._currentValue;if(uw!==e)if(e={context:e,memoizedValue:t,next:null},nc===null){if(jm===null)throw Error(Le(308));nc=e,jm.dependencies={lanes:0,firstContext:e}}else nc=nc.next=e;return t}var Fo=null;function hw(e){Fo===null?Fo=[e]:Fo.push(e)}function zR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,hw(t)):(n.next=s.next,s.next=n),t.interleaved=n,fa(e,r)}function fa(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 pw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function VR(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 aa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ut&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,fa(e,n)}return s=r.interleaved,s===null?(t.next=t,hw(r)):(t.next=s.next,s.next=t),r.interleaved=t,fa(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,Jx(e,n)}}function bN(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 Dm(e,t,n,r){var s=e.updateQueue;Ba=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Rn({},f,h);break e;case 2:Ba=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);rl|=a,e.lanes=a,e.memoizedState=f}}function EN(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ly.transition;Ly.transition={};try{e(!1),t()}finally{qt=n,Ly.transition=r}}function oO(){return Us().memoizedState}function a9(e,t,n){var r=to(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lO(e))cO(t,n);else if(n=zR(e,t,n,r),n!==null){var s=Br();hi(n,e,r,s),uO(n,t,r)}}function o9(e,t,n){var r=to(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,bi(l,a)){var c=t.interleaved;c===null?(s.next=s,hw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=zR(e,t,s,r),n!==null&&(s=Br(),hi(n,e,r,s),uO(n,t,r))}}function lO(e){var t=e.alternate;return e===In||t!==null&&t===In}function cO(e,t){Cd=Bm=!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,Jx(e,n)}}var Fm={readContext:Fs,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},l9={readContext:Fs,useCallback:function(e,t){return Ci().memoizedState=[e,t===void 0?null:t],e},useContext:Fs,useEffect:wN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gp(4194308,4,nO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gp(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=a9.bind(null,In,e),[r.memoizedState,e]},useRef:function(e){var t=Ci();return e={current:e},t.memoizedState=e},useState:xN,useDebugValue:vw,useDeferredValue:function(e){return Ci().memoizedState=e},useTransition:function(){var e=xN(!1),t=e[0];return e=i9.bind(null,e[1]),Ci().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=In,s=Ci();if(vn){if(n===void 0)throw Error(Le(407));n=n()}else{if(n=t(),dr===null)throw Error(Le(349));nl&30||GR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,wN(XR.bind(null,r,i,e),[e]),r.flags|=2048,gf(9,qR.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ci(),t=dr.identifierPrefix;if(vn){var n=ra,r=na;n=(r&~(1<<32-fi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pf++,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[Li]=t,e[df]=r,xO(e,t,!1,!1),t.stateNode=e;e:{switch(a=N1(n,r),n){case"dialog":mn("cancel",e),mn("close",e),s=r;break;case"iframe":case"object":case"embed":mn("load",e),s=r;break;case"video":case"audio":for(s=0;sUc&&(t.flags|=128,r=!0,Ku(i,!1),t.lanes=4194304)}else{if(!r)if(e=Pm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ku(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!vn)return xr(t),null}else 2*zn()-i.renderingStartTime>Uc&&n!==1073741824&&(t.flags|=128,r=!0,Ku(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=zn(),t.sibling=null,n=An.current,an(An,r?n&1|2:n&1),t):(xr(t),null);case 22:case 23:return Aw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?us&1073741824&&(xr(t),t.subtreeFlags&6&&(t.flags|=8192)):xr(t),null;case 24:return null;case 25:return null}throw Error(Le(156,t.tag))}function g9(e,t){switch(lw(t),t.tag){case 1:return es(t.type)&&Im(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bc(),gn(Jr),gn(Sr),yw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gw(t),null;case 13:if(gn(An),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Le(340));Dc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gn(An),null;case 4:return Bc(),null;case 10:return fw(t.type._context),null;case 22:case 23:return Aw(),null;case 24:return null;default:return null}}var ep=!1,vr=!1,y9=typeof WeakSet=="function"?WeakSet:Set,We=null;function rc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Bn(e,t,r)}else n.current=null}function Z1(e,t,n){try{n()}catch(r){Bn(e,t,r)}}var ON=!1;function b9(e,t){if(j1=Sm,e=TR(),aw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(D1={focusedElem:e,selectionRange:n},Sm=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){t=We;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:ri(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Le(163))}}catch(_){Bn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,We=e;break}We=t.return}return m=ON,ON=!1,m}function Id(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&&Z1(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 J1(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[Li],delete t[df],delete t[F1],delete t[e9],delete t[t9])),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 LN(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 eE(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=Cm));else if(r!==4&&(e=e.child,e!==null))for(eE(e,t,n),e=e.sibling;e!==null;)eE(e,t,n),e=e.sibling}function tE(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(tE(e,t,n),e=e.sibling;e!==null;)tE(e,t,n),e=e.sibling}var hr=null,si=!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(ji&&typeof ji.onCommitFiberUnmount=="function")try{ji.onCommitFiberUnmount(Bg,n)}catch{}switch(n.tag){case 5:vr||rc(n,t);case 6:var r=hr,s=si;hr=null,Ca(e,t,n),hr=r,si=s,hr!==null&&(si?(e=hr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):hr.removeChild(n.stateNode));break;case 18:hr!==null&&(si?(e=hr,n=n.stateNode,e.nodeType===8?Iy(e.parentNode,n):e.nodeType===1&&Iy(e,n),af(e)):Iy(hr,n.stateNode));break;case 4:r=hr,s=si,hr=n.stateNode.containerInfo,si=!0,Ca(e,t,n),hr=r,si=s;break;case 0:case 11:case 14:case 15:if(!vr&&(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)&&Z1(n,t,a),s=s.next}while(s!==r)}Ca(e,t,n);break;case 1:if(!vr&&(rc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Bn(n,t,l)}Ca(e,t,n);break;case 21:Ca(e,t,n);break;case 22:n.mode&1?(vr=(r=vr)||n.memoizedState!==null,Ca(e,t,n),vr=r):Ca(e,t,n);break;default:Ca(e,t,n)}}function MN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new y9),t.forEach(function(r){var s=T9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Js(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=zn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*x9(r/1960))-r,10e?16:e,Ka===null)var r=!1;else{if(e=Ka,Ka=null,Hm=0,Ut&6)throw Error(Le(331));var s=Ut;for(Ut|=4,We=e.current;We!==null;){var i=We,a=i.child;if(We.flags&16){var l=i.deletions;if(l!==null){for(var c=0;czn()-Sw?Yo(e,0):Nw|=n),ts(e,t)}function LO(e,t){t===0&&(e.mode&1?(t=Kh,Kh<<=1,!(Kh&130023424)&&(Kh=4194304)):t=1);var n=Br();e=fa(e,t),e!==null&&(Wf(e,t,n),ts(e,n))}function S9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),LO(e,n)}function T9(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(Le(314))}r!==null&&r.delete(t),LO(e,n)}var MO;MO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Jr.current)Qr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qr=!1,p9(e,t,n);Qr=!!(e.flags&131072)}else Qr=!1,vn&&t.flags&1048576&&BR(t,Lm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qp(e,t),e=t.pendingProps;var s=jc(t,Sr.current);vc(t,n),s=Ew(null,t,r,e,s,n);var i=xw();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,es(r)?(i=!0,Rm(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pw(t),s.updater=Kg,t.stateNode=s,s._reactInternals=t,K1(t,r,e,n),t=G1(null,t,r,!0,i,n)):(t.tag=0,vn&&i&&ow(t),Mr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=C9(r),e=ri(r,e),s){case 0:t=W1(null,t,r,e,n);break e;case 1:t=CN(null,t,r,e,n);break e;case 11:t=TN(null,t,r,e,n);break e;case 14:t=AN(null,t,r,ri(r.type,e),n);break e}throw Error(Le(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),W1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),CN(e,t,r,s,n);case 3:e:{if(yO(t),e===null)throw Error(Le(387));r=t.pendingProps,i=t.memoizedState,s=i.element,VR(e,t),Dm(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=Fc(Error(Le(423)),t),t=IN(e,t,r,n,s);break e}else if(r!==s){s=Fc(Error(Le(424)),t),t=IN(e,t,r,n,s);break e}else for(fs=Za(t.stateNode.containerInfo.firstChild),hs=t,vn=!0,ai=null,n=HR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dc(),r===s){t=ha(e,t,n);break e}Mr(e,t,r,n)}t=t.child}return t;case 5:return KR(t),e===null&&H1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,P1(r,s)?a=null:i!==null&&P1(r,i)&&(t.flags|=32),gO(e,t),Mr(e,t,a,n),t.child;case 6:return e===null&&H1(t),null;case 13:return bO(e,t,n);case 4:return mw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pc(t,null,r,n):Mr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),TN(e,t,r,s,n);case 7:return Mr(e,t,t.pendingProps,n),t.child;case 8:return Mr(e,t,t.pendingProps.children,n),t.child;case 12:return Mr(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,an(Mm,r._currentValue),r._currentValue=a,i!==null)if(bi(i.value,a)){if(i.children===s.children&&!Jr.current){t=ha(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=aa(-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),z1(i.return,n,t),l.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(Le(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),z1(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}Mr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,vc(t,n),s=Fs(s),r=r(s),t.flags|=1,Mr(e,t,r,n),t.child;case 14:return r=t.type,s=ri(r,t.pendingProps),s=ri(r.type,s),AN(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:ri(r,s),qp(e,t),t.tag=1,es(r)?(e=!0,Rm(t)):e=!1,vc(t,n),dO(t,r,s),K1(t,r,s,n),G1(null,t,r,!0,e,n);case 19:return EO(e,t,n);case 22:return mO(e,t,n)}throw Error(Le(156,t.tag))};function jO(e,t){return lR(e,t)}function A9(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 js(e,t,n,r){return new A9(e,t,n,r)}function Iw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function C9(e){if(typeof e=="function")return Iw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qx)return 11;if(e===Xx)return 14}return 2}function no(e,t){var n=e.alternate;return n===null?(n=js(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 Zp(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Iw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Gl:return Wo(n.children,s,i,t);case Gx:a=8,s|=8;break;case m1:return e=js(12,n,t,s|2),e.elementType=m1,e.lanes=i,e;case g1:return e=js(13,n,t,s),e.elementType=g1,e.lanes=i,e;case y1:return e=js(19,n,t,s),e.elementType=y1,e.lanes=i,e;case KI:return Gg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zI:a=10;break e;case VI:a=9;break e;case qx:a=11;break e;case Xx:a=14;break e;case Pa:a=16,r=null;break e}throw Error(Le(130,e==null?e:typeof e,""))}return t=js(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Wo(e,t,n,r){return e=js(7,e,r,t),e.lanes=n,e}function Gg(e,t,n,r){return e=js(22,e,r,t),e.elementType=KI,e.lanes=n,e.stateNode={isHidden:!1},e}function By(e,t,n){return e=js(6,e,null,t),e.lanes=n,e}function Fy(e,t,n){return t=js(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I9(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=Ey(0),this.expirationTimes=Ey(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ey(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Rw(e,t,n,r,s,i,a,l,c){return e=new I9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=js(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pw(i),e}function R9(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(),FI.exports=Es;var $s=FI.exports,HN=$s;h1.createRoot=HN.createRoot,h1.hydrateRoot=HN.hydrateRoot;const jw=E.createContext({});function Jg(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const e0=E.createContext(null),bf=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class D9 extends E.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 P9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(bf);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)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: ${l}px !important; - top: ${c}px !important; - left: ${u}px !important; - } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(D9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const B9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=Jg(F9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(P9,{isPresent:n,children:e})),o.jsx(e0.Provider,{value:d,children:e})};function F9(){return new Map}function UO(e=!0){const t=E.useContext(e0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const rp=e=>e.key||"";function zN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Dw=typeof window<"u",$O=Dw?E.useLayoutEffect:E.useEffect,oi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=UO(a),u=E.useMemo(()=>zN(e),[e]),d=a&&!l?[]:u.map(rp),f=E.useRef(!0),h=E.useRef(u),p=Jg(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);$O(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=rp(_),N=a&&!l?!1:u===w||d.includes(k),A=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx(B9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:A,children:_},k)})})},ps=e=>e;let HO=ps;const U9={useManualTiming:!1};function $9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const sp=["read","resolveKeyframes","update","preRender","render","postRender"],H9=40;function zO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=sp.reduce((y,b)=>(y[b]=$9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,H9),1),s.timestamp=y,s.isProcessing=!0,l.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:sp.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bVN[e].some(n=>!!t[n])};function z9(e){for(const t in e)$c[t]={...$c[t],...e[t]}}const V9=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 Km(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||V9.has(e)}let KO=e=>!Km(e);function YO(e){e&&(KO=t=>t.startsWith("on")?!Km(t):e(t))}try{YO(require("@emotion/is-prop-valid").default)}catch{}function K9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(KO(s)||n===!0&&Km(s)||!t&&!Km(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function Y9({children:e,isValidProp:t,...n}){t&&YO(t),n={...E.useContext(bf),...n},n.isStatic=Jg(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(bf.Provider,{value:r,children:e})}function W9(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 t0=E.createContext({});function Ef(e){return typeof e=="string"||Array.isArray(e)}function n0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Pw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bw=["initial",...Pw];function r0(e){return n0(e.animate)||Bw.some(t=>Ef(e[t]))}function WO(e){return!!(r0(e)||e.variants)}function G9(e,t){if(r0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ef(n)?n:void 0,animate:Ef(r)?r:void 0}}return e.inherit!==!1?t:{}}function q9(e){const{initial:t,animate:n}=G9(e,E.useContext(t0));return E.useMemo(()=>({initial:t,animate:n}),[KN(t),KN(n)])}function KN(e){return Array.isArray(e)?e.join(" "):e}const X9=Symbol.for("motionComponentSymbol");function ic(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Q9(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ic(n)&&(n.current=r))},[t])}const Fw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Z9="framerAppearId",GO="data-"+Fw(Z9),{schedule:Uw}=zO(queueMicrotask,!1),qO=E.createContext({});function J9(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(t0),c=E.useContext(VO),u=E.useContext(e0),d=E.useContext(bf).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(qO);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&eU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[GO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return $O(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Uw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function eU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,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||l&&ic(l),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 tU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&z9(e);function l(u,d){let f;const h={...E.useContext(bf),...u,layoutId:nU(u)},{isStatic:p}=h,m=q9(u),g=r(u,p);if(!p&&Dw){rU();const w=sU(h);f=w.MeasureLayout,m.visualElement=J9(s,g,h,t,w.ProjectionNode)}return o.jsxs(t0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,Q9(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[X9]=s,c}function nU({layoutId:e}){const t=E.useContext(jw).id;return t&&e!==void 0?t+"-"+e:e}function rU(e,t){E.useContext(VO).strict}function sU(e){const{drag:t,layout:n}=$c;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 iU=["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 $w(e){return typeof e!="string"||e.includes("-")?!1:!!(iU.indexOf(e)>-1||/[A-Z]/u.test(e))}function YN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Hw(e,t,n,r){if(typeof t=="function"){const[s,i]=YN(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]=YN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const aE=e=>Array.isArray(e),aU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),oU=e=>aE(e)?e[e.length-1]||0:e,_r=e=>!!(e&&e.getVelocity);function Jp(e){const t=_r(e)?e.get():e;return aU(t)?t.toValue():t}function lU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:cU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const QO=e=>(t,n)=>{const r=E.useContext(t0),s=E.useContext(e0),i=()=>lU(e,t,r,s);return n?i():Jg(i)};function cU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Jp(i[h]);let{initial:a,animate:l}=e;const c=r0(e),u=WO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!n0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),JO=ZO("--"),uU=ZO("var(--"),zw=e=>uU(e)?dU.test(e.split("/*")[0].trim()):!1,dU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,eL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,pa=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},xf={...mu,transform:e=>pa(0,1,e)},ip={...mu,default:1},Qf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ma=Qf("deg"),Pi=Qf("%"),at=Qf("px"),fU=Qf("vh"),hU=Qf("vw"),WN={...Pi,parse:e=>Pi.parse(e)/100,transform:e=>Pi.transform(e*100)},pU={borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,backgroundPositionX:at,backgroundPositionY:at},mU={rotate:Ma,rotateX:Ma,rotateY:Ma,rotateZ:Ma,scale:ip,scaleX:ip,scaleY:ip,scaleZ:ip,skew:Ma,skewX:Ma,skewY:Ma,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:xf,originX:WN,originY:WN,originZ:at},GN={...mu,transform:Math.round},Vw={...pU,...mU,zIndex:GN,size:at,fillOpacity:xf,strokeOpacity:xf,numOctaves:GN},gU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yU=pu.length;function bU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),tL=()=>({...Ww(),attrs:{}}),Gw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nL(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 rL=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 sL(e,t,n,r){nL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rL.has(s)?s:Fw(s),t.attrs[s])}const Ym={};function _U(e){Object.assign(Ym,e)}function iL(e,{layout:t,layoutId:n}){return yl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ym[e]||e==="opacity")}function qw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(_r(s[a])||t.style&&_r(t.style[a])||iL(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 aL(e,t,n){const r=qw(e,t,n);for(const s in e)if(_r(e[s])||_r(t[s])){const i=pu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function kU(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 XN=["x","y","width","height","cx","cy","r"],NU={useVisualState:QO({scrapeMotionValuesFromProps:aL,createRenderState:tL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(yl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{kU(n,r),yn.render(()=>{Yw(r,s,Gw(n.tagName),e.transformTemplate),sL(n,r)})})}})},SU={useVisualState:QO({scrapeMotionValuesFromProps:qw,createRenderState:Ww})};function oL(e,t,n){for(const r in t)!_r(t[r])&&!iL(r,n)&&(e[r]=t[r])}function TU({transformTemplate:e},t){return E.useMemo(()=>{const n=Ww();return Kw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function AU(e,t){const n=e.style||{},r={};return oL(r,n,e),Object.assign(r,TU(e,t)),r}function CU(e,t){const n={},r=AU(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 IU(e,t,n,r){const s=E.useMemo(()=>{const i=tL();return Yw(i,t,Gw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};oL(i,e.style,e),s.style={...i,...s.style}}return s}function RU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=($w(n)?IU:CU)(r,i,a,n),u=K9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>_r(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function OU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...$w(r)?NU:SU,preloadedFeatures:e,useRender:RU(s),createVisualElement:t,Component:r};return tU(a)}}function lL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(em===void 0&&Bi.set(pr.isProcessing||U9.useManualTiming?pr.timestamp:performance.now()),em),set:e=>{em=e,queueMicrotask(LU)}};function Qw(e,t){e.indexOf(t)===-1&&e.push(t)}function Zw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Jw{constructor(){this.subscriptions=[]}add(t){return Qw(this.subscriptions,t),()=>Zw(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 jU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Bi.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=Bi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=MU(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 Jw);const r=this.events[t].add(n);return t==="change"?()=>{r(),yn.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=Bi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>QN)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,QN);return uL(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 wf(e,t){return new jU(e,t)}function DU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wf(n))}function PU(e,t){const n=s0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=oU(i[a]);DU(e,a,l)}}function BU(e){return!!(_r(e)&&e.add)}function oE(e,t){const n=e.getValue("willChange");if(BU(n))return n.add(t)}function dL(e){return e.props[GO]}function ev(e){let t;return()=>(t===void 0&&(t=e()),t)}const FU=ev(()=>window.ScrollTimeline!==void 0);class UU{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(FU()&&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 $U extends UU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const oa=e=>e*1e3,la=e=>e/1e3;function tv(e){return typeof e=="function"}function ZN(e,t){e.timeline=t,e.onfinish=null}const nv=e=>Array.isArray(e)&&typeof e[0]=="number",HU={linearEasing:void 0};function zU(e,t){const n=ev(e);return()=>{var r;return(r=HU[t])!==null&&r!==void 0?r:n()}}const Wm=zU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},fL=(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})`,lE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hd([0,.65,.55,1]),circOut:hd([.55,0,1,.45]),backIn:hd([.31,.01,.66,-.59]),backOut:hd([.33,1.53,.69,.99])};function pL(e,t){if(e)return typeof e=="function"&&Wm()?fL(e,t):nv(e)?hd(e):Array.isArray(e)?e.map(n=>pL(n,t)||lE.easeOut):lE[e]}const mL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,VU=1e-7,KU=12;function YU(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=mL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>VU&&++lYU(i,0,1,e,n);return i=>i===0||i===1?i:mL(s(i),t,r)}const gL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yL=e=>t=>1-e(1-t),bL=Zf(.33,1.53,.69,.99),rv=yL(bL),EL=gL(rv),xL=e=>(e*=2)<1?.5*rv(e):.5*(2-Math.pow(2,-10*(e-1))),sv=e=>1-Math.sin(Math.acos(e)),wL=yL(sv),vL=gL(sv),_L=e=>/^0[^.\s]+$/u.test(e);function WU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||_L(e):!0}const Ld=e=>Math.round(e*1e5)/1e5,iv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GU(e){return e==null}const qU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,av=(e,t)=>n=>!!(typeof n=="string"&&qU.test(n)&&n.startsWith(e)||t&&!GU(n)&&Object.prototype.hasOwnProperty.call(n,t)),kL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(iv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},XU=e=>pa(0,255,e),$y={...mu,transform:e=>Math.round(XU(e))},$o={test:av("rgb","red"),parse:kL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$y.transform(e)+", "+$y.transform(t)+", "+$y.transform(n)+", "+Ld(xf.transform(r))+")"};function QU(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 cE={test:av("#"),parse:QU,transform:$o.transform},ac={test:av("hsl","hue"),parse:kL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Pi.transform(Ld(t))+", "+Pi.transform(Ld(n))+", "+Ld(xf.transform(r))+")"},wr={test:e=>$o.test(e)||cE.test(e)||ac.test(e),parse:e=>$o.test(e)?$o.parse(e):ac.test(e)?ac.parse(e):cE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$o.transform(e):ac.transform(e)},ZU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function JU(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(iv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(ZU))===null||n===void 0?void 0:n.length)||0)>0}const NL="number",SL="color",e$="var",t$="var(",JN="${}",n$=/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 vf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(n$,c=>(wr.test(c)?(r.color.push(i),s.push(SL),n.push(wr.parse(c))):c.startsWith(t$)?(r.var.push(i),s.push(e$),n.push(c)):(r.number.push(i),s.push(NL),n.push(parseFloat(c))),++i,JN)).split(JN);return{values:n,split:l,indexes:r,types:s}}function TL(e){return vf(e).values}function AL(e){const{split:t,types:n}=vf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function s$(e){const t=TL(e);return AL(e)(t.map(r$))}const co={test:JU,parse:TL,createTransformer:AL,getAnimatableNone:s$},i$=new Set(["brightness","contrast","saturate","opacity"]);function a$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(iv)||[];if(!r)return e;const s=n.replace(r,"");let i=i$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const o$=/\b([a-z-]*)\(.*?\)/gu,uE={...co,getAnimatableNone:e=>{const t=e.match(o$);return t?t.map(a$).join(" "):e}},l$={...Vw,color:wr,backgroundColor:wr,outlineColor:wr,fill:wr,stroke:wr,borderColor:wr,borderTopColor:wr,borderRightColor:wr,borderBottomColor:wr,borderLeftColor:wr,filter:uE,WebkitFilter:uE},ov=e=>l$[e];function CL(e,t){let n=ov(e);return n!==uE&&(n=co),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const c$=new Set(["auto","none","0"]);function u$(e,t,n){let r=0,s;for(;re===mu||e===at,tS=(e,t)=>parseFloat(e.split(", ")[t]),nS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return tS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?tS(i[1],e):0}},d$=new Set(["x","y","z"]),f$=pu.filter(e=>!d$.has(e));function h$(e){const t=[];return f$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zc={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:nS(4,13),y:nS(5,14)};zc.translateX=zc.x;zc.translateY=zc.y;const Go=new Set;let dE=!1,fE=!1;function IL(){if(fE){const e=Array.from(Go).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=h$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fE=!1,dE=!1,Go.forEach(e=>e.complete()),Go.clear()}function RL(){Go.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fE=!0)})}function p$(){RL(),IL()}class lv{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?(Go.add(this),dE||(dE=!0,yn.read(RL),yn.resolveKeyframes(IL))):(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),m$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g$(e){const t=m$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function LL(e,t,n=1){const[r,s]=g$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return OL(a)?parseFloat(a):a}return zw(s)?LL(s,t,n+1):s}const ML=e=>t=>t.test(e),y$={test:e=>e==="auto",parse:e=>e},jL=[mu,at,Pi,Ma,hU,fU,y$],rS=e=>jL.find(ML(e));class DL extends lv{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 sS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(co.test(e)||e==="0")&&!e.startsWith("url("));function b$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function i0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(x$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const w$=40;class PL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Bi.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>w$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&p$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Bi.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!E$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(i0(t,this.options,n)),l&&l(),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 hE=2e4;function BL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=hE?1/0:t}const Cn=(e,t,n)=>e+(t-e)*n;function Hy(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 v$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Hy(c,l,e+1/3),i=Hy(c,l,e),a=Hy(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Gm(e,t){return n=>n>0?t:e}const zy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},_$=[cE,$o,ac],k$=e=>_$.find(t=>t.test(e));function iS(e){const t=k$(e);if(!t)return!1;let n=t.parse(e);return t===ac&&(n=v$(n)),n}const aS=(e,t)=>{const n=iS(e),r=iS(t);if(!n||!r)return Gm(e,t);const s={...n};return i=>(s.red=zy(n.red,r.red,i),s.green=zy(n.green,r.green,i),s.blue=zy(n.blue,r.blue,i),s.alpha=Cn(n.alpha,r.alpha,i),$o.transform(s))},N$=(e,t)=>n=>t(e(n)),Jf=(...e)=>e.reduce(N$),pE=new Set(["none","hidden"]);function S$(e,t){return pE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function T$(e,t){return n=>Cn(e,t,n)}function cv(e){return typeof e=="number"?T$:typeof e=="string"?zw(e)?Gm:wr.test(e)?aS:I$:Array.isArray(e)?FL:typeof e=="object"?wr.test(e)?aS:A$:Gm}function FL(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>cv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function C$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=co.createTransformer(t),r=vf(e),s=vf(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?pE.has(e)&&!s.values.length||pE.has(t)&&!r.values.length?S$(e,t):Jf(FL(C$(r,s),s.values),n):Gm(e,t)};function UL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Cn(e,t,n):cv(e)(e,t)}const R$=5;function $L(e,t,n){const r=Math.max(t-R$,0);return uL(n-e(r),t-r)}const Pn={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},Vy=.001;function O$({duration:e=Pn.duration,bounce:t=Pn.bounce,velocity:n=Pn.velocity,mass:r=Pn.mass}){let s,i,a=1-t;a=pa(Pn.minDamping,Pn.maxDamping,a),e=pa(Pn.minDuration,Pn.maxDuration,la(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=mE(u,a),m=Math.exp(-f);return Vy-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),g=mE(Math.pow(u,2),a);return(-s(u)+Vy>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Vy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=M$(s,i,l);if(e=oa(e),isNaN(c))return{stiffness:Pn.stiffness,damping:Pn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const L$=12;function M$(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function P$(e){let t={velocity:Pn.velocity,stiffness:Pn.stiffness,damping:Pn.damping,mass:Pn.mass,isResolvedFromDuration:!1,...e};if(!oS(e,D$)&&oS(e,j$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*pa(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Pn.mass,stiffness:s,damping:i}}else{const n=O$(e);t={...t,...n,mass:Pn.mass},t.isResolvedFromDuration=!0}return t}function HL(e=Pn.visualDuration,t=Pn.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],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=P$({...n,velocity:-la(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=la(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?Pn.restSpeed.granular:Pn.restSpeed.default),s||(s=b?Pn.restDelta.granular:Pn.restDelta.default);let x;if(g<1){const k=mE(y,g);x=N=>{const A=Math.exp(-g*y*N);return a-A*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const A=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-A*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let A=0;g<1&&(A=k===0?oa(m):$L(x,k,N));const S=Math.abs(A)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(BL(_),hE),N=fL(A=>_.next(k*A).value,k,30);return k+"ms "+N}};return _}function lS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const A=S=>{p(h.value)&&(k=S,N=HL({keyframes:[h.value,m(h.value)],velocity:$L(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),A(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const B$=Zf(.42,0,1,1),F$=Zf(0,0,.58,1),zL=Zf(.42,0,.58,1),U$=e=>Array.isArray(e)&&typeof e[0]!="number",$$={linear:ps,easeIn:B$,easeInOut:zL,easeOut:F$,circIn:sv,circInOut:vL,circOut:wL,backIn:rv,backInOut:EL,backOut:bL,anticipate:xL},cS=e=>{if(nv(e)){HO(e.length===4);const[t,n,r,s]=e;return Zf(t,n,r,s)}else if(typeof e=="string")return $$[e];return e};function H$(e,t,n){const r=[],s=n||UL,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 l=H$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(pa(e[0],e[i-1],d)):u}function V$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Hc(0,t,r);e.push(Cn(n,1,s))}}function K$(e){const t=[0];return V$(t,e.length-1),t}function Y$(e,t){return e.map(n=>n*t)}function W$(e,t){return e.map(()=>t||zL).splice(0,e.length-1)}function qm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=U$(r)?r.map(cS):cS(r),i={done:!1,value:t[0]},a=Y$(n&&n.length===t.length?n:K$(t),e),l=z$(a,t,{ease:Array.isArray(s)?s:W$(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const G$=e=>{const t=({timestamp:n})=>e(n);return{start:()=>yn.update(t,!0),stop:()=>lo(t),now:()=>pr.isProcessing?pr.timestamp:Bi.now()}},q$={decay:lS,inertia:lS,tween:qm,keyframes:qm,spring:HL},X$=e=>e/100;class uv extends PL{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)||lv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=tv(n)?n:q$[n]||qm;let c,u;l!==qm&&typeof t[0]!="number"&&(c=Jf(X$,UL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=BL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=pa(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return A&&s!==void 0&&(k.value=i0(c,this.options,s)),w&&w(k.value),A&&this.finish(),k}get duration(){const{resolved:t}=this;return t?la(t.calculatedDuration):0}get time(){return la(this.currentTime)}set time(t){t=oa(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=la(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=G$,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 Q$=new Set(["opacity","clipPath","filter","transform"]);function Z$(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=pL(l,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 J$=ev(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xm=10,e7=2e4;function t7(e){return tv(e.type)||e.type==="spring"||!hL(e.ease)}function n7(e,t){const n=new uv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Wm()&&r7(i)&&(i=VL[i]),t7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=n7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=Z$(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(ZN(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(i0(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 la(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return la(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=oa(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 ps;const{animation:r}=n;ZN(r,t)}return ps}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:l}=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 uv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=oa(this.time);u.setWithVelocity(m.sample(g-Xm).value,m.sample(g).value,Xm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return J$()&&r&&Q$.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const s7={type:"spring",stiffness:500,damping:25,restSpeed:10},i7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),a7={type:"keyframes",duration:.8},o7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},l7=(e,{keyframes:t})=>t.length>2?a7:yl.has(e)?e.startsWith("scale")?i7(t[1]):s7:o7;function c7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dv=(e,t,n,r={},s,i)=>a=>{const l=Xw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-oa(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};c7(l)||(d={...d,...l7(e,d)}),d.duration&&(d.duration=oa(d.duration)),d.repeatDelay&&(d.repeatDelay=oa(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=i0(d.keyframes,l);if(h!==void 0)return yn.update(()=>{d.onUpdate(h),d.onComplete()}),new $U([])}return!i&&uS.supports(d)?new uS(d):new uv(d)};function u7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function KL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&u7(d,f))continue;const m={delay:n,...Xw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=dL(e);if(y){const b=window.MotionHandoffAnimation(y,f,yn);b!==null&&(m.startTime=b,g=!0)}}oE(e,f),h.start(dv(f,h,p,e.shouldReduceMotion&&cL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{yn.update(()=>{l&&PU(e,l)})}),u}function gE(e,t,n={}){var r;const s=s0(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(KL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return d7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function d7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(f7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(gE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function f7(e,t){return e.sortNodePosition(t)}function h7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>gE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=gE(e,t,n);else{const s=typeof t=="function"?s0(e,t,n.custom):t;r=Promise.all(KL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const p7=Bw.length;function YL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?YL(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})=>h7(e,n,r)))}function b7(e){let t=y7(e),n=dS(),r=!0;const s=c=>(u,d)=>{var f;const h=s0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=YL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(x)?x:[x];let D=I.reduce(s(y),{});k===!1&&(D={});const{prevResolvedValues:F={}}=b,W={...F,...D},L=M=>{S=!0,h.has(M)&&(R=!0,h.delete(M)),b.needsAnimating[M]=!0;const O=e.getValue(M);O&&(O.liveStyle=!1)};for(const M in W){const O=D[M],j=F[M];if(p.hasOwnProperty(M))continue;let T=!1;aE(O)&&aE(j)?T=!lL(O,j):T=O!==j,T?O!=null?L(M):h.add(M):O!==void 0&&h.has(M)?L(M):b.protectedKeys[M]=!0}b.prevProp=x,b.prevResolvedValues=D,b.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&A)||R)&&f.push(...I.map(M=>({animation:M,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=dS(),r=!0}}}function E7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!lL(t,e):!1}function No(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dS(){return{animate:No(!0),whileInView:No(),whileHover:No(),whileTap:No(),whileDrag:No(),whileFocus:No(),exit:No()}}class po{constructor(t){this.isMounted=!1,this.node=t}update(){}}class x7 extends po{constructor(t){super(t),t.animationState||(t.animationState=b7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();n0(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 w7=0;class v7 extends po{constructor(){super(...arguments),this.id=w7++}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 _7={animation:{Feature:x7},exit:{Feature:v7}},ni={x:!1,y:!1};function WL(){return ni.x||ni.y}function k7(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}const fv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function _f(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function eh(e){return{point:{x:e.pageX,y:e.pageY}}}const N7=e=>t=>fv(t)&&e(t,eh(t));function Md(e,t,n,r){return _f(e,t,N7(n),r)}const fS=(e,t)=>Math.abs(e-t);function S7(e,t){const n=fS(e.x,t.x),r=fS(e.y,t.y);return Math.sqrt(n**2+r**2)}class GL{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=Yy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=S7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=pr;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Ky(h,this.transformPagePoint),yn.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Yy(f.type==="pointercancel"?this.lastMoveEventInfo:Ky(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!fv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=eh(t),l=Ky(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=pr;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Yy(l,this.history)),this.removeListeners=Jf(Md(this.contextWindow,"pointermove",this.handlePointerMove),Md(this.contextWindow,"pointerup",this.handlePointerUp),Md(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lo(this.updatePoint)}}function Ky(e,t){return t?{point:t(e.point)}:e}function hS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yy({point:e},t){return{point:e,delta:hS(e,qL(t)),offset:hS(e,T7(t)),velocity:A7(t,.1)}}function T7(e){return e[0]}function qL(e){return e[e.length-1]}function A7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=qL(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>oa(t)));)n--;if(!r)return{x:0,y:0};const i=la(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 XL=1e-4,C7=1-XL,I7=1+XL,QL=.01,R7=0-QL,O7=0+QL;function ys(e){return e.max-e.min}function L7(e,t,n){return Math.abs(e-t)<=n}function pS(e,t,n,r=.5){e.origin=r,e.originPoint=Cn(t.min,t.max,e.origin),e.scale=ys(n)/ys(t),e.translate=Cn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=C7&&e.scale<=I7||isNaN(e.scale))&&(e.scale=1),(e.translate>=R7&&e.translate<=O7||isNaN(e.translate))&&(e.translate=0)}function jd(e,t,n,r){pS(e.x,t.x,n.x,r?r.originX:void 0),pS(e.y,t.y,n.y,r?r.originY:void 0)}function mS(e,t,n){e.min=n.min+t.min,e.max=e.min+ys(t)}function M7(e,t,n){mS(e.x,t.x,n.x),mS(e.y,t.y,n.y)}function gS(e,t,n){e.min=t.min-n.min,e.max=e.min+ys(t)}function Dd(e,t,n){gS(e.x,t.x,n.x),gS(e.y,t.y,n.y)}function j7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Cn(n,e,r.max):Math.min(e,n)),e}function yS(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 D7(e,{top:t,left:n,bottom:r,right:s}){return{x:yS(e.x,n,s),y:yS(e.y,t,r)}}function bS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Hc(t.min,t.max-r,e.min):r>s&&(n=Hc(e.min,e.max-s,t.min)),pa(0,1,n)}function F7(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 yE=.35;function U7(e=yE){return e===!1?e=0:e===!0&&(e=yE),{x:ES(e,"left","right"),y:ES(e,"top","bottom")}}function ES(e,t,n){return{min:xS(e,t),max:xS(e,n)}}function xS(e,t){return typeof e=="number"?e:e[t]||0}const wS=()=>({translate:0,scale:1,origin:0,originPoint:0}),oc=()=>({x:wS(),y:wS()}),vS=()=>({min:0,max:0}),Hn=()=>({x:vS(),y:vS()});function Ts(e){return[e("x"),e("y")]}function ZL({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function H7(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 Wy(e){return e===void 0||e===1}function bE({scale:e,scaleX:t,scaleY:n}){return!Wy(e)||!Wy(t)||!Wy(n)}function Io(e){return bE(e)||JL(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JL(e){return _S(e.x)||_S(e.y)}function _S(e){return e&&e!=="0%"}function Qm(e,t,n){const r=e-n,s=t*r;return n+s}function kS(e,t,n,r,s){return s!==void 0&&(e=Qm(e,s,r)),Qm(e,n,r)+t}function EE(e,t=0,n=1,r,s){e.min=kS(e.min,t,n,r,s),e.max=kS(e.max,t,n,r,s)}function eM(e,{x:t,y:n}){EE(e.x,t.translate,t.scale,t.originPoint),EE(e.y,n.translate,n.scale,n.originPoint)}const NS=.999999999999,SS=1.0000000000001;function z7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lNS&&(t.x=1),t.yNS&&(t.y=1)}function lc(e,t){e.min=e.min+t,e.max=e.max+t}function TS(e,t,n,r,s=.5){const i=Cn(e.min,e.max,s);EE(e,t,n,i,r)}function cc(e,t){TS(e.x,t.x,t.scaleX,t.scale,t.originX),TS(e.y,t.y,t.scaleY,t.scale,t.originY)}function tM(e,t){return ZL(H7(e.getBoundingClientRect(),t))}function V7(e,t,n){const r=tM(e,n),{scroll:s}=t;return s&&(lc(r.x,s.offset.x),lc(r.y,s.offset.y)),r}const nM=({current:e})=>e?e.ownerDocument.defaultView:null,K7=new WeakMap;class Y7{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=Hn(),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(eh(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=k7(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),Ts(w=>{let y=this.getAxisMotionValue(w).get()||0;if(Pi.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=ys(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&yn.postRender(()=>m(d,f)),oE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=W7(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ts(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 GL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:nM(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&&yn.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||!ap(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=j7(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&&ic(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=D7(s.layoutBox,n):this.constraints=!1,this.elastic=U7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ts(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=F7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ic(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=V7(r,s.root,this.visualElement.getTransformPagePoint());let a=P7(s.layout.layoutBox,i);if(n){const l=n($7(a));this.hasMutatedConstraints=!!l,l&&(a=ZL(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ts(d=>{if(!ap(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oE(this.visualElement,t),r.start(dv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ts(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ts(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){Ts(n=>{const{drag:r}=this.getProps();if(!ap(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-Cn(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ic(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ts(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=B7({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(),Ts(a=>{if(!ap(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Cn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;K7.set(this.visualElement,this);const t=this.visualElement.current,n=Md(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();ic(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()),yn.read(r);const a=_f(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ts(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=yE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function ap(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function W7(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class G7 extends po{constructor(t){super(t),this.removeGroupControls=ps,this.removeListeners=ps,this.controls=new Y7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ps}unmount(){this.removeGroupControls(),this.removeListeners()}}const AS=e=>(t,n)=>{e&&yn.postRender(()=>e(t,n))};class q7 extends po{constructor(){super(...arguments),this.removePointerDownListener=ps}onPointerDown(t){this.session=new GL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:AS(t),onStart:AS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&yn.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Md(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 tm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function CS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(at.test(e))e=parseFloat(e);else return e;const n=CS(e,t.target.x),r=CS(e,t.target.y);return`${n}% ${r}%`}},X7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=co.parse(e);if(s.length>5)return r;const i=co.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=Cn(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class Q7 extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;_U(Z7),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()})),tm.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()||yn.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Uw.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 rM(e){const[t,n]=UO(),r=E.useContext(jw);return o.jsx(Q7,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(qO),isPresent:t,safeToRemove:n})}const Z7={borderRadius:{...Wu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wu,borderTopRightRadius:Wu,borderBottomLeftRadius:Wu,borderBottomRightRadius:Wu,boxShadow:X7};function J7(e,t,n){const r=_r(e)?e:wf(e);return r.start(dv("",r,t,n)),r.animation}function eH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const tH=(e,t)=>e.depth-t.depth;class nH{constructor(){this.children=[],this.isDirty=!1}add(t){Qw(this.children,t),this.isDirty=!0}remove(t){Zw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tH),this.isDirty=!1,this.children.forEach(t)}}function rH(e,t){const n=Bi.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(lo(r),e(i-t))};return yn.read(r,!0),()=>lo(r)}const sM=["TopLeft","TopRight","BottomLeft","BottomRight"],sH=sM.length,IS=e=>typeof e=="string"?parseFloat(e):e,RS=e=>typeof e=="number"||at.test(e);function iH(e,t,n,r,s,i){s?(e.opacity=Cn(0,n.opacity!==void 0?n.opacity:1,aH(r)),e.opacityExit=Cn(t.opacity!==void 0?t.opacity:1,0,oH(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(Hc(e,t,r))}function LS(e,t){e.min=t.min,e.max=t.max}function Ss(e,t){LS(e.x,t.x),LS(e.y,t.y)}function MS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function jS(e,t,n,r,s){return e-=t,e=Qm(e,1/n,r),s!==void 0&&(e=Qm(e,1/s,r)),e}function lH(e,t=0,n=1,r=.5,s,i=e,a=e){if(Pi.test(t)&&(t=parseFloat(t),t=Cn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Cn(i.min,i.max,r);e===i&&(l-=t),e.min=jS(e.min,t,n,l,s),e.max=jS(e.max,t,n,l,s)}function DS(e,t,[n,r,s],i,a){lH(e,t[n],t[r],t[s],t.scale,i,a)}const cH=["x","scaleX","originX"],uH=["y","scaleY","originY"];function PS(e,t,n,r){DS(e.x,t,cH,n?n.x:void 0,r?r.x:void 0),DS(e.y,t,uH,n?n.y:void 0,r?r.y:void 0)}function BS(e){return e.translate===0&&e.scale===1}function aM(e){return BS(e.x)&&BS(e.y)}function FS(e,t){return e.min===t.min&&e.max===t.max}function dH(e,t){return FS(e.x,t.x)&&FS(e.y,t.y)}function US(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oM(e,t){return US(e.x,t.x)&&US(e.y,t.y)}function $S(e){return ys(e.x)/ys(e.y)}function HS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class fH{constructor(){this.members=[]}add(t){Qw(this.members,t),t.scheduleRender()}remove(t){if(Zw(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 hH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Ro={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},pd=typeof window<"u"&&window.MotionDebug!==void 0,Gy=["","X","Y","Z"],pH={visibility:"hidden"},zS=1e3;let mH=0;function qy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",yn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lM(r)}function cM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=mH++,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,pd&&(Ro.totalNodes=Ro.resolvedTargetDeltas=Ro.recalculatedProjection=0),this.nodes.forEach(bH),this.nodes.forEach(_H),this.nodes.forEach(kH),this.nodes.forEach(EH),pd&&window.MotionDebug.record(Ro)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=rH(h,250),tm.hasAnimatedSinceResize&&(tm.hasAnimatedSinceResize=!1,this.nodes.forEach(KS))})}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 g=this.options.transition||d.getDefaultTransition()||CH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!oM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Xw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||KS(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,lo(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(NH),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&&lM(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;YS(f.x,a.x,k),YS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dd(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),TH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&dH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Hn()),Ss(x,this.relativeTarget)),g&&(this.animationValues=d,iH(d,u,this.latestValues,k,b,y)),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&&(lo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yn.update(()=>{tm.hasAnimatedSinceResize=!0,this.currentAnimation=J7(0,zS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(zS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&uM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Hn();const f=ys(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=ys(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Ss(l,c),cc(l,d),jd(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new fH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&qy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(VS),this.root.sharedNodes.clear()}}}function gH(e){e.updateLayout()}function yH(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"?Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ys(h);h.min=r[f].min,h.max=h.min+p}):uM(i,n.layoutBox,r)&&Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ys(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=oc();jd(l,r,n.layoutBox);const c=oc();a?jd(c,e.applyTransform(s,!0),n.measuredBox):jd(c,r,n.layoutBox);const u=!aM(l);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=Hn();Dd(m,n.layoutBox,h.layoutBox);const g=Hn();Dd(g,r,p.layoutBox),oM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function bH(e){pd&&Ro.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 EH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xH(e){e.clearSnapshot()}function VS(e){e.clearMeasurements()}function wH(e){e.isLayoutDirty=!1}function vH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function KS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _H(e){e.resolveTargetDelta()}function kH(e){e.calcProjection()}function NH(e){e.resetSkewAndRotation()}function SH(e){e.removeLeadSnapshot()}function YS(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 WS(e,t,n,r){e.min=Cn(t.min,n.min,r),e.max=Cn(t.max,n.max,r)}function TH(e,t,n,r){WS(e.x,t.x,n.x,r),WS(e.y,t.y,n.y,r)}function AH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const CH={duration:.45,ease:[.4,0,.1,1]},GS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),qS=GS("applewebkit/")&&!GS("chrome/")?Math.round:ps;function XS(e){e.min=qS(e.min),e.max=qS(e.max)}function IH(e){XS(e.x),XS(e.y)}function uM(e,t,n){return e==="position"||e==="preserve-aspect"&&!L7($S(t),$S(n),.2)}function RH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const OH=cM({attachResizeListener:(e,t)=>_f(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xy={current:void 0},dM=cM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xy.current){const e=new OH({});e.mount(window),e.setOptions({layoutScroll:!0}),Xy.current=e}return Xy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),LH={pan:{Feature:q7},drag:{Feature:G7,ProjectionNode:dM,MeasureLayout:rM}};function MH(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 fM(e,t){const n=MH(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function QS(e){return t=>{t.pointerType==="touch"||WL()||e(t)}}function jH(e,t,n={}){const[r,s,i]=fM(e,n),a=QS(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=QS(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function ZS(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&&yn.postRender(()=>i(t,eh(t)))}class DH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=jH(t,n=>(ZS(this.node,n,"Start"),r=>ZS(this.node,r,"End"))))}unmount(){}}class PH extends po{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=Jf(_f(this.node.current,"focus",()=>this.onFocus()),_f(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const hM=(e,t)=>t?e===t?!0:hM(e,t.parentElement):!1,BH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FH(e){return BH.has(e.tagName)||e.tabIndex!==-1}const md=new WeakSet;function JS(e){return t=>{t.key==="Enter"&&e(t)}}function Qy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const UH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=JS(()=>{if(md.has(n))return;Qy(n,"down");const s=JS(()=>{Qy(n,"up")}),i=()=>Qy(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 eT(e){return fv(e)&&!WL()}function $H(e,t,n={}){const[r,s,i]=fM(e,n),a=l=>{const c=l.currentTarget;if(!eT(l)||md.has(c))return;md.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!eT(p)||!md.has(c))&&(md.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||hM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!FH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>UH(u,s),s)}),i}function tT(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&&yn.postRender(()=>i(t,eh(t)))}class HH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=$H(t,n=>(tT(this.node,n,"Start"),(r,{success:s})=>tT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xE=new WeakMap,Zy=new WeakMap,zH=e=>{const t=xE.get(e.target);t&&t(e)},VH=e=>{e.forEach(zH)};function KH({root:e,...t}){const n=e||document;Zy.has(n)||Zy.set(n,{});const r=Zy.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(VH,{root:e,...t})),r[s]}function YH(e,t,n){const r=KH(t);return xE.set(e,n),r.observe(e),()=>{xE.delete(e),r.unobserve(e)}}const WH={some:0,all:1};class GH extends po{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:WH[s]},l=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 YH(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qH(t,n))&&this.startObserver()}unmount(){}}function qH({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const XH={inView:{Feature:GH},tap:{Feature:HH},focus:{Feature:PH},hover:{Feature:DH}},QH={layout:{ProjectionNode:dM,MeasureLayout:rM}},wE={current:null},pM={current:!1};function ZH(){if(pM.current=!0,!!Dw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wE.current=e.matches;e.addListener(t),t()}else wE.current=!1}const JH=[...jL,wr,co],ez=e=>JH.find(ML(e)),nT=new WeakMap;function tz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(_r(s))e.addValue(r,s);else if(_r(i))e.addValue(r,wf(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,wf(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const rT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lv,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=Bi.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),pM.current||ZH(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){nT.delete(this.current),this.projection&&this.projection.unmount(),lo(this.notifyUpdate),lo(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=yl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&yn.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 $c){const n=$c[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):Hn()}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=wf(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"&&(OL(s)||_L(s))?s=parseFloat(s):!ez(s)&&co.test(n)&&(s=CL(t,n)),this.setBaseTarget(t,_r(s)?s.get():s)),_r(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=Hw(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&&!_r(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 Jw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class mM extends nz{constructor(){super(...arguments),this.KeyframeResolver=DL}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;_r(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function rz(e){return window.getComputedStyle(e)}class sz extends mM{constructor(){super(...arguments),this.type="html",this.renderInstance=nL}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}else{const r=rz(t),s=(JO(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tM(t,n)}build(t,n,r){Kw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return qw(t,n,r)}}class iz extends mM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Hn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}return n=rL.has(n)?n:Fw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return aL(t,n,r)}build(t,n,r){Yw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){sL(t,n,r,s)}mount(t){this.isSVGTag=Gw(t.tagName),super.mount(t)}}const az=(e,t)=>$w(e)?new iz(t):new sz(t,{allowProjection:e!==E.Fragment}),oz=OU({..._7,...XH,...LH,...QH},az),en=W9(oz);function rr(){return rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Hl(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var lz=["container"];function cz(e){var t=e.container,n=t===void 0?document.body:t,r=a0(e,lz);return $s.createPortal(kt.createElement("div",rr({},r)),n)}function uz(e){return kt.createElement("svg",rr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 dz(e){return kt.createElement("svg",rr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 fz(e){return kt.createElement("svg",rr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function hz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function iT(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 Fa=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function Jy(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Fa(e,i,n,innerWidth)[0],f=Fa(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function kE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function eb(e,t,n){var r=kE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function lp(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var mz={T:0,L:0,W:0,H:0,FIT:void 0},yM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},gz=["className"];function yz(e){var t=e.className,n=t===void 0?"":t,r=a0(e,gz);return kt.createElement("div",rr({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var bz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Ez(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=a0(e,bz),u=yM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",rr({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(yz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var xz={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 wz(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,A=e.expose,S=Zm(xz),R=S[0],I=S[1],D=E.useRef(0),F=yM(),W=R.naturalWidth,L=W===void 0?i:W,U=R.naturalHeight,C=U===void 0?l:U,M=R.width,O=M===void 0?i:M,j=R.height,T=j===void 0?l:j,z=R.loaded,G=z===void 0?!n:z,P=R.broken,se=R.x,Q=R.y,ne=R.touched,fe=R.stopRaf,Z=R.maskTouched,pe=R.rotate,J=R.scale,be=R.CX,ye=R.CY,we=R.lastX,ve=R.lastY,Te=R.lastCX,Re=R.lastCY,Ke=R.lastScale,Oe=R.touchTime,mt=R.touchLength,Xe=R.pause,Ye=R.reach,ce=qo({onScale:function(oe){return Se(op(oe))},onRotate:function(oe){pe!==oe&&(A({rotate:oe}),I(rr({rotate:oe},eb(L,C,oe))))}});function Se(oe,ze,dt){J!==oe&&(A({scale:oe}),I(rr({scale:oe},Jy(se,Q,O,T,J,oe,ze,dt),oe<=1&&{x:0,y:0})))}var st=lp(function(oe,ze,dt){if(dt===void 0&&(dt=0),(ne||Z)&&N){var Fn=kE(pe,O,T),cn=Fn[0],Xt=Fn[1];if(dt===0&&D.current===0){var Qt=Math.abs(oe-be)<=20,un=Math.abs(ze-ye)<=20;if(Qt&&un)return void I({lastCX:oe,lastCY:ze});D.current=Qt?ze>ye?3:2:1}var dn,Gn=oe-Te,qn=ze-Re;if(dt===0){var Rt=Fa(Gn+we,J,cn,innerWidth)[0],Kt=Fa(qn+ve,J,Xt,innerHeight);dn=function(ke,Ie,Qe,ft){return Ie&&ke===1||ft==="x"?"x":Qe&&ke>1||ft==="y"?"y":void 0}(D.current,Rt,Kt[0],Ye),dn!==void 0&&x(dn,oe,ze,J)}if(dn==="x"||Z)return void I({reach:"x"});var de=op(J+(dt-mt)/100/2*J,L/O,.2);A({scale:de}),I(rr({touchLength:dt,reach:dn,scale:de},Jy(se,Q,O,T,J,de,oe,ze,Gn,qn)))}},{maxWait:8});function ct(oe){return!fe&&!ne&&(F.current&&I(rr({},oe,{pause:u})),F.current)}var q,ee,ge,Pe,Ge,et,$t,bt,Vt=(Ge=function(oe){return ct({x:oe})},et=function(oe){return ct({y:oe})},$t=function(oe){return F.current&&(A({scale:oe}),I({scale:oe})),!ne&&F.current},bt=qo({X:function(oe){return Ge(oe)},Y:function(oe){return et(oe)},S:function(oe){return $t(oe)}}),function(oe,ze,dt,Fn,cn,Xt,Qt,un,dn,Gn,qn){var Rt=kE(Gn,cn,Xt),Kt=Rt[0],de=Rt[1],ke=Fa(oe,un,Kt,innerWidth),Ie=ke[0],Qe=ke[1],ft=Fa(ze,un,de,innerHeight),nt=ft[0],ie=ft[1],Ze=Date.now()-qn;if(Ze>=200||un!==Qt||Math.abs(dn-Qt)>1){var ot=Jy(oe,ze,cn,Xt,Qt,un),xe=ot.x,ht=ot.y,Je=Ie?Qe:xe!==oe?xe:null,lt=nt?ie:ht!==ze?ht:null;return Je!==null&&jo(oe,Je,bt.X),lt!==null&&jo(ze,lt,bt.Y),void(un!==Qt&&jo(Qt,un,bt.S))}var _t=(oe-dt)/Ze,Gt=(ze-Fn)/Ze,bn=Math.sqrt(Math.pow(_t,2)+Math.pow(Gt,2)),En=!1,tn=!1;(function(Nn,Et){var Sn,On=Nn,Mt=0,Ln=0,Hr=function(fr){Sn||(Sn=fr);var Cr=fr-Sn,Ys=Math.sign(Nn),ss=-.001*Ys,ir=Math.sign(-On)*Math.pow(On,2)*2e-4,Ir=On*Cr+(ss+ir)*Math.pow(Cr,2)/2;Mt+=Ir,Sn=fr,Ys*(On+=(ss+ir)*Cr)<=0?fn():Et(Mt)?Mn():fn()};function Mn(){Ln=requestAnimationFrame(Hr)}function fn(){cancelAnimationFrame(Ln)}Mn()})(bn,function(Nn){var Et=oe+Nn*(_t/bn),Sn=ze+Nn*(Gt/bn),On=Fa(Et,Qt,Kt,innerWidth),Mt=On[0],Ln=On[1],Hr=Fa(Sn,Qt,de,innerHeight),Mn=Hr[0],fn=Hr[1];if(Mt&&!En&&(En=!0,Ie?jo(Et,Ln,bt.X):aT(Ln,Et+(Et-Ln),bt.X)),Mn&&!tn&&(tn=!0,nt?jo(Sn,fn,bt.Y):aT(fn,Sn+(Sn-fn),bt.Y)),En&&tn)return!1;var fr=En||bt.X(Ln),Cr=tn||bt.Y(fn);return fr&&Cr})}),Wt=(q=y,ee=function(oe,ze){Ye||Se(J!==1?1:Math.max(2,L/O),oe,ze)},ge=E.useRef(0),Pe=lp(function(){ge.current=0,q.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var oe=[].slice.call(arguments);ge.current+=1,Pe.apply(void 0,oe),ge.current>=2&&(Pe.cancel(),ge.current=0,ee.apply(void 0,oe))});function St(oe,ze){if(D.current=0,(ne||Z)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var dt=op(J,L/O);if(Vt(se,Q,we,ve,O,T,J,dt,Ke,pe,Oe),_(oe,ze),be===oe&&ye===ze){if(ne)return void Wt(oe,ze);Z&&b(oe,ze)}}}function Pt(oe,ze,dt){dt===void 0&&(dt=0),I({touched:!0,CX:oe,CY:ze,lastCX:oe,lastCY:ze,lastX:se,lastY:Q,lastScale:J,touchLength:dt,touchTime:Date.now()})}function je(oe){I({maskTouched:!0,CX:oe.clientX,CY:oe.clientY,lastX:se,lastY:Q})}Hl(Zi?void 0:"mousemove",function(oe){oe.preventDefault(),st(oe.clientX,oe.clientY)}),Hl(Zi?void 0:"mouseup",function(oe){St(oe.clientX,oe.clientY)}),Hl(Zi?"touchmove":void 0,function(oe){oe.preventDefault();var ze=iT(oe);st.apply(void 0,ze)},{passive:!1}),Hl(Zi?"touchend":void 0,function(oe){var ze=oe.changedTouches[0];St(ze.clientX,ze.clientY)},{passive:!1}),Hl("resize",lp(function(){G&&!ne&&(I(eb(L,C,pe)),k())},{maxWait:8})),_E(function(){N&&A(rr({scale:J,rotate:pe},ce))},[N]);var gt=function(oe,ze,dt,Fn,cn,Xt,Qt,un,dn,Gn){var qn=function(xe,ht,Je,lt,_t){var Gt=E.useRef(!1),bn=Zm({lead:!0,scale:Je}),En=bn[0],tn=En.lead,Nn=En.scale,Et=bn[1],Sn=lp(function(On){try{return _t(!0),Et({lead:!1,scale:On}),Promise.resolve()}catch(Mt){return Promise.reject(Mt)}},{wait:lt});return _E(function(){Gt.current?(_t(!1),Et({lead:!0}),Sn(Je)):Gt.current=!0},[Je]),tn?[xe*Nn,ht*Nn,Je/Nn]:[xe*Je,ht*Je,1]}(Xt,Qt,un,dn,Gn),Rt=qn[0],Kt=qn[1],de=qn[2],ke=function(xe,ht,Je,lt,_t){var Gt=E.useState(mz),bn=Gt[0],En=Gt[1],tn=E.useState(0),Nn=tn[0],Et=tn[1],Sn=E.useRef(),On=qo({OK:function(){return xe&&Et(4)}});function Mt(Ln){_t(!1),Et(Ln)}return E.useEffect(function(){if(Sn.current||(Sn.current=Date.now()),Je){if(function(Ln,Hr){var Mn=Ln&&Ln.current;if(Mn&&Mn.nodeType===1){var fn=Mn.getBoundingClientRect();Hr({T:fn.top,L:fn.left,W:fn.width,H:fn.height,FIT:Mn.tagName==="IMG"?getComputedStyle(Mn).objectFit:void 0})}}(ht,En),xe)return Date.now()-Sn.current<250?(Et(1),requestAnimationFrame(function(){Et(2),requestAnimationFrame(function(){return Mt(3)})}),void setTimeout(On.OK,lt)):void Et(4);Mt(5)}},[xe,Je]),[Nn,bn]}(oe,ze,dt,dn,Gn),Ie=ke[0],Qe=ke[1],ft=Qe.W,nt=Qe.FIT,ie=innerWidth/2,Ze=innerHeight/2,ot=Ie<3||Ie>4;return[ot?ft?Qe.L:ie:Fn+(ie-Xt*un/2),ot?ft?Qe.T:Ze:cn+(Ze-Qt*un/2),Rt,ot&&nt?Rt*(Qe.H/ft):Kt,Ie===0?de:ot?ft/(Xt*un)||.01:de,ot?nt?1:0:1,Ie,nt]}(u,c,G,se,Q,O,T,J,d,function(oe){return I({pause:oe})}),tt=gt[4],Ae=gt[6],Ht="transform "+d+"ms "+f,Bt={className:p,onMouseDown:Zi?void 0:function(oe){oe.stopPropagation(),oe.button===0&&Pt(oe.clientX,oe.clientY,0)},onTouchStart:Zi?function(oe){oe.stopPropagation(),Pt.apply(void 0,iT(oe))}:void 0,onWheel:function(oe){if(!Ye){var ze=op(J-oe.deltaY/100/2,L/O);I({stopRaf:!0}),Se(ze,oe.clientX,oe.clientY)}},style:{width:gt[2]+"px",height:gt[3]+"px",opacity:gt[5],objectFit:Ae===4?void 0:gt[7],transform:pe?"rotate("+pe+"deg)":void 0,transition:Ae>2?Ht+", opacity "+d+"ms ease, height "+(Ae<4?d/2:Ae>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Zi&&N?je:void 0,onTouchStart:Zi&&N?function(oe){return je(oe.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+tt+", 0, 0, "+tt+", "+gt[0]+", "+gt[1]+")",transition:ne||Xe?void 0:Ht,willChange:N?"transform":void 0}},n?kt.createElement(Ez,rr({src:n,loaded:G,broken:P},Bt,{onPhotoLoad:function(oe){I(rr({},oe,oe.loaded&&eb(oe.naturalWidth||0,oe.naturalHeight||0,pe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:Bt,scale:tt,rotate:pe})))}var oT={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 vz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,A=e.index,S=A===void 0?0:A,R=e.onIndexChange,I=e.visible,D=e.onClose,F=e.afterClose,W=e.portalContainer,L=Zm(oT),U=L[0],C=L[1],M=E.useState(0),O=M[0],j=M[1],T=U.x,z=U.touched,G=U.pause,P=U.lastCX,se=U.lastCY,Q=U.bg,ne=Q===void 0?u:Q,fe=U.lastBg,Z=U.overlay,pe=U.minimal,J=U.scale,be=U.rotate,ye=U.onScale,we=U.onRotate,ve=e.hasOwnProperty("index"),Te=ve?S:O,Re=ve?R:j,Ke=E.useRef(Te),Oe=N.length,mt=N[Te],Xe=typeof n=="boolean"?n:Oe>n,Ye=function(tt,Ae){var Ht=E.useReducer(function(dt){return!dt},!1)[1],Bt=E.useRef(0),oe=function(dt){var Fn=E.useRef(dt);function cn(Xt){Fn.current=Xt}return E.useMemo(function(){(function(Xt){tt?(Xt(tt),Bt.current=1):Bt.current=2})(cn)},[dt]),[Fn.current,cn]}(tt),ze=oe[1];return[oe[0],Bt.current,function(){Ht(),Bt.current===2&&(ze(!1),Ae&&Ae()),Bt.current=0}]}(I,F),ce=Ye[0],Se=Ye[1],st=Ye[2];_E(function(){if(ce)return C({pause:!0,x:Te*-(innerWidth+Ml)}),void(Ke.current=Te);C(oT)},[ce]);var ct=qo({close:function(tt){we&&we(0),C({overlay:!0,lastBg:ne}),D(tt)},changeIndex:function(tt,Ae){Ae===void 0&&(Ae=!1);var Ht=Xe?Ke.current+(tt-Te):tt,Bt=Oe-1,oe=vE(Ht,0,Bt),ze=Xe?Ht:oe,dt=innerWidth+Ml;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-dt*ze,pause:Ae}),Ke.current=ze,Re&&Re(Xe?tt<0?Bt:tt>Bt?0:tt:oe)}}),q=ct.close,ee=ct.changeIndex;function ge(tt){return tt?q():C({overlay:!Z})}function Pe(){C({x:-(innerWidth+Ml)*Te,lastCX:void 0,lastCY:void 0,pause:!0}),Ke.current=Te}function Ge(tt,Ae,Ht,Bt){tt==="x"?function(oe){if(P!==void 0){var ze=oe-P,dt=ze;!Xe&&(Te===0&&ze>0||Te===Oe-1&&ze<0)&&(dt=ze/2),C({touched:!0,lastCX:P,x:-(innerWidth+Ml)*Ke.current+dt,pause:!1})}else C({touched:!0,lastCX:oe,x:T,pause:!1})}(Ae):tt==="y"&&function(oe,ze){if(se!==void 0){var dt=u===null?null:vE(u,.01,u-Math.abs(oe-se)/100/4);C({touched:!0,lastCY:se,bg:ze===1?dt:u,minimal:ze===1})}else C({touched:!0,lastCY:oe,bg:ne,minimal:!0})}(Ht,Bt)}function et(tt,Ae){var Ht=tt-(P??tt),Bt=Ae-(se??Ae),oe=!1;if(Ht<-40)ee(Te+1);else if(Ht>40)ee(Te-1);else{var ze=-(innerWidth+Ml)*Ke.current;Math.abs(Bt)>100&&pe&&f&&(oe=!0,q()),C({touched:!1,x:ze,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!oe||Z})}}Hl("keydown",function(tt){if(I)switch(tt.key){case"ArrowLeft":ee(Te-1,!0);break;case"ArrowRight":ee(Te+1,!0);break;case"Escape":q()}});var $t=function(tt,Ae,Ht){return E.useMemo(function(){var Bt=tt.length;return Ht?tt.concat(tt).concat(tt).slice(Bt+Ae-1,Bt+Ae+2):tt.slice(Math.max(Ae-1,0),Math.min(Ae+2,Bt+1))},[tt,Ae,Ht])}(N,Te,Xe);if(!ce)return null;var bt=Z&&!Se,Vt=I?ne:fe,Wt=ye&&we&&{images:N,index:Te,visible:I,onClose:q,onIndexChange:ee,overlayVisible:bt,overlay:mt&&mt.overlay,scale:J,rotate:be,onScale:ye,onRotate:we},St=r?r(Se):400,Pt=s?s(Se):sT,je=r?r(3):600,gt=s?s(3):sT;return kt.createElement(cz,{className:"PhotoView-Portal"+(bt?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(tt){return tt.stopPropagation()},container:W},I&&kt.createElement(hz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Se===1?" PhotoView-Slider__fadeIn":Se===2?" PhotoView-Slider__fadeOut":""),style:{background:Vt?"rgba(0, 0, 0, "+Vt+")":void 0,transitionTimingFunction:Pt,transitionDuration:(z?0:St)+"ms",animationDuration:St+"ms"},onAnimationEnd:st}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},Te+1," / ",Oe),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&Wt&&g(Wt),kt.createElement(uz,{className:"PhotoView-Slider__toolbarIcon",onClick:q}))),$t.map(function(tt,Ae){var Ht=Xe||Te!==0?Ke.current-1+Ae:Te+Ae;return kt.createElement(wz,{key:Xe?tt.key+"/"+tt.src+"/"+Ht:tt.key,item:tt,speed:St,easing:Pt,visible:I,onReachMove:Ge,onReachUp:et,onPhotoTap:function(){return ge(i)},onMaskTap:function(){return ge(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Ml)*Ht+"px",transform:"translate3d("+T+"px, 0px, 0)",transition:z||G?void 0:"transform "+je+"ms "+gt},loadingElement:_,brokenElement:k,onPhotoResize:Pe,isActive:Ke.current===Ht,expose:C})}),!Zi&&p&&kt.createElement(kt.Fragment,null,(Xe||Te!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ee(Te-1,!0)}},kt.createElement(dz,null)),(Xe||Te+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=qo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return rr({},a,h)},[a,h]);return kt.createElement(gM.Provider,{value:m},t,kt.createElement(vz,rr({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var bM=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(gM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=qo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,rr({},g,{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 Sz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),EM=(...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 Tz={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 Az=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...Tz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EM("lucide",s),...l},[...a.map(([u,d])=>E.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 De=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(Az,{ref:i,iconNode:t,className:EM(`lucide-${Sz(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 Cz=De("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 Iz=De("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** - * @license lucide-react v0.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 hv=De("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 xM=De("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 Pd=De("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 wM=De("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 vM=De("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 Rz=De("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 il=De("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 _M=De("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 Oz=De("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 Lz=De("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 Vs=De("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 pv=De("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 Mz=De("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 Ds=De("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 o0=De("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 kM=De("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 NE=De("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 jz=De("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 mv=De("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 l0=De("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 Dz=De("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 Pz=De("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 nm=De("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 c0=De("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 Bz=De("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 gv=De("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 Fz=De("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 yv=De("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 Uz=De("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 lT=De("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 $z=De("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 Hz=De("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 bv=De("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 zz=De("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 NM=De("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 Vz=De("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 Kz=De("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 Yz=De("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 Ev=De("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 SM=De("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 Wz=De("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 Gz=De("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 u0=De("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 qz=De("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 Xz=De("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 xv=De("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 mo=De("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 Qz=De("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 TM=De("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 Zz=De("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 AM=De("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 Jz=De("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 zt=De("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 eV=De("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 tV=De("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 kc=De("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 nV=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @license lucide-react v0.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 CM=De("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 rV=De("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 sV=De("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 iV=De("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 aV=De("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** - * @license lucide-react v0.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 IM=De("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 oV=De("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 lV=De("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 cV=De("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 uV=De("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 mr=De("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 RM=De("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 wv=De("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 dV=De("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 fV=De("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 kf=De("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 hV=De("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 pV=De("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 cT=De("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 al=De("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 mV=De("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 pi=De("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 gV=De("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 yV=De("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 bV=De("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 EV=De("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 xV=De("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 OM=De("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 br=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),uT="veadk_auth_qs";let Gu=null;function wV(){if(Gu!==null)return Gu;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(uT,t),Gu=t):Gu=sessionStorage.getItem(uT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Gu}function Fi(e){const t=wV();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 gu=3e4,th=12e4,LM=1e4;function mi(e,t=gu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const Jm="veadk_local_user",eg="veadk_local_user_tab",vV=/^[A-Za-z0-9]{1,16}$/;function MM(){try{const e=sessionStorage.getItem(eg);if(e)return e;const t=localStorage.getItem(Jm);return t&&sessionStorage.setItem(eg,t),t}catch{try{return localStorage.getItem(Jm)}catch{return null}}}function dT(e){try{sessionStorage.setItem(eg,e)}catch{}try{localStorage.setItem(Jm,e)}catch{}}function _V(){try{sessionStorage.removeItem(eg)}catch{}try{localStorage.removeItem(Jm)}catch{}}function d0(e){const t=new Headers(e),n=MM();return n&&t.set("X-VeADK-Local-User",n),t}async function jM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:mi(void 0,LM)})}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 kV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function NV(){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 SV(){const[e,t]=await Promise.all([SE(),jM()]);return e.status==="unauthenticated"&&t.length>0}function TV(){window.location.assign("/oauth2/logout")}async function SE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:mi(void 0,LM)})}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=MM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function AV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function CV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const TE="veadk:authentication-required";let Bd=null,gd=null;function IV(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 RV(e){Bd||(Bd=new Promise(n=>{gd=n}),window.dispatchEvent(new Event(TE)));const t=Bd;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 OV(){return Bd!==null}function LV(){gd==null||gd(),gd=null,Bd=null}async function f0(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 MV=/\brun_sse\s*failed\s*:\s*404\b/i,jV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,fT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function cp(e){const t=String(e);return jV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!MV.test(t)||t.includes(fT)?t:`${t} - -${fT}`}async function*vv(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 l=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const c=l.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 DV=255,PV=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function BV(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let r=0,s="";for(const i of t){if(!PV.test(i))continue;const a=n.encode(i).byteLength;if(r+a>DV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const _v="veadk.messageFeedback.v1";function kv(e,t,n,r){return[e,t,n,r].join(":")}function Nv(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(_v)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function FV(e,t,n){if(typeof window>"u")return;const r=Nv();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(_v,JSON.stringify(r))}function DM(e){if(typeof window>"u")return;const t=kv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Nv(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(_v,JSON.stringify(n))}}const rm="",Sv=new Map;function PM(e,t){Sv.set(e,t)}function BM(){Sv.clear()}function er(e){const t=Sv.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=gu){const s={...t,headers:d0(t.headers)},i=()=>{const c={...s,signal:mi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Fi(`${rm}/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(Fi(`${rm}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Fi(`${rm}${e}`),c)},a=async c=>{if(IV(c))return!0;if(c.status!==401)return!1;try{return await SV()}catch{return!1}};let l=await i();for(;await a(l);)await RV(t.signal),l=await i();return l}function UV(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 ln(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return UV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function FM(){const e=await pt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class nh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Ya extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const $V="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",HV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",zV=3e4,AE=new Map;function UM(e,t){return`${t}:${e}`}async function VV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function h0(e,t,n){const r=await pt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await VV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new nh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new Ya($V);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new Ya(HV);if(n!=null&&n.runtimeId&&r.status===404)throw new Ya("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Ya("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await ln(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&AE.set(UM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+zV}),i}async function tg(e,t){const{app:n,ep:r}=er(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})`,l=await ln(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Tv(e,t){const{app:n,ep:r}=er(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 ng(e,t,n){const{app:r,ep:s}=er(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 l=kv(s.runtimeId,r,t,n);a.state={...Nv()[l]??{},...a.state??{}}}return a}async function $M(e){const{app:t,ep:n}=er(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await pt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},th);if(!r.ok)throw new Error(await ln(r,"提交反馈失败"));const s=await r.json(),i=kv(n.runtimeId,t,e.userId,e.sessionId);return FV(i,e.eventId,s),s}async function HM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await pt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await ln(n,"读取评测集失败"));return n.json()}async function zM(e){const t=await pt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},th);if(!t.ok)throw new Error(await ln(t,"删除评测案例失败"));return t.json()}async function CE(e,t,n){const{app:r,ep:s}=er(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}`)}function KV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function KM(e,t,n,r,s){const{app:i,ep:a}=er(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await pt(c,{},a,th);if(!u.ok)throw new Error(await ln(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=KV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function YM(e,t,n,r,s){const{blob:i}=await KM(e,t,n,r,s);return URL.createObjectURL(i)}async function YV(e){const t=await pt("/web/media/capabilities");if(!t.ok)throw new Error(await ln(t,"media capabilities failed"));return t.json()}async function WM(e,t,n,r){const{app:s}=er(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},{},th);if(!a.ok)throw new Error(await ln(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function IE(e,t,n){const{app:r}=er(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 ln(i,"media cleanup failed"))}function GM(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 sm(e,t){const n=GM(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 ln(r,"media cleanup failed"))}function qM(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=GM(t);if(!n)return t;const r=`${n}/content`;return Fi(`${rm}${r}`)}async function XM(e,t){const{app:n,ep:r}=er(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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Av(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 Cv(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function RE(e,t,n){const{app:r,ep:s}=er(e),i=await pt(Cv(r,t,n),{},s);if(!i.ok)throw new Error(await ln(i,"读取会话能力失败"));return Av(await i.json())}async function Iv(e){const{ep:t}=er(e),n=await pt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await ln(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function WV(e){const{ep:t}=er(e),n=await pt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await ln(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function GV(e,t,n){const{ep:r}=er(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 ln(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function QM(e,t,n=1,r=20){const{ep:s}=er(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 ln(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function OE(e,t,n,r,s){const{app:i,ep:a}=er(e),l=await pt(Cv(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(!l.ok)throw new Error(await ln(l,"添加会话能力失败"));return Av(await l.json())}async function ZM(e,t,n,r,s){const{app:i,ep:a}=er(e),l=`${Cv(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await pt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await ln(c,"移除会话能力失败"));return Av(await c.json())}async function JM(e,t,n=!0){const r=await pt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await pt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Rv(e){const{app:t,ep:n}=er(e);return JM(t,n,!1)}async function Ov(e,t,n){const r={runtimeId:e,region:t},s=UM(e,t),i=AE.get(s);i&&i.expiresAt<=Date.now()&&AE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await h0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return JM(a,r)}async function ej(e,t,n,r){const{app:s,ep:i}=er(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await pt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await ln(l,"Agent 检索失败"));return l.json()}async function tj(e,t){const{app:n}=er(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*Nf({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=er(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,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:l},d,0);if(!m.ok)throw new Error(cp(`run_sse failed: ${m.status}`));for await(const g of vv(m)){const w=g;typeof w.error=="string"&&(w.error=cp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=cp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=cp(w.error_message)),yield w}}const Fd=new Map;async function p0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Fd.set(s,i);const a=()=>{s&&Fd.get(s)===i&&Fd.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=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:BV((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of vv(l)){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 nj(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=Fd.get(e))==null||n.abort(),Fd.delete(e)}async function qV(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 Sf={title:"VeADK Studio",logoUrl:""},tb={studio:!1,version:"",branding:Sf,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function rj(){var e,t;try{const n=await pt("/web/ui-config");if(!n.ok)return tb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Sf.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:Sf.title,logoUrl:s?Fi(s):""},features:{...tb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return tb}}const sj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function ij(){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 aj(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 oj(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})},{},th);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 Nc(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 lj(e,t){try{return await h0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof nh||n instanceof Ya)throw n;return null}}async function cj(e,t){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 Lv(e,t){const n=await pt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await ln(n,"加载 Runtime 详情失败"));return n.json()}async function Mv(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 ln(t,"生成项目失败"));return t.json()}const XV=19e4;async function uj(e){const t=await pt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},XV);if(!t.ok)throw new Error(await ln(t,"生成 Agent 配置失败"));return f0(t,"生成 Agent 配置失败")}async function dj(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 ln(t,"创建调试运行失败"));return f0(t,"创建调试运行失败")}async function fj(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 ln(n,"创建调试会话失败"));return(await f0(n,"创建调试会话失败")).id}async function hj(e,t){const n=await pt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await ln(n,"加载调试调用链路失败"));const r=await f0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*pj({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 ln(a,"调试运行失败"));for await(const l of vv(a))yield l}async function zl(e){const t=await pt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await ln(t,"清理调试运行失败"))}const QV=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Sf,DEFAULT_STUDIO_ACCESS:sj,RuntimeAccessDeniedError:nh,RuntimeProbeError:Ya,addSessionCapability:OE,cancelAgentkitDeployment:nj,clearMessageFeedbackCache:DM,clearRemoteApps:BM,componentSearch:ej,createGeneratedAgentTestRun:dj,createGeneratedAgentTestSession:fj,createSession:tg,deleteAgentFeedbackCases:zM,deleteGeneratedAgentTestRun:zl,deleteMedia:sm,deleteRuntime:cj,deleteSession:CE,deleteSessionMedia:IE,deployAgentkitProject:p0,downloadArtifact:VM,fetchRemoteApps:h0,generateAgentDraftFromRequirement:uj,generateAgentProject:Mv,getAgentFeedbackCases:HM,getAgentInfo:Rv,getGeneratedAgentTestTrace:hj,getMediaCapabilities:YV,getMyRuntimes:qV,getRuntimeAgentInfo:Ov,getRuntimeDetail:Lv,getRuntimes:Nc,getSession:ng,getSessionCapabilities:RE,getSessionTrace:XM,getStudioAccess:ij,getStudioUpdateStatus:aj,getUiConfig:rj,listApps:FM,listSessionBuiltinTools:Iv,listSessionSkillSpaces:WV,listSessionSkillsInSpace:GV,listSessions:Tv,mediaContentUrl:qM,previewArtifact:YM,probeRuntimeApps:lj,registerRemoteApp:PM,removeSessionCapability:ZM,runGeneratedAgentTestSSE:pj,runSSE:Nf,searchSessionPublicSkills:QM,startStudioUpdate:oj,submitMessageFeedback:$M,uploadMedia:WM,webSearch:tj},Symbol.toStringTag,{value:"Module"})),ZV="send_a2ui_json_to_client",JV="validated_a2ui_json",LE="adk_request_credential",hT="transfer_to_agent";function eK(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 ci(){return{blocks:[],liveStart:0}}const pT=e=>e.functionCall??e.function_call,ME=e=>e.functionResponse??e.function_response;function tK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function nK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function mj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:nK(l.data),name:l.displayName??l.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 jE(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 rK=new Set(["llm","sequential","parallel","loop","a2a"]);function sK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&rK.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 iK(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 aK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function mT(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 up(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Vc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>pT(p)||ME(p));if(t.partial&&!i){for(const p of s){const m=jE(p);typeof m=="string"&&m&&mT(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=pT(p),g=ME(p),w=mj([p]),y=jE(p);if(typeof y=="string"&&y)mT(n,p.thought?"thinking":"text",y);else if(w.length)up(n),iK(n,w);else if(m)if(up(n),m.name===hT){const b=tK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===LE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:eK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(up(n),g.name===hT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===LE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===ZV){const b=((d=g.response)==null?void 0:d[JV])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&aK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),up(n),r=n.length,{blocks:n,liveStart:r}}function oK(e,t={}){var s,i;const n=[];let r=ci();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=ME(p))==null?void 0:m.name)===LE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(jE).filter(p=>!!p).join(""),d=mj(c),f=sK(c);if(!u&&!d.length&&!f){r=ci();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=ci()}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=ci()),r=Vc(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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function lK(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 cK=50,gT=48;function uK(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 dK(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 fK(e,t,n){const r=Math.max(0,t-gT),s=Math.min(e.length,t+n+gT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await ng(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of uK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:dK(l),snippet:fK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,cK)}async function pK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await tj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function mK(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await ej(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function gK(e,t,n){return e==="session"?{results:await hK(n.userId,n.appId,t)}:e==="web"?pK(n.appId,t):mK(e,n.appId,n.userId,t)}function gj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function yK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function bK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(gj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function EK(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 rg(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 yT(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 xK({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=EK(t,n,r),A=N.find(M=>M.id===a),S=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function M(O){var j;(j=k.current)!=null&&j.contains(O.target)||x(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[b]);async function R(M,O){var G;const j=M.trim();if(!j||!((G=N.find(P=>P.id===O))!=null&&G.ready))return;const T=++_.current;g(!0),y(!0);let z;try{z=await gK(O,j,{userId:e,appId:t})}catch(P){const se=P instanceof Error?P.message:String(P);z={results:[],note:`搜索失败:${se}`}}T===_.current&&(f(z.results),p(z.note),g(!1))}function I(M){_.current+=1,u(M),f([]),p(void 0),y(!1),g(!1)}function D(M){_.current+=1,l(M),x(!1),f([]),p(void 0),y(!1),g(!1)}const F=!!(A!=null&&A.ready),W=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?rg(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(M=>!M),children:[o.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(yK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(M=>{var T,z;const O=M.id==="knowledge"?(T=n==null?void 0:n.components)==null?void 0:T.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):M.id==="memory"?(z=n==null?void 0:n.components)==null?void 0:z.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,j=O?[O.name,O.backend?rg(O.backend):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===M.id,disabled:!M.ready,onClick:()=>D(M.id),children:[o.jsx("span",{children:M.label}),j&&o.jsx("small",{children:j})]},M.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:M=>I(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),R(c,a))},placeholder:W,disabled:!F,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx(zt,{className:"icon spin"}):o.jsx(gj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:F?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((M,O)=>o.jsx(wK,{result:M,agentLabel:s,onOpen:i},O)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function wK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(CM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${yT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(u0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(gv,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(bT,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${rg(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(bT,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${rg(e.sourceType)}`:"",e.ts?` · ${yT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function bT({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 jv="/assets/volcengine-DM14a-L-.svg",ET="(max-width: 860px)";function vK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function _K(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 kK={admin:"管理员",developer:"开发者",user:"普通用户"};function xT({role:e}){const t=kK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function NK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),$s.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(br,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function SK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=AV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=_K(d||f||h),m=CV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} -${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(xT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(xT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(mo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(tV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(NK,{version:n,onClose:()=>l(!1)}):null]})}function TK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(ET).matches),[k,N]=E.useState(_.current),A=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(ET),I=D=>{D.matches?N(F=>F||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(lV,{className:"icon"}):o.jsx(oV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(mr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(vK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(bK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(mr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[A.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),A.map(R=>{const I=lK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(D=>D===R.id?null:R.id),children:o.jsx(Bz,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(pi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(SK,{access:s,userInfo:m,version:g,onLogout:w})]})}const yj="veadk_agentkit_connections";function As(){try{const e=localStorage.getItem(yj);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function m0(e){try{localStorage.setItem(yj,JSON.stringify(e))}catch{}}function ro(e,t){return`agentkit:${e}:${t}`}function bj(e){try{return new URL(e).host}catch{return e}}function yu(e){BM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)PM(ro(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function Ej(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=As(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,m0(l),yu(l),a}async function sg(e,t,n,r){let s;try{s=await lj(e,n)}catch(l){throw l instanceof nh&&ig(e),l}if(!s||s.length===0)throw ig(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=Ej(e,t,n,s,i,r);return ro(a.id,s[0])}async function xj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await h0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||bj(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...As().filter(c=>c.base!==s),a];return m0(l),yu(l),a}function AK(e){const t=As().filter(n=>n.id!==e);return m0(t),yu(t),t}function ig(e){const t=As().filter(n=>n.runtimeId!==e);return m0(t),yu(t),t}function wj(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:ro(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:bj(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const wT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:xj,addRuntimeConnection:Ej,buildAgentEntries:wj,connectRuntime:sg,loadConnections:As,registerConnections:yu,remoteAppId:ro,removeConnection:AK,removeRuntimeConnection:ig},Symbol.toStringTag,{value:"Module"}));function Kc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 DE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function CK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function vj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const vT=15,IK=1e4,RK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function OK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function _j(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 nb(e,t=IK){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 LK({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,A]=E.useState(!1),[S,R]=E.useState(""),[I,D]=E.useState(""),[F,W]=E.useState(null),[L,U]=E.useState(new Set),[C,M]=E.useState(),[O,j]=E.useState("agent"),T=E.useRef(!1);function z(J){M(be=>(be==null?void 0:be.runtimeId)===J.runtimeId?void 0:{runtimeId:J.runtimeId,name:J.name,region:J.region})}const G=E.useCallback(async J=>{if(d[J]){g(J);return}const be=h[J];if(be!==void 0){A(!0),R("");try{const ye=await nb(Nc({nextToken:be,pageSize:vT,region:_,scope:"all"}));f(we=>{const ve=[...we];return ve[J]=ye.runtimes,ve}),p(we=>{const ve=[...we];return ye.nextToken&&(ve[J+1]=ye.nextToken),ve}),g(J)}catch(ye){R(ye instanceof Error?ye.message:String(ye))}finally{A(!1)}}},[h,d,_]),P=E.useCallback(async()=>{A(!0),R("");try{const J=[];let be="";do{const ye=await nb(Nc({scope:"mine",nextToken:be,pageSize:100,region:_}));J.push(...ye.runtimes),be=ye.nextToken}while(be&&J.length<2e3);x(J)}catch(J){R(J instanceof Error?J.message:String(J))}finally{A(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),T.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!T.current&&(T.current=!0,G(0))},[e,s,w,G]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&P()},[w,b,s,P]),E.useEffect(()=>{e&&(M(void 0),j("agent"))},[e]);function se(){U(new Set),w?(x(null),P()):(f([]),p([""]),g(0),T.current=!0,A(!0),R(""),nb(Nc({nextToken:"",pageSize:vT,region:_,scope:"all"})).then(J=>{f([J.runtimes]),p(J.nextToken?["",J.nextToken]:[""])}).catch(J=>R(J instanceof Error?J.message:String(J))).finally(()=>A(!1)))}function Q(J){J!==_&&(k(J),f([]),p([""]),g(0),x(null),U(new Set),T.current=!1)}const ne=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function fe(J){W(J.runtimeId),sg(J.runtimeId,J.name,J.region).then(async be=>{await u(be),t()}).catch(be=>{if(be instanceof nh){R(be.message);return}if(be instanceof Ya){be.unsupported&&U(ye=>new Set(ye).add(J.runtimeId)),R(be.message);return}U(ye=>new Set(ye).add(J.runtimeId))}).finally(()=>W(null))}if(!e)return null;const pe=(w?b??[]:d[m]??[]).filter(J=>I?J.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Kc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:se,title:"刷新",disabled:N,children:o.jsx(RM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(br,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(J=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${J===a?"active":""}`,onClick:()=>{u(J),t()},children:[o.jsx(Kc,{}),o.jsx("span",{className:"agentsel-item-name",children:J})]})},J))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(kf,{className:"icon"}),o.jsx("input",{value:I,onChange:J=>D(J.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:RK.map(J=>o.jsx("button",{type:"button",className:_===J.value?"active":"","aria-pressed":_===J.value,onClick:()=>Q(J.value),children:J.label},J.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:J=>y(J.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[pe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:pe.map(J=>{const be=L.has(J.runtimeId),ye=F===J.runtimeId,we=(l==null?void 0:l.runtimeId)===J.runtimeId,ve=(C==null?void 0:C.runtimeId)===J.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${we?"active":""} ${ve?"is-previewed":""}`,title:J.runtimeId,children:[o.jsx(vj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:J.name,children:J.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${be?"bad":UK(J.status)}`,children:be?"不支持":kj(J.status)}),J.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ye||we,onClick:()=>fe(J),children:ye?"连接中…":we?"已连接":be?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${ve?"active":""}`,"aria-label":`查看 ${J.name} 信息`,"aria-pressed":ve,title:"查看信息",onClick:()=>z(J),children:o.jsx(mo,{className:"icon"})}):null]})]})},J.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx(zt,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void G(m-1),"aria-label":"上一页",children:o.jsx(Mz,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!ne||N,onClick:()=>void G(m+1),"aria-label":"下一页",children:o.jsx(Ds,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(PK,{runtime:C,tab:O,onTabChange:j})]})]})}const MK={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function jK(e){return MK[e.toLowerCase()]??e}function DK(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 PK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx(BK,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(FK,{runtime:e})})]})}function BK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),Ov(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(_j(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx(zt,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Kc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(_T,{icon:o.jsx(IM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(_T,{icon:o.jsx(DE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(CK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(_M,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[jK(d.kind),d.backend?` · ${DK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function _T({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function FK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Lv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(_j(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",kj(t.status)]),t.region&&u.push(["区域",OK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(vj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx(zt,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function UK(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 $K={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function kj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return $K[t]??(e||"-")}function HK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx(Ds,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(zK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function zK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Iz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(pv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx(LK,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function rh(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:mi(void 0,gu)});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 Nj(){return(await rh("/web/skill-spaces?region=all")).items||[]}async function VK(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),rh(`/web/skill-spaces?${t.toString()}`)}async function Sj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await rh(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function KK(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),rh(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function YK(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 rh(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function WK(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 GK(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const qK="https://ark.cn-beijing.volces.com/api/v3/",im=[{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:qK}],Yc=[],qu=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],gi={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Tj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:gi.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:gi.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:gi.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],ol=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Yc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Yc},{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"}]}],PE=[{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}]}],BE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:im,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},...im],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},...im],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Yc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Wc="viking",FE=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Yc},{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},...im],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Yc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],UE=[{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:[...Yc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],XK={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function $E(e){const t=ol.find(n=>n.id===e||n.toolNames.includes(e));return XK[e]??(t==null?void 0:t.label)??e}function kT(e){const t=ol.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function QK(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function ZK(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function NT(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Aj({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),$s.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(QK,{})})]}),i]})]}),document.body)}function am({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(ZK,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function JK({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${$E(m)} ${m} ${kT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Aj,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(DE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(am,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(DE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:$E(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:kT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function eY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,A]=E.useState([]),[S,R]=E.useState(""),[I,D]=E.useState(""),[F,W]=E.useState(!0),[L,U]=E.useState(!1),[C,M]=E.useState(""),[O,j]=E.useState(""),T=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let Q=!0;const ne=window.setTimeout(()=>{g(!0),y(""),QM(e,c.trim()).then(fe=>{Q&&(f(fe.items),p(fe.totalCount))}).catch(fe=>{Q&&(f([]),p(0),y(fe instanceof Error?fe.message:"搜索 Skill Hub 失败"))}).finally(()=>{Q&&g(!1)})},250);return()=>{Q=!1,window.clearTimeout(ne)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let Q=!0;return W(!0),M(""),Nj().then(ne=>{Q&&(x(ne),k(ne[0]??null))}).catch(ne=>{Q&&M(ne instanceof Error?ne.message:"读取 Skill Space 失败")}).finally(()=>{Q&&W(!1)}),()=>{Q=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){A([]);return}let Q=!0;return U(!0),M(""),Sj(_.id,_.region).then(ne=>{Q&&A(ne)}).catch(ne=>{Q&&M(ne instanceof Error?ne.message:"读取技能失败")}).finally(()=>{Q&&U(!1)}),()=>{Q=!1}},[_,a]);const z=E.useMemo(()=>{const Q=S.trim().toLowerCase();return Q?b.filter(ne=>`${ne.name} ${ne.id} ${ne.description}`.toLowerCase().includes(Q)):b},[S,b]),G=E.useMemo(()=>{const Q=I.trim().toLowerCase();return Q?N.filter(ne=>`${ne.skillName} ${ne.skillDescription}`.toLowerCase().includes(Q)):N},[I,N]),P=async Q=>{if(!_)return;j(Q.skillId);const ne=await s({kind:"skill",name:Q.skillName,skillSourceId:_.id,description:Q.skillDescription,version:Q.version});j(""),ne&&i()},se=async Q=>{j(Q.slug);const ne=await s({kind:"skill",name:Q.name,skillSourceId:`findskill:${Q.slug}`,description:Q.description,version:Q.version||Q.updatedAt});j(""),ne&&i()};return o.jsx(Aj,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(am,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(Q=>{const ne=T.has(Q.name),fe=O===Q.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.name}),o.jsx("span",{children:Q.description||"暂无描述"}),o.jsxs("small",{children:[Q.sourceRepo||Q.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.downloadCount.toLocaleString()," 次下载",Q.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void se(Q),children:ne?"已添加":fe?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(NT,{}),"添加"]})})]},Q.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(am,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:F?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):z.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):z.map(Q=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===Q.id?" is-active":""}`,onClick:()=>{k(Q),D("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:Q.name||Q.id}),o.jsx("small",{children:Q.description||Q.id}),o.jsxs("em",{children:[Q.skillCount??0," 个技能"]})]})},`${Q.projectName??"default"}:${Q.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(am,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:D})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):G.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):G.map(Q=>{const ne=T.has(Q.skillName),fe=O===Q.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.skillName}),o.jsx("span",{children:Q.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",Q.version||"—"]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void P(Q),children:ne?"已添加":fe?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(NT,{}),"添加"]})})]},`${Q.skillId}:${Q.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function ma({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const tY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Cj(e){return 1+e.children.reduce((t,n)=>t+Cj(n),0)}function Gc(e){return e.id||e.name}function nY(e,t){const n=Gc(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 Ij(e,t=!0){return{...e,id:Gc(e),name:nY(e,t),children:e.children.map(n=>Ij(n,!1))}}function Rj(e,t){t.set(Gc(e),e.name||Gc(e)),e.children.forEach(n=>Rj(n,t))}function rY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function sY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Oj({node:e,activeAgent:t,seen:n,path:r}){const s=Gc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Kc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:tY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Oj,{node:c,activeAgent:t,seen:n,path:r},Gc(c)))})]})}function rb({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function Lj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(ma,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=Ij(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:[]}),w=(l==null?void 0:l.tools)??rY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??sY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Rj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(rb,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:$E(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(rb,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(rb,{title:"拓扑",count:Cj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Oj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(JK,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(eY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function iY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function aY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(iY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(Lj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function j1e(){}function ST(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 Mj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const oY=/[$_\p{ID_Start}]/u,lY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,cY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,uY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jj={};function D1e(e){return e?oY.test(String.fromCodePoint(e)):!1}function P1e(e,t){const r=(t||jj).jsx?cY:lY;return e?r.test(String.fromCodePoint(e)):!1}function TT(e,t){return(jj.jsx?dY:uY).test(e)}const fY=/[ \t\n\f\r]/g;function hY(e){return typeof e=="object"?e.type==="text"?AT(e.value):!1:AT(e)}function AT(e){return e.replace(fY,"")===""}let sh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};sh.prototype.normal={};sh.prototype.property={};sh.prototype.space=void 0;function Dj(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new sh(n,r,t)}function Tf(e){return e.toLowerCase()}class rs{constructor(t,n){this.attribute=n,this.property=t}}rs.prototype.attribute="";rs.prototype.booleanish=!1;rs.prototype.boolean=!1;rs.prototype.commaOrSpaceSeparated=!1;rs.prototype.commaSeparated=!1;rs.prototype.defined=!1;rs.prototype.mustUseProperty=!1;rs.prototype.number=!1;rs.prototype.overloadedBoolean=!1;rs.prototype.property="";rs.prototype.spaceSeparated=!1;rs.prototype.space=void 0;let pY=0;const wt=bl(),Zn=bl(),HE=bl(),Me=bl(),sn=bl(),Sc=bl(),cs=bl();function bl(){return 2**++pY}const zE=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:Zn,commaOrSpaceSeparated:cs,commaSeparated:Sc,number:Me,overloadedBoolean:HE,spaceSeparated:sn},Symbol.toStringTag,{value:"Module"})),sb=Object.keys(zE);class Dv extends rs{constructor(t,n,r,s){let i=-1;if(super(t,n),CT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&EY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(IT,wY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!IT.test(i)){let a=i.replace(bY,xY);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Dv}return new s(r,t)}function xY(e){return"-"+e.toLowerCase()}function wY(e){return e.charAt(1).toUpperCase()}const ih=Dj([Pj,mY,Uj,$j,Hj],"html"),go=Dj([Pj,gY,Uj,$j,Hj],"svg");function RT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function zj(e){return e.join(" ").trim()}var Pv={},OT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vY=/\n/g,_Y=/^\s*/,kY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,NY=/^:\s*/,SY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,TY=/^[;\s]*/,AY=/^\s+|\s+$/g,CY=` -`,LT="/",MT="*",Do="",IY="comment",RY="declaration";function OY(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 g=m.match(vY);g&&(n+=g.length);var w=m.lastIndexOf(CY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(_Y)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(LT!=e.charAt(0)||MT!=e.charAt(1))){for(var g=2;Do!=e.charAt(g)&&(MT!=e.charAt(g)||LT!=e.charAt(g+1));)++g;if(g+=2,Do===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:IY,comment:w})}}function h(){var m=i(),g=c(kY);if(g){if(f(),!c(NY))return l("property missing ':'");var w=c(SY),y=m({type:RY,property:jT(g[0].replace(OT,Do)),value:w?jT(w[0].replace(OT,Do)):Do});return c(TY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function jT(e){return e?e.replace(AY,Do):Do}var LY=OY,MY=xm&&xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pv,"__esModule",{value:!0});Pv.default=DY;const jY=MY(LY);function DY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,jY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var y0={};Object.defineProperty(y0,"__esModule",{value:!0});y0.camelCase=void 0;var PY=/^--[a-zA-Z0-9_-]+$/,BY=/-([a-z])/g,FY=/^[^-]+$/,UY=/^-(webkit|moz|ms|o|khtml)-/,$Y=/^-(ms)-/,HY=function(e){return!e||FY.test(e)||PY.test(e)},zY=function(e,t){return t.toUpperCase()},DT=function(e,t){return"".concat(t,"-")},VY=function(e,t){return t===void 0&&(t={}),HY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace($Y,DT):e=e.replace(UY,DT),e.replace(BY,zY))};y0.camelCase=VY;var KY=xm&&xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},YY=KY(Pv),WY=y0;function VE(e,t){var n={};return!e||typeof e!="string"||(0,YY.default)(e,function(r,s){r&&s&&(n[(0,WY.camelCase)(r,t)]=s)}),n}VE.default=VE;var GY=VE;const qY=Kf(GY),b0=Vj("end"),Hi=Vj("start");function Vj(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 XY(e){const t=Hi(e),n=b0(e);if(t&&n)return{start:t,end:n}}function Ud(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PT(e.position):"start"in e||"end"in e?PT(e):"line"in e||"column"in e?KE(e):""}function KE(e){return BT(e&&e.line)+":"+BT(e&&e.column)}function PT(e){return KE(e&&e.start)+"-"+KE(e&&e.end)}function BT(e){return e&&typeof e=="number"?e:1}class Tr 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Ud(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}}Tr.prototype.file="";Tr.prototype.name="";Tr.prototype.reason="";Tr.prototype.message="";Tr.prototype.stack="";Tr.prototype.column=void 0;Tr.prototype.line=void 0;Tr.prototype.ancestors=void 0;Tr.prototype.cause=void 0;Tr.prototype.fatal=void 0;Tr.prototype.place=void 0;Tr.prototype.ruleId=void 0;Tr.prototype.source=void 0;const Bv={}.hasOwnProperty,QY=new Map,ZY=/[A-Z]/g,JY=new Set(["table","tbody","thead","tfoot","tr"]),eW=new Set(["td","th"]),Kj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tW(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=cW(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=lW(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"?go:ih,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Yj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Yj(e,t,n){if(t.type==="element")return nW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return iW(e,t,n);if(t.type==="mdxjsEsm")return sW(e,t);if(t.type==="root")return aW(e,t,n);if(t.type==="text")return oW(e,t)}function nW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=Gj(e,t.tagName,!1),a=uW(e,t);let l=Uv(e,t);return JY.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!hY(c):!0})),Wj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function rW(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)}Af(e,t.position)}function sW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Af(e,t.position)}function iW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Gj(e,t.name,!0),a=dW(e,t),l=Uv(e,t);return Wj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function aW(e,t,n){const r={};return Fv(r,Uv(e,t)),e.create(t,e.Fragment,r,n)}function oW(e,t){return t.value}function Wj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function cW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=Hi(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function uW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Bv.call(t.properties,s)){const i=fW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&eW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Af(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else Af(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Uv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:QY;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?(ms(e,e.length,0,t),e):t}const $T={}.hasOwnProperty;function Xj(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 yi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dr=yo(/[A-Za-z]/),kr=yo(/[\dA-Za-z]/),wW=yo(/[#-'*+\--9=?A-Z^-~]/);function ag(e){return e!==null&&(e<32||e===127)}const YE=yo(/\d/),vW=yo(/[\dA-Fa-f]/),_W=yo(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function Ct(e){return e===-2||e===-1||e===32}const E0=yo(new RegExp("\\p{P}|\\p{S}","u")),ll=yo(/\s/);function yo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Dt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return Ct(c)?(e.enter(n),l(c)):t(c)}function l(c){return Ct(c)&&i++a))return;const A=t.events.length;let S=A,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=A;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function AW(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qc(e){if(e===null||nn(e)||ll(e))return 1;if(E0(e))return 2}function x0(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};zT(f,-c),zT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rs(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rs(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Rs(u,x0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rs(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Rs(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ms(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&Ct(N)?Dt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||rt(N)?e.check(VT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||rt(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,A,S){let R=0;return I;function I(U){return N.enter("lineEnding"),N.consume(U),N.exit("lineEnding"),D}function D(U){return N.enter("codeFencedFence"),Ct(U)?Dt(N,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===l?(N.enter("codeFencedFenceSequence"),W(U)):S(U)}function W(U){return U===l?(R++,N.consume(U),W):R>=a?(N.exit("codeFencedFenceSequence"),Ct(U)?Dt(N,L,"whitespace")(U):L(U)):S(U)}function L(U){return U===null||rt(U)?(N.exit("codeFencedFence"),A(U)):S(U)}}}function UW(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 ab={name:"codeIndented",tokenize:HW},$W={partial:!0,tokenize:zW};function HW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Dt(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):rt(u)?e.attempt($W,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||rt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function zW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):rt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Dt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):rt(a)?s(a):n(a)}}const VW={name:"codeText",previous:YW,resolve:KW,tokenize:WW};function KW(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&&Xu(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),Xu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xu(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 n3(e,t,n,r,s,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||ag(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||rt(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||nn(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):rt(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||rt(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Ct(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function s3(e,t,n,r,s,i){let a;return l;function l(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):rt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||rt(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 $d(e,t){let n;return r;function r(s){return rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ct(s)?Dt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const tG={name:"definition",tokenize:rG},nG={partial:!0,tokenize:sG};function rG(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return r3.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=yi(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 nn(p)?$d(e,u)(p):u(p)}function u(p){return n3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(nG,f,f)(p)}function f(p){return Ct(p)?Dt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||rt(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function sG(e,t,n){return r;function r(l){return nn(l)?$d(e,s)(l):n(l)}function s(l){return s3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return Ct(l)?Dt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||rt(l)?t(l):n(l)}}const iG={name:"hardBreakEscape",tokenize:aG};function aG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const oG={name:"headingAtx",resolve:lG,tokenize:cG};function lG(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"},ms(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function cG(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||nn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||rt(d)?(e.exit("atxHeading"),t(d)):Ct(d)?Dt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||nn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const uG=["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"],YT=["pre","script","style","textarea"],dG={concrete:!0,name:"htmlFlow",resolveTo:pG,tokenize:mG},fG={partial:!0,tokenize:yG},hG={partial:!0,tokenize:gG};function pG(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 mG(e,t,n){const r=this;let s,i,a,l,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,g):P===63?(e.consume(P),s=3,r.interrupt?t:T):Dr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,l=0,m):Dr(P)?(e.consume(P),s=4,r.interrupt?t:T):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:T):n(P)}function m(P){const se="CDATA[";return P===se.charCodeAt(l++)?(e.consume(P),l===se.length?r.interrupt?t:F:m):n(P)}function g(P){return Dr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function w(P){if(P===null||P===47||P===62||nn(P)){const se=P===47,Q=a.toLowerCase();return!se&&!i&&YT.includes(Q)?(s=1,r.interrupt?t(P):F(P)):uG.includes(a.toLowerCase())?(s=6,se?(e.consume(P),y):r.interrupt?t(P):F(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?b(P):x(P))}return P===45||kr(P)?(e.consume(P),a+=String.fromCharCode(P),w):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function b(P){return Ct(P)?(e.consume(P),b):I(P)}function x(P){return P===47?(e.consume(P),I):P===58||P===95||Dr(P)?(e.consume(P),_):Ct(P)?(e.consume(P),x):I(P)}function _(P){return P===45||P===46||P===58||P===95||kr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):Ct(P)?(e.consume(P),k):x(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,A):Ct(P)?(e.consume(P),N):S(P)}function A(P){return P===c?(e.consume(P),c=null,R):P===null||rt(P)?n(P):(e.consume(P),A)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||nn(P)?k(P):(e.consume(P),S)}function R(P){return P===47||P===62||Ct(P)?x(P):n(P)}function I(P){return P===62?(e.consume(P),D):n(P)}function D(P){return P===null||rt(P)?F(P):Ct(P)?(e.consume(P),D):n(P)}function F(P){return P===45&&s===2?(e.consume(P),C):P===60&&s===1?(e.consume(P),M):P===62&&s===4?(e.consume(P),z):P===63&&s===3?(e.consume(P),T):P===93&&s===5?(e.consume(P),j):rt(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(fG,G,W)(P)):P===null||rt(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),F)}function W(P){return e.check(hG,L,G)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return P===null||rt(P)?W(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),T):F(P)}function M(P){return P===47?(e.consume(P),a="",O):F(P)}function O(P){if(P===62){const se=a.toLowerCase();return YT.includes(se)?(e.consume(P),z):F(P)}return Dr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),O):F(P)}function j(P){return P===93?(e.consume(P),T):F(P)}function T(P){return P===62?(e.consume(P),z):P===45&&s===2?(e.consume(P),T):F(P)}function z(P){return P===null||rt(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),z)}function G(P){return e.exit("htmlFlow"),t(P)}}function gG(e,t,n){const r=this;return s;function s(a){return rt(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 yG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ah,t,n)}}const bG={name:"htmlText",tokenize:EG};function EG(e,t,n){const r=this;let s,i,a;return l;function l(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),k):T===63?(e.consume(T),x):Dr(T)?(e.consume(T),S):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),i=0,m):Dr(T)?(e.consume(T),b):n(T)}function d(T){return T===45?(e.consume(T),p):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):rt(T)?(a=f,M(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),p):f(T)}function p(T){return T===62?C(T):T===45?h(T):f(T)}function m(T){const z="CDATA[";return T===z.charCodeAt(i++)?(e.consume(T),i===z.length?g:m):n(T)}function g(T){return T===null?n(T):T===93?(e.consume(T),w):rt(T)?(a=g,M(T)):(e.consume(T),g)}function w(T){return T===93?(e.consume(T),y):g(T)}function y(T){return T===62?C(T):T===93?(e.consume(T),y):g(T)}function b(T){return T===null||T===62?C(T):rt(T)?(a=b,M(T)):(e.consume(T),b)}function x(T){return T===null?n(T):T===63?(e.consume(T),_):rt(T)?(a=x,M(T)):(e.consume(T),x)}function _(T){return T===62?C(T):x(T)}function k(T){return Dr(T)?(e.consume(T),N):n(T)}function N(T){return T===45||kr(T)?(e.consume(T),N):A(T)}function A(T){return rt(T)?(a=A,M(T)):Ct(T)?(e.consume(T),A):C(T)}function S(T){return T===45||kr(T)?(e.consume(T),S):T===47||T===62||nn(T)?R(T):n(T)}function R(T){return T===47?(e.consume(T),C):T===58||T===95||Dr(T)?(e.consume(T),I):rt(T)?(a=R,M(T)):Ct(T)?(e.consume(T),R):C(T)}function I(T){return T===45||T===46||T===58||T===95||kr(T)?(e.consume(T),I):D(T)}function D(T){return T===61?(e.consume(T),F):rt(T)?(a=D,M(T)):Ct(T)?(e.consume(T),D):R(T)}function F(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,W):rt(T)?(a=F,M(T)):Ct(T)?(e.consume(T),F):(e.consume(T),L)}function W(T){return T===s?(e.consume(T),s=void 0,U):T===null?n(T):rt(T)?(a=W,M(T)):(e.consume(T),W)}function L(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||nn(T)?R(T):(e.consume(T),L)}function U(T){return T===47||T===62||nn(T)?R(T):n(T)}function C(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function M(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),O}function O(T){return Ct(T)?Dt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):j(T)}function j(T){return e.enter("htmlTextData"),a(T)}}const zv={name:"labelEnd",resolveAll:_G,resolveTo:kG,tokenize:NG},xG={tokenize:SG},wG={tokenize:TG},vG={tokenize:AG};function _G(e){let t=-1;const n=[];for(;++t=3&&(u===null||rt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ct(u)?Dt(e,l,"whitespace")(u):l(u))}}const qr={continuation:{tokenize:BG},exit:UG,name:"list",tokenize:PG},jG={partial:!0,tokenize:$G},DG={partial:!0,tokenize:FG};function PG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:YE(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(om,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 YE(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(ah,r.interrupt?n:d,e.attempt(jG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return Ct(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 BG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ah,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Dt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!Ct(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(DG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Dt(e,e.attempt(qr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function FG(e,t,n){const r=this;return Dt(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function UG(e){e.exit(this.containerState.type)}function $G(e,t,n){const r=this;return Dt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!Ct(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const WT={name:"setextUnderline",resolveTo:HG,tokenize:zG};function HG(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 zG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ct(u)?Dt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||rt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const VG={tokenize:KG};function KG(e){const t=this,n=e.attempt(ah,r,e.attempt(this.parser.constructs.flowInitial,s,Dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(XW,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 YG={resolveAll:a3()},WG=i3("string"),GG=i3("text");function i3(e){return{resolveAll:a3(e==="text"?qG:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function lq(e,t){let n=-1;const r=[];let s;for(;++n0){const et=ge.tokenStack[ge.tokenStack.length-1];(et[1]||qT).call(ge,void 0,et[0])}for(ee.position={start:Ia(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:Ia(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge0&&(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 vq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Eu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Nq(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 Sq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function c3(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 Tq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return c3(e,t);const s={src:Eu(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 Aq(e,t){const n={src:Eu(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 Cq(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 Iq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return c3(e,t);const s={href:Eu(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 Rq(e,t){const n={href:Eu(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 Oq(e,t,n){const r=e.all(t),s=n?Lq(n):u3(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 l=-1;for(;++l1}function Mq(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)},l=Hi(t.children[1]),c=b0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Fq(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,l=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(ZT(t.slice(s),s>0,!1)),i.join("")}function ZT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===XT||i===QT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===XT||i===QT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Hq(e,t){const n={type:"text",value:$q(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Vq={blockquote:Eq,break:xq,code:wq,delete:vq,emphasis:_q,footnoteReference:kq,heading:Nq,html:Sq,imageReference:Tq,image:Aq,inlineCode:Cq,linkReference:Iq,link:Rq,listItem:Oq,list:Mq,paragraph:jq,root:Dq,strong:Pq,table:Bq,tableCell:Uq,tableRow:Fq,text:Hq,thematicBreak:zq,toml:dp,yaml:dp,definition:dp,footnoteDefinition:dp};function dp(){}const d3=-1,w0=0,Hd=1,og=2,Vv=3,Kv=4,Yv=5,Wv=6,f3=7,h3=8,Kq=typeof self=="object"?self:globalThis,JT=(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 Kq[e](t)},Yq=(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 w0:case d3:return n(a,s);case Hd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case og:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Vv:return n(new Date(a),s);case Kv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case Yv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Wv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case f3:{const{name:l,message:c}=a;return n(JT(l,c),s)}case h3: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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(JT(i,a),s)};return r},e2=e=>Yq(new Map,e)(0),jl="",{toString:Wq}={},{keys:Gq}=Object,Qu=e=>{const t=typeof e;if(t!=="object"||!e)return[w0,t];const n=Wq.call(e).slice(8,-1);switch(n){case"Array":return[Hd,jl];case"Object":return[og,jl];case"Date":return[Vv,jl];case"RegExp":return[Kv,jl];case"Map":return[Yv,jl];case"Set":return[Wv,jl];case"DataView":return[Hd,n]}return n.includes("Array")?[Hd,n]:n.includes("Error")?[f3,n]:[og,n]},fp=([e,t])=>e===w0&&(t==="function"||t==="symbol"),qq=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Qu(a);switch(l){case w0:{let d=a;switch(c){case"bigint":l=h3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([d3],a)}return s([l,d],a)}case Hd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case og:{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([l,d],a);for(const h of Gq(a))(e||!fp(Qu(a[h])))&&d.push([i(h),i(a[h])]);return f}case Vv:return s([l,a.toISOString()],a);case Kv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case Yv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(fp(Qu(h))||fp(Qu(p))))&&d.push([i(h),i(p)]);return f}case Wv:{const d=[],f=s([l,d],a);for(const h of a)(e||!fp(Qu(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},t2=(e,{json:t,lossy:n}={})=>{const r=[];return qq(!(t||n),!!t,new Map,r)(e),r},Xc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?e2(t2(e,t)):structuredClone(e):(e,t)=>e2(t2(e,t));function Xq(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 Qq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Zq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Xq,r=e.options.footnoteBackLabel||Qq,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Xc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const oh=function(e){if(e==null)return nX;if(typeof e=="function")return v0(e);if(typeof e=="object")return Array.isArray(e)?Jq(e):eX(e);if(typeof e=="string")return tX(e);throw new Error("Expected function, string, or object as test")};function Jq(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=p3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=aX(n(c,d)),p[0]===GE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==iX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` -`}),n}function n2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function r2(e,t){const n=lX(e,t),r=n.one(e,void 0),s=Zq(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function hX(e,t){return e&&"run"in e?async function(n,r){const s=r2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return r2(n,{file:r,...e||t})}}function s2(e){if(e)throw e}var lm=Object.prototype.hasOwnProperty,g3=Object.prototype.toString,i2=Object.defineProperty,a2=Object.getOwnPropertyDescriptor,o2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):g3.call(t)==="[object Array]"},l2=function(t){if(!t||g3.call(t)!=="[object Object]")return!1;var n=lm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&lm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||lm.call(t,s)},c2=function(t,n){i2&&n.name==="__proto__"?i2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},u2=function(t,n){if(n==="__proto__")if(lm.call(t,n)){if(a2)return a2(t,n).value}else return;return t[n]},pX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Ii={basename:yX,dirname:bX,extname:EX,join:xX,sep:"/"};function yX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ch(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function bX(e){if(ch(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 EX(e){ch(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 xX(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function ch(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _X={cwd:kX};function kX(){return"/"}function QE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NX(e){if(typeof e=="string")e=new URL(e);else if(!QE(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 SX(e)}function SX(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 g=r[h][1];XE(g)&&XE(p)&&(p=lb(!0,g,p)),r[h]=[u,p,...m]}}}}const IX=new Gv().freeze();function fb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pb(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 f2(e){if(!XE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function h2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hp(e){return RX(e)?e:new y3(e)}function RX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OX(e){return typeof e=="string"||LX(e)}function LX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",p2=[],m2={allowDangerousHtml:!0},jX=/^(https?|ircs?|mailto|xmpp)$/i,DX=[{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 PX(e){const t=BX(e),n=FX(e);return UX(t.runSync(t.parse(n),n),e)}function BX(e){const t=e.rehypePlugins||p2,n=e.remarkPlugins||p2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...m2}:m2;return IX().use(bq).use(n).use(hX,r).use(t)}function FX(e){const t=e.children||"",n=new y3;return typeof t=="string"&&(n.value=t),n}function UX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||$X;for(const d of DX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+MX+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),lh(e,u),tW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 ib)if(Object.hasOwn(ib,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=ib[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function $X(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||jX.test(e.slice(0,t))?e:""}function g2(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 HX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zX(e,t,n){const s=oh((n||{}).ignore||[]),i=VX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=g2(e,"(");let i=g2(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 b3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ll(n)||E0(n))&&(!t||n!==47)}E3.peek=hQ;function iQ(){this.buffer()}function aQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function oQ(){this.buffer()}function lQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uQ(e){this.exit(e)}function dQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fQ(e){this.exit(e)}function hQ(){return"["}function E3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function pQ(){return{enter:{gfmFootnoteCallString:iQ,gfmFootnoteCall:aQ,gfmFootnoteDefinitionLabelString:oQ,gfmFootnoteDefinition:lQ},exit:{gfmFootnoteCallString:cQ,gfmFootnoteCall:uQ,gfmFootnoteDefinitionLabelString:dQ,gfmFootnoteDefinition:fQ}}}function mQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:E3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?x3:gQ))),u(),c}}function gQ(e,t,n){return t===0?e:x3(e,t,n)}function x3(e,t,n){return(n?"":" ")+e}const yQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];w3.peek=vQ;function bQ(){return{canContainEols:["delete"],enter:{strikethrough:xQ},exit:{strikethrough:wQ}}}function EQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yQ}],handlers:{delete:w3}}}function xQ(e){this.enter({type:"delete",children:[]},e)}function wQ(e){this.exit(e)}function w3(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 vQ(){return"~"}function _Q(e){return e.length}function kQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||_Q,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),TQ);return s(),a}function TQ(e,t,n){return">"+(n?"":" ")+e}function AQ(e,t){return E2(e,t.inConstruct,!0)&&!E2(e,t.notInConstruct,!1)}function E2(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 IQ(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 RQ(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 OQ(e,t,n,r){const s=RQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(IQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,LQ);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(CQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` -`,encode:["`"],...l.current()})),f()}return d+=l.move(` -`),i&&(d+=l.move(i+` -`)),d+=l.move(c),u(),d}function LQ(e,t,n){return(n?"":" ")+e}function qv(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 MQ(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function jQ(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 Cf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function lg(e,t,n){const r=qc(e),s=qc(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}}_3.peek=DQ;function _3(e,t,n,r){const s=jQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=lg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Cf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=lg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Cf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function DQ(e,t,n){return n.options.emphasis||"*"}function PQ(e,t){let n=!1;return lh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,GE}),!!((!e.depth||e.depth<3)&&$v(e)&&(t.options.setext||n))}function BQ(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(PQ(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),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Cf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}k3.peek=FQ;function k3(e){return e.value||""}function FQ(){return"<"}N3.peek=UQ;function N3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function UQ(){return"!"}S3.peek=$Q;function S3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function $Q(){return"!"}T3.peek=HQ;function T3(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))}C3.peek=zQ;function C3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(A3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function zQ(e,t,n){return A3(e,n)?"<":"["}I3.peek=VQ;function I3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function VQ(){return"["}function Xv(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 KQ(e){const t=Xv(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 YQ(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 R3(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 WQ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?YQ(n):Xv(n);const l=e.ordered?a==="."?")":".":KQ(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),R3(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 XQ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const QQ=oh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZQ(e,t,n,r){return(e.children.some(function(a){return QQ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JQ(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=eZ;function O3(e,t,n,r){const s=JQ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=lg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Cf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=lg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Cf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function eZ(e,t,n){return n.options.strong||"*"}function tZ(e,t,n,r){return n.safe(e.value,r)}function nZ(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 rZ(e,t,n){const r=(R3(n)+(n.options.ruleSpaces?" ":"")).repeat(nZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const L3={blockquote:SQ,break:x2,code:OQ,definition:MQ,emphasis:_3,hardBreak:x2,heading:BQ,html:k3,image:N3,imageReference:S3,inlineCode:T3,link:C3,linkReference:I3,list:WQ,listItem:qQ,paragraph:XQ,root:ZQ,strong:O3,text:tZ,thematicBreak:rZ};function sZ(){return{enter:{table:iZ,tableData:w2,tableHeader:w2,tableRow:oZ},exit:{codeText:lZ,table:aZ,tableData:bb,tableHeader:bb,tableRow:bb}}}function iZ(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 aZ(e){this.exit(e),this.data.inTable=void 0}function oZ(e){this.enter({type:"tableRow",children:[]},e)}function bb(e){this.exit(e)}function w2(e){this.enter({type:"tableCell",children:[]},e)}function lZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,cZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function cZ(e,t){return t==="|"?t:e}function uZ(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:l}};function a(p,m,g,w){return u(d(p,g,w),p.align)}function l(p,m,g,w){const y=f(p,g,w),b=u([y]);return b.slice(0,b.indexOf(` -`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return kQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const AZ={tokenize:DZ,partial:!0};function CZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LZ,continuation:{tokenize:MZ},exit:jZ}},text:{91:{name:"gfmFootnoteCall",tokenize:OZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IZ,resolveTo:RZ}}}}function IZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=yi(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 RZ(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)},l=[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,...l),e}function OZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||nn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(yi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return nn(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 LZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||nn(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=yi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return nn(m)||(l=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),Dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function MZ(e,t,n){return e.check(ah,t,e.attempt(AZ,t,n))}function jZ(e){e.exit("gfmFootnoteDefinition")}function DZ(e,t,n){const r=this;return Dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function PZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=qc(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class BZ{constructor(){this.map=[]}add(t,n,r){FZ(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 FZ(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,W=F==="tableHead"||F==="tableRow"?N:c;return W===N&&r.parser.lazy[r.now().line]?n(I):W(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):rt(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):Ct(I)?Dt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||nn(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Ct(I)?Dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return Ct(I)?Dt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||rt(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return Ct(I)?Dt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||rt(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||rt(I)?(e.exit("tableRow"),t(I)):Ct(I)?Dt(e,A,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||nn(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function zZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new BZ;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Vl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function _2(e,t,n,r,s){const i=[],a=Vl(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 Vl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const VZ={name:"tasklistCheck",tokenize:YZ};function KZ(){return{text:{91:VZ}}}function YZ(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 nn(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"),l):n(c)}function l(c){return rt(c)?t(c):Ct(c)?e.check({tokenize:WZ},t,n)(c):n(c)}}function WZ(e,t,n){return Dt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function GZ(e){return Xj([EZ(),CZ(),PZ(e),$Z(),KZ()])}const qZ={};function XZ(e){const t=this,n=e||qZ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(GZ(n)),i.push(mZ()),a.push(gZ(n))}const k2=function(e,t,n){const r=oh(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 z3(e,t,n){return e.type==="element"?sJ(e,t,n):e.type==="text"?n.whitespace==="normal"?V3(e,n):iJ(e):[]}function sJ(e,t,n){const r=K3(e,n),s=e.children||[];let i=-1,a=[];if(nJ(e))return a;let l,c;for(JE(e)||A2(e)&&k2(t,e,A2)?c=` -`:tJ(e)?(l=2,c=2):H3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function fJ(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=dJ(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 Y3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function hJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function pJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mJ(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const gJ=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_-]*/}}),yJ=["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"],bJ=["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"],EJ=[...yJ,...bJ],xJ=["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(),wJ=["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(),vJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_J=["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 kJ(e){const t=e.regex,n=gJ(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_-]*",l=[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:":("+wJ.join("|")+")"},{begin:":(:)?("+vJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_J.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:xJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+EJ.join("|")+")\\b"}]}}function NJ(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 SJ(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:"G3(e,t,n-1))}function AJ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+G3("(?:<"+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,C2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},C2,u]}}const I2="[A-Za-z$_][0-9A-Za-z$_]*",CJ=["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"],IJ=["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"],X3=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Q3=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],OJ=[].concat(Q3,q3,X3);function Z3(e){const t=e.regex,n=(O,{after:j})=>{const T="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const T=O[0].length+O.index,z=O.input[T];if(z==="<"||z===","){j.ignoreMatch();return}z===">"&&(n(O,{after:T})||j.ignoreMatch());let G;const P=O.input.substring(T);if(G=P.match(/^\s*=/)){j.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){j.ignoreMatch();return}}},l={$pattern:I2,keyword:CJ,literal:IJ,built_in:OJ,"variable.language":RJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},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,...X3]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const W={match:t.concat(/\b/,F([...Q3,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,A,U,{match:/\$[(.]/}]}}function J3(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 Yl="[0-9](_*[0-9])*",yp=`\\.(${Yl})`,bp="[0-9a-fA-F](_*[0-9a-fA-F])*",LJ={className:"number",variants:[{begin:`(\\b(${Yl})((${yp})|\\.)?|(${yp}))[eE][+-]?(${Yl})[fFdD]?\\b`},{begin:`\\b(${Yl})((${yp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${yp})[fFdD]?\\b`},{begin:`\\b(${Yl})[fFdD]\\b`},{begin:`\\b0[xX]((${bp})\\.?|(${bp})?\\.(${bp}))[pP][+-]?(${Yl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${bp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function MJ(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 l={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=LJ,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const jJ=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_-]*/}}),DJ=["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"],PJ=["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"],BJ=[...DJ,...PJ],FJ=["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(),eD=["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(),tD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),UJ=["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(),$J=eD.concat(tD).sort().reverse();function HJ(e){const t=jJ(e),n=$J,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:FJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+UJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+BJ.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:":("+eD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+tD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function zJ(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 nD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 VJ(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_]*/,l={"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:l,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 KJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 YJ(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},l={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,U)=>{U.data._beginMatch=L[1]||L[2]},"on:end":(L,U)=>{U.data._beginMatch!==L[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(L=>{const U=[];return L.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:b},k=L=>L.map(U=>U.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const F=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],W={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[W,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}]}},l,{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",W,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function WJ(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 GJ(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function sD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function qJ(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function XJ(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 QJ(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function ZJ(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const JJ=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_-]*/}}),eee=["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"],tee=["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"],nee=[...eee,...tee],ree=["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(),see=["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(),iee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),aee=["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 oee(e){const t=JJ(e),n=iee,r=see,s="@[a-z-]+",i="and or not only",l={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("+nee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aee.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,l,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:ree.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function lee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function cee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:A}={}){const S=A;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function iD(e){return e?typeof e=="string"?e:e.source:null}function Zu(e){return Jt("(?=",e,")")}function Jt(...e){return e.map(n=>iD(n)).join("")}function uee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Lr(...e){return"("+(uee(e).capture?"":"?:")+e.map(r=>iD(r)).join("|")+")"}const Jv=e=>Jt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),dee=["Protocol","Type"].map(Jv),R2=["init","self"].map(Jv),fee=["Any","Self"],Eb=["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"],O2=["false","nil","true"],hee=["assignment","associativity","higherThan","left","lowerThan","none","right"],pee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],L2=["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"],aD=Lr(/[/=\-+!*%<>&|^~?]/,/[\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]/),oD=Lr(aD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),xb=Jt(aD,oD,"*"),lD=Lr(/[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]/),cg=Lr(lD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ai=Jt(lD,cg,"*"),Ep=Jt(/[A-Z]/,cg,"*"),mee=["attached","autoclosure",Jt(/convention\(/,Lr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Jt(/objc\(/,Ai,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],gee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function yee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,Lr(...dee,...R2)],className:{2:"keyword"}},i={match:Jt(/\./,Lr(...Eb)),relevance:0},a=Eb.filter(Re=>typeof Re=="string").concat(["_|0"]),l=Eb.filter(Re=>typeof Re!="string").concat(fee).map(Jv),c={variants:[{className:"keyword",match:Lr(...l,...R2)}]},u={$pattern:Lr(/\b\w+/,/#\w+/),keyword:a.concat(pee),literal:O2},d=[s,i,c],f={match:Jt(/\./,Lr(...L2)),relevance:0},h={className:"built_in",match:Jt(/\b/,Lr(...L2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:xb},{match:`\\.(\\.|${oD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Re="")=>({className:"subst",variants:[{match:Jt(/\\/,Re,/[0\\tnr"']/)},{match:Jt(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Re="")=>({className:"subst",match:Jt(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Re="")=>({className:"subst",label:"interpol",begin:Jt(/\\/,Re,/\(/),end:/\)/}),A=(Re="")=>({begin:Jt(Re,/"""/),end:Jt(/"""/,Re),contains:[_(Re),k(Re),N(Re)]}),S=(Re="")=>({begin:Jt(Re,/"/),end:Jt(/"/,Re),contains:[_(Re),N(Re)]}),R={className:"string",variants:[A(),A("#"),A("##"),A("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=Re=>{const Ke=Jt(Re,/\//),Oe=Jt(/\//,Re);return{begin:Ke,end:Oe,contains:[...I,{scope:"comment",begin:`#(?!.*${Oe})`,end:/$/}]}},W={scope:"regexp",variants:[F("###"),F("##"),F("#"),D]},L={match:Jt(/`/,Ai,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${cg}+`},M=[L,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:gee,contains:[...w,x,R]}]}},j={scope:"keyword",match:Jt(/@/,Lr(...mee),Zu(Lr(/\(/,/\s+/)))},T={scope:"meta",match:Jt(/@/,Ai)},z=[O,j,T],G={match:Zu(/\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)/,cg,"+")},{className:"type",match:Ep,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Jt(/\s+&\s+/,Zu(Ep)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...z,m,G]};G.contains.push(P);const se={match:Jt(Ai,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",se,...r,W,...d,...p,...w,x,R,...M,...z,G]},ne={begin://,keywords:"repeat each",contains:[...r,G]},fe={begin:Lr(Zu(Jt(Ai,/\s*:/)),Zu(Jt(Ai,/\s+/,Ai,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ai}]},Z={begin:/\(/,end:/\)/,keywords:u,contains:[fe,...r,...d,...w,x,R,...z,G,Q],endsParent:!0,illegal:/["']/},pe={match:[/(func|macro)/,/\s+/,Lr(L.match,Ai,xb)],className:{1:"keyword",3:"title.function"},contains:[ne,Z,t],illegal:[/\[/,/%/]},J={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,Z,t],illegal:/\[|%/},be={match:[/operator/,/\s+/,xb],className:{1:"keyword",3:"title"}},ye={begin:[/precedencegroup/,/\s+/,Ep],className:{1:"keyword",3:"title"},contains:[G],keywords:[...hee,...O2],end:/}/},we={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ve={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ai,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Ep},...d],relevance:0}]};for(const Re of R.variants){const Ke=Re.contains.find(mt=>mt.label==="interpol");Ke.keywords=u;const Oe=[...d,...p,...w,x,R,...M];Ke.contains=[...Oe,{begin:/\(/,end:/\)/,contains:["self",...Oe]}]}return{name:"Swift",keywords:u,contains:[...r,pe,J,we,ve,Te,be,ye,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...p,...w,x,R,...M,...z,G,Q]}}const ug="[A-Za-z$_][0-9A-Za-z$_]*",cD=["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"],uD=["true","false","null","undefined","NaN","Infinity"],dD=["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"],fD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mD=[].concat(hD,dD,fD);function bee(e){const t=e.regex,n=(O,{after:j})=>{const T="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,j)=>{const T=O[0].length+O.index,z=O.input[T];if(z==="<"||z===","){j.ignoreMatch();return}z===">"&&(n(O,{after:T})||j.ignoreMatch());let G;const P=O.input.substring(T);if(G=P.match(/^\s*=/)){j.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){j.ignoreMatch();return}}},l={$pattern:ug,keyword:cD,literal:uD,built_in:mD,"variable.language":pD},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},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:{_:[...dD,...fD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const W={match:t.concat(/\b/,F([...hD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,A,U,{match:/\$[(.]/}]}}function gD(e){const t=e.regex,n=bee(e),r=ug,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:ug,keyword:cD.concat(c),literal:uD,built_in:mD.concat(s),"variable.language":pD},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Eee(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 xee(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},l={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,l]}}function wee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 yD(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const vee={arduino:fJ,bash:Y3,c:hJ,cpp:pJ,csharp:mJ,css:kJ,diff:NJ,go:SJ,graphql:TJ,ini:W3,java:AJ,javascript:Z3,json:J3,kotlin:MJ,less:HJ,lua:zJ,makefile:nD,markdown:rD,objectivec:VJ,perl:KJ,php:YJ,"php-template":WJ,plaintext:GJ,python:sD,"python-repl":qJ,r:XJ,ruby:QJ,rust:ZJ,scss:oee,shell:lee,sql:cee,swift:yee,typescript:gD,vbnet:Eee,wasm:xee,xml:wee,yaml:yD};function bD(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)&&bD(n)}),e}let M2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function ED(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Wa(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 _ee="",j2=e=>!!e.scope,kee=(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 Nee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=ED(t)}openNode(t){if(!j2(t))return;const n=kee(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){j2(t)&&(this.buffer+=_ee)}value(){return this.buffer}span(t){this.buffer+=``}}const D2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class e_{constructor(){this.rootNode=D2(),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=D2({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=>{e_._collapse(n)}))}}class See extends e_{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 Nee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function If(e){return e?typeof e=="string"?e:e.source:null}function xD(e){return xl("(?=",e,")")}function Tee(e){return xl("(?:",e,")*")}function Aee(e){return xl("(?:",e,")?")}function xl(...e){return e.map(n=>If(n)).join("")}function Cee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function t_(...e){return"("+(Cee(e).capture?"":"?:")+e.map(r=>If(r)).join("|")+")"}function wD(e){return new RegExp(e.toString()+"|").exec("").length-1}function Iee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Ree=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function n_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=If(r),a="";for(;i.length>0;){const l=Ree.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const Oee=/\b\B/,vD="[a-zA-Z]\\w*",r_="[a-zA-Z_]\\w*",_D="\\b\\d+(\\.\\d+)?",kD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ND="\\b(0b[01]+)",Lee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Mee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=xl(t,/.*\b/,e.binary,/\b.*/)),Wa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Rf={begin:"\\\\[\\s\\S]",relevance:0},jee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Rf]},Dee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Rf]},Pee={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/},_0=function(e,t,n={}){const r=Wa({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=t_("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:xl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Bee=_0("//","$"),Fee=_0("/\\*","\\*/"),Uee=_0("#","$"),$ee={scope:"number",begin:_D,relevance:0},Hee={scope:"number",begin:kD,relevance:0},zee={scope:"number",begin:ND,relevance:0},Vee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Rf,{begin:/\[/,end:/\]/,relevance:0,contains:[Rf]}]},Kee={scope:"title",begin:vD,relevance:0},Yee={scope:"title",begin:r_,relevance:0},Wee={begin:"\\.\\s*"+r_,relevance:0},Gee=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 xp=Object.freeze({__proto__:null,APOS_STRING_MODE:jee,BACKSLASH_ESCAPE:Rf,BINARY_NUMBER_MODE:zee,BINARY_NUMBER_RE:ND,COMMENT:_0,C_BLOCK_COMMENT_MODE:Fee,C_LINE_COMMENT_MODE:Bee,C_NUMBER_MODE:Hee,C_NUMBER_RE:kD,END_SAME_AS_BEGIN:Gee,HASH_COMMENT_MODE:Uee,IDENT_RE:vD,MATCH_NOTHING_RE:Oee,METHOD_GUARD:Wee,NUMBER_MODE:$ee,NUMBER_RE:_D,PHRASAL_WORDS_MODE:Pee,QUOTE_STRING_MODE:Dee,REGEXP_MODE:Vee,RE_STARTERS_RE:Lee,SHEBANG:Mee,TITLE_MODE:Kee,UNDERSCORE_IDENT_RE:r_,UNDERSCORE_TITLE_MODE:Yee});function qee(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Xee(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Qee(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=qee,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Zee(e,t){Array.isArray(e.illegal)&&(e.illegal=t_(...e.illegal))}function Jee(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 ete(e,t){e.relevance===void 0&&(e.relevance=1)}const tte=(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=xl(n.beforeMatch,xD(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},nte=["of","and","for","in","not","or","if","then","parent","list","value"],rte="keyword";function SD(e,t,n=rte){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,SD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,ste(c[0],c[1])]})}}function ste(e,t){return t?Number(t):ite(e)?0:1}function ite(e){return nte.includes(e.toLowerCase())}const P2={},Xo=e=>{console.error(e)},B2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Dl=(e,t)=>{P2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),P2[`${e}/${t}`]=!0)},dg=new Error;function TD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=wD(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function ate(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),dg;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xo("beginScope must be object"),dg;TD(e,e.begin,{key:"beginScope"}),e.begin=n_(e.begin,{joinWith:""})}}function ote(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),dg;if(typeof e.endScope!="object"||e.endScope===null)throw Xo("endScope must be object"),dg;TD(e,e.end,{key:"endScope"}),e.end=n_(e.end,{joinWith:""})}}function lte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function cte(e){lte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ate(e),ote(e)}function ute(e){function t(a,l){return new RegExp(If(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=wD(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(n_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[Xee,Jee,cte,tte].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Qee,Zee,ete].forEach(d=>d(a,l)),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=SD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=If(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return dte(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Wa(e.classNameAliases||{}),i(e)}function AD(e){return e?e.endsWithParent||AD(e.starts):!1}function dte(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Wa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:AD(e)?Wa(e,{starts:e.starts?Wa(e.starts):null}):Object.isFrozen(e)?Wa(e):e}var fte="11.11.1";class hte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const wb=ED,F2=Wa,U2=Symbol("nomatch"),pte=7,CD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:See};function c(C){return l.noHighlightRe.test(C)}function u(C){let M=C.className+" ";M+=C.parentNode?C.parentNode.className:"";const O=l.languageDetectRe.exec(M);if(O){const j=S(O[1]);return j||(B2(i.replace("{}",O[1])),B2("Falling back to no-highlight mode for this block.",C)),j?O[1]:"no-highlight"}return M.split(/\s+/).find(j=>c(j)||S(j))}function d(C,M,O){let j="",T="";typeof M=="object"?(j=C,O=M.ignoreIllegals,T=M.language):(Dl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dl("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),T=C,j=M),O===void 0&&(O=!0);const z={code:j,language:T};L("before:highlight",z);const G=z.result?z.result:f(z.language,z.code,O);return G.code=z.code,L("after:highlight",G),G}function f(C,M,O,j){const T=Object.create(null);function z(q,ee){return q.keywords[ee]}function G(){if(!Oe.keywords){Xe.addText(Ye);return}let q=0;Oe.keywordPatternRe.lastIndex=0;let ee=Oe.keywordPatternRe.exec(Ye),ge="";for(;ee;){ge+=Ye.substring(q,ee.index);const Pe=Te.case_insensitive?ee[0].toLowerCase():ee[0],Ge=z(Oe,Pe);if(Ge){const[et,$t]=Ge;if(Xe.addText(ge),ge="",T[Pe]=(T[Pe]||0)+1,T[Pe]<=pte&&(ce+=$t),et.startsWith("_"))ge+=ee[0];else{const bt=Te.classNameAliases[et]||et;Q(ee[0],bt)}}else ge+=ee[0];q=Oe.keywordPatternRe.lastIndex,ee=Oe.keywordPatternRe.exec(Ye)}ge+=Ye.substring(q),Xe.addText(ge)}function P(){if(Ye==="")return;let q=null;if(typeof Oe.subLanguage=="string"){if(!t[Oe.subLanguage]){Xe.addText(Ye);return}q=f(Oe.subLanguage,Ye,!0,mt[Oe.subLanguage]),mt[Oe.subLanguage]=q._top}else q=p(Ye,Oe.subLanguage.length?Oe.subLanguage:null);Oe.relevance>0&&(ce+=q.relevance),Xe.__addSublanguage(q._emitter,q.language)}function se(){Oe.subLanguage!=null?P():G(),Ye=""}function Q(q,ee){q!==""&&(Xe.startScope(ee),Xe.addText(q),Xe.endScope())}function ne(q,ee){let ge=1;const Pe=ee.length-1;for(;ge<=Pe;){if(!q._emit[ge]){ge++;continue}const Ge=Te.classNameAliases[q[ge]]||q[ge],et=ee[ge];Ge?Q(et,Ge):(Ye=et,G(),Ye=""),ge++}}function fe(q,ee){return q.scope&&typeof q.scope=="string"&&Xe.openNode(Te.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(Q(Ye,Te.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),Ye=""):q.beginScope._multi&&(ne(q.beginScope,ee),Ye="")),Oe=Object.create(q,{parent:{value:Oe}}),Oe}function Z(q,ee,ge){let Pe=Iee(q.endRe,ge);if(Pe){if(q["on:end"]){const Ge=new M2(q);q["on:end"](ee,Ge),Ge.isMatchIgnored&&(Pe=!1)}if(Pe){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return Z(q.parent,ee,ge)}function pe(q){return Oe.matcher.regexIndex===0?(Ye+=q[0],1):(ct=!0,0)}function J(q){const ee=q[0],ge=q.rule,Pe=new M2(ge),Ge=[ge.__beforeBegin,ge["on:begin"]];for(const et of Ge)if(et&&(et(q,Pe),Pe.isMatchIgnored))return pe(ee);return ge.skip?Ye+=ee:(ge.excludeBegin&&(Ye+=ee),se(),!ge.returnBegin&&!ge.excludeBegin&&(Ye=ee)),fe(ge,q),ge.returnBegin?0:ee.length}function be(q){const ee=q[0],ge=M.substring(q.index),Pe=Z(Oe,q,ge);if(!Pe)return U2;const Ge=Oe;Oe.endScope&&Oe.endScope._wrap?(se(),Q(ee,Oe.endScope._wrap)):Oe.endScope&&Oe.endScope._multi?(se(),ne(Oe.endScope,q)):Ge.skip?Ye+=ee:(Ge.returnEnd||Ge.excludeEnd||(Ye+=ee),se(),Ge.excludeEnd&&(Ye=ee));do Oe.scope&&Xe.closeNode(),!Oe.skip&&!Oe.subLanguage&&(ce+=Oe.relevance),Oe=Oe.parent;while(Oe!==Pe.parent);return Pe.starts&&fe(Pe.starts,q),Ge.returnEnd?0:ee.length}function ye(){const q=[];for(let ee=Oe;ee!==Te;ee=ee.parent)ee.scope&&q.unshift(ee.scope);q.forEach(ee=>Xe.openNode(ee))}let we={};function ve(q,ee){const ge=ee&&ee[0];if(Ye+=q,ge==null)return se(),0;if(we.type==="begin"&&ee.type==="end"&&we.index===ee.index&&ge===""){if(Ye+=M.slice(ee.index,ee.index+1),!s){const Pe=new Error(`0 width match regex (${C})`);throw Pe.languageName=C,Pe.badRule=we.rule,Pe}return 1}if(we=ee,ee.type==="begin")return J(ee);if(ee.type==="illegal"&&!O){const Pe=new Error('Illegal lexeme "'+ge+'" for mode "'+(Oe.scope||"")+'"');throw Pe.mode=Oe,Pe}else if(ee.type==="end"){const Pe=be(ee);if(Pe!==U2)return Pe}if(ee.type==="illegal"&&ge==="")return Ye+=` -`,1;if(st>1e5&&st>ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ye+=ge,ge.length}const Te=S(C);if(!Te)throw Xo(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Re=ute(Te);let Ke="",Oe=j||Re;const mt={},Xe=new l.__emitter(l);ye();let Ye="",ce=0,Se=0,st=0,ct=!1;try{if(Te.__emitTokens)Te.__emitTokens(M,Xe);else{for(Oe.matcher.considerAll();;){st++,ct?ct=!1:Oe.matcher.considerAll(),Oe.matcher.lastIndex=Se;const q=Oe.matcher.exec(M);if(!q)break;const ee=M.substring(Se,q.index),ge=ve(ee,q);Se=q.index+ge}ve(M.substring(Se))}return Xe.finalize(),Ke=Xe.toHTML(),{language:C,value:Ke,relevance:ce,illegal:!1,_emitter:Xe,_top:Oe}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:C,value:wb(M),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:Se,context:M.slice(Se-100,Se+100),mode:q.mode,resultSoFar:Ke},_emitter:Xe};if(s)return{language:C,value:wb(M),illegal:!1,relevance:0,errorRaised:q,_emitter:Xe,_top:Oe};throw q}}function h(C){const M={value:wb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return M._emitter.addText(C),M}function p(C,M){M=M||l.languages||Object.keys(t);const O=h(C),j=M.filter(S).filter(I).map(se=>f(se,C,!1));j.unshift(O);const T=j.sort((se,Q)=>{if(se.relevance!==Q.relevance)return Q.relevance-se.relevance;if(se.language&&Q.language){if(S(se.language).supersetOf===Q.language)return 1;if(S(Q.language).supersetOf===se.language)return-1}return 0}),[z,G]=T,P=z;return P.secondBest=G,P}function m(C,M,O){const j=M&&n[M]||O;C.classList.add("hljs"),C.classList.add(`language-${j}`)}function g(C){let M=null;const O=u(C);if(c(O))return;if(L("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new hte("One of your code blocks includes unescaped HTML.",C.innerHTML);M=C;const j=M.textContent,T=O?d(j,{language:O,ignoreIllegals:!0}):p(j);C.innerHTML=T.value,C.dataset.highlighted="yes",m(C,O,T.language),C.result={language:T.language,re:T.relevance,relevance:T.relevance},T.secondBest&&(C.secondBest={language:T.secondBest.language,relevance:T.secondBest.relevance}),L("after:highlightElement",{el:C,result:T,text:j})}function w(C){l=F2(l,C)}const y=()=>{_(),Dl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Dl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,M){let O=null;try{O=M(e)}catch(j){if(Xo("Language definition for '{}' could not be registered.".replace("{}",C)),s)Xo(j);else throw j;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=M.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function N(C){delete t[C];for(const M of Object.keys(n))n[M]===C&&delete n[M]}function A(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:M}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=M})}function I(C){const M=S(C);return M&&!M.disableAutodetect}function D(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=M=>{C["before:highlightBlock"](Object.assign({block:M.el},M))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=M=>{C["after:highlightBlock"](Object.assign({block:M.el},M))})}function F(C){D(C),r.push(C)}function W(C){const M=r.indexOf(C);M!==-1&&r.splice(M,1)}function L(C,M){const O=C;r.forEach(function(j){j[O]&&j[O](M)})}function U(C){return Dl("10.7.0","highlightBlock will be removed entirely in v12.0"),Dl("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:U,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:A,getLanguage:S,registerAliases:R,autoDetection:I,inherit:F2,addPlugin:F,removePlugin:W}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=fte,e.regex={concat:xl,lookahead:xD,either:t_,optional:Aee,anyNumberOfTimes:Tee};for(const C in xp)typeof xp[C]=="object"&&bD(xp[C]);return Object.assign(e,xp),e},Qc=CD({});Qc.newInstance=()=>CD({});var mte=Qc;Qc.HighlightJS=Qc;Qc.default=Qc;const ns=Kf(mte),$2={},gte="hljs-";function yte(e){const t=ns.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||$2,h=typeof f.prefix=="string"?f.prefix:gte;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:bte,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||$2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class bte{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,l){return l?a+"_".repeat(l):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 Ete={};function H2(e){const t=e||Ete,n=t.aliases,r=t.detect||!1,s=t.languages||vee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=yte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){lh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=xte(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=rJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function xte(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 l=n[a];if(l===void 0){const c=K2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 Yte(e){return e>=56320&&e<=57343}function Wte(e,t){return(e-55296)*1024+9216+t}function jD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function DD(e){return e>=64976&&e<=65007||Kte.has(e)}var he;(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"})(he||(he={}));const Gte=65536;class qte{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=Gte,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(Yte(n))return this.pos++,this._addGap(),Wte(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(he.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,MD(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){jD(t)?this._err(he.controlCharacterInInputStream):DD(t)&&this._err(he.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 Xte=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))),Qte=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 Zte(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Qte.get(e))!==null&&t!==void 0?t:e}var ur;(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"})(ur||(ur={}));const Jte=32;var Ga;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ga||(Ga={}));function tx(e){return e>=ur.ZERO&&e<=ur.NINE}function ene(e){return e>=ur.UPPER_A&&e<=ur.UPPER_F||e>=ur.LOWER_A&&e<=ur.LOWER_F}function tne(e){return e>=ur.UPPER_A&&e<=ur.UPPER_Z||e>=ur.LOWER_A&&e<=ur.LOWER_Z||tx(e)}function nne(e){return e===ur.EQUALS||tne(e)}var lr;(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"})(lr||(lr={}));var ta;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ta||(ta={}));class rne{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=lr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ta.Strict}startEntity(t){this.decodeMode=t,this.state=lr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case lr.EntityStart:return t.charCodeAt(n)===ur.NUM?(this.state=lr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=lr.NamedEntity,this.stateNamedEntity(t,n));case lr.NumericStart:return this.stateNumericStart(t,n);case lr.NumericDecimal:return this.stateNumericDecimal(t,n);case lr.NumericHex:return this.stateNumericHex(t,n);case lr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Jte)===ur.LOWER_X?(this.state=lr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=lr.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===ur.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ta.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]&Ga.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]&~Ga.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case lr.NamedEntity:return this.result!==0&&(this.decodeMode!==ta.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lr.NumericDecimal:return this.emitNumericEntity(0,2);case lr.NumericHex:return this.emitNumericEntity(0,3);case lr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lr.EntityStart:return 0}}}function sne(e,t,n,r){const s=(t&Ga.BRANCH_LENGTH)>>7,i=t&Ga.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=c-1;else return e[c+s]}return-1}var _e;(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/"})(_e||(_e={}));var Qo;(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"})(Qo||(Qo={}));var Os;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Os||(Os={}));var ae;(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"})(ae||(ae={}));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 ine=new Map([[ae.A,v.A],[ae.ADDRESS,v.ADDRESS],[ae.ANNOTATION_XML,v.ANNOTATION_XML],[ae.APPLET,v.APPLET],[ae.AREA,v.AREA],[ae.ARTICLE,v.ARTICLE],[ae.ASIDE,v.ASIDE],[ae.B,v.B],[ae.BASE,v.BASE],[ae.BASEFONT,v.BASEFONT],[ae.BGSOUND,v.BGSOUND],[ae.BIG,v.BIG],[ae.BLOCKQUOTE,v.BLOCKQUOTE],[ae.BODY,v.BODY],[ae.BR,v.BR],[ae.BUTTON,v.BUTTON],[ae.CAPTION,v.CAPTION],[ae.CENTER,v.CENTER],[ae.CODE,v.CODE],[ae.COL,v.COL],[ae.COLGROUP,v.COLGROUP],[ae.DD,v.DD],[ae.DESC,v.DESC],[ae.DETAILS,v.DETAILS],[ae.DIALOG,v.DIALOG],[ae.DIR,v.DIR],[ae.DIV,v.DIV],[ae.DL,v.DL],[ae.DT,v.DT],[ae.EM,v.EM],[ae.EMBED,v.EMBED],[ae.FIELDSET,v.FIELDSET],[ae.FIGCAPTION,v.FIGCAPTION],[ae.FIGURE,v.FIGURE],[ae.FONT,v.FONT],[ae.FOOTER,v.FOOTER],[ae.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ae.FORM,v.FORM],[ae.FRAME,v.FRAME],[ae.FRAMESET,v.FRAMESET],[ae.H1,v.H1],[ae.H2,v.H2],[ae.H3,v.H3],[ae.H4,v.H4],[ae.H5,v.H5],[ae.H6,v.H6],[ae.HEAD,v.HEAD],[ae.HEADER,v.HEADER],[ae.HGROUP,v.HGROUP],[ae.HR,v.HR],[ae.HTML,v.HTML],[ae.I,v.I],[ae.IMG,v.IMG],[ae.IMAGE,v.IMAGE],[ae.INPUT,v.INPUT],[ae.IFRAME,v.IFRAME],[ae.KEYGEN,v.KEYGEN],[ae.LABEL,v.LABEL],[ae.LI,v.LI],[ae.LINK,v.LINK],[ae.LISTING,v.LISTING],[ae.MAIN,v.MAIN],[ae.MALIGNMARK,v.MALIGNMARK],[ae.MARQUEE,v.MARQUEE],[ae.MATH,v.MATH],[ae.MENU,v.MENU],[ae.META,v.META],[ae.MGLYPH,v.MGLYPH],[ae.MI,v.MI],[ae.MO,v.MO],[ae.MN,v.MN],[ae.MS,v.MS],[ae.MTEXT,v.MTEXT],[ae.NAV,v.NAV],[ae.NOBR,v.NOBR],[ae.NOFRAMES,v.NOFRAMES],[ae.NOEMBED,v.NOEMBED],[ae.NOSCRIPT,v.NOSCRIPT],[ae.OBJECT,v.OBJECT],[ae.OL,v.OL],[ae.OPTGROUP,v.OPTGROUP],[ae.OPTION,v.OPTION],[ae.P,v.P],[ae.PARAM,v.PARAM],[ae.PLAINTEXT,v.PLAINTEXT],[ae.PRE,v.PRE],[ae.RB,v.RB],[ae.RP,v.RP],[ae.RT,v.RT],[ae.RTC,v.RTC],[ae.RUBY,v.RUBY],[ae.S,v.S],[ae.SCRIPT,v.SCRIPT],[ae.SEARCH,v.SEARCH],[ae.SECTION,v.SECTION],[ae.SELECT,v.SELECT],[ae.SOURCE,v.SOURCE],[ae.SMALL,v.SMALL],[ae.SPAN,v.SPAN],[ae.STRIKE,v.STRIKE],[ae.STRONG,v.STRONG],[ae.STYLE,v.STYLE],[ae.SUB,v.SUB],[ae.SUMMARY,v.SUMMARY],[ae.SUP,v.SUP],[ae.TABLE,v.TABLE],[ae.TBODY,v.TBODY],[ae.TEMPLATE,v.TEMPLATE],[ae.TEXTAREA,v.TEXTAREA],[ae.TFOOT,v.TFOOT],[ae.TD,v.TD],[ae.TH,v.TH],[ae.THEAD,v.THEAD],[ae.TITLE,v.TITLE],[ae.TR,v.TR],[ae.TRACK,v.TRACK],[ae.TT,v.TT],[ae.U,v.U],[ae.UL,v.UL],[ae.SVG,v.SVG],[ae.VAR,v.VAR],[ae.WBR,v.WBR],[ae.XMP,v.XMP]]);function wu(e){var t;return(t=ine.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ce=v,ane={[_e.HTML]:new Set([Ce.ADDRESS,Ce.APPLET,Ce.AREA,Ce.ARTICLE,Ce.ASIDE,Ce.BASE,Ce.BASEFONT,Ce.BGSOUND,Ce.BLOCKQUOTE,Ce.BODY,Ce.BR,Ce.BUTTON,Ce.CAPTION,Ce.CENTER,Ce.COL,Ce.COLGROUP,Ce.DD,Ce.DETAILS,Ce.DIR,Ce.DIV,Ce.DL,Ce.DT,Ce.EMBED,Ce.FIELDSET,Ce.FIGCAPTION,Ce.FIGURE,Ce.FOOTER,Ce.FORM,Ce.FRAME,Ce.FRAMESET,Ce.H1,Ce.H2,Ce.H3,Ce.H4,Ce.H5,Ce.H6,Ce.HEAD,Ce.HEADER,Ce.HGROUP,Ce.HR,Ce.HTML,Ce.IFRAME,Ce.IMG,Ce.INPUT,Ce.LI,Ce.LINK,Ce.LISTING,Ce.MAIN,Ce.MARQUEE,Ce.MENU,Ce.META,Ce.NAV,Ce.NOEMBED,Ce.NOFRAMES,Ce.NOSCRIPT,Ce.OBJECT,Ce.OL,Ce.P,Ce.PARAM,Ce.PLAINTEXT,Ce.PRE,Ce.SCRIPT,Ce.SECTION,Ce.SELECT,Ce.SOURCE,Ce.STYLE,Ce.SUMMARY,Ce.TABLE,Ce.TBODY,Ce.TD,Ce.TEMPLATE,Ce.TEXTAREA,Ce.TFOOT,Ce.TH,Ce.THEAD,Ce.TITLE,Ce.TR,Ce.TRACK,Ce.UL,Ce.WBR,Ce.XMP]),[_e.MATHML]:new Set([Ce.MI,Ce.MO,Ce.MN,Ce.MS,Ce.MTEXT,Ce.ANNOTATION_XML]),[_e.SVG]:new Set([Ce.TITLE,Ce.FOREIGN_OBJECT,Ce.DESC]),[_e.XLINK]:new Set,[_e.XML]:new Set,[_e.XMLNS]:new Set},nx=new Set([Ce.H1,Ce.H2,Ce.H3,Ce.H4,Ce.H5,Ce.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var K;(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"})(K||(K={}));const Vn={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function one(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function yd(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function lne(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function ja(e){return lne(e)||yd(e)}function W2(e){return ja(e)||one(e)}function wp(e){return e+32}function BD(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function G2(e){return BD(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function cne(e){return e===$.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:MD(e)?he.surrogateCharacterReference:DD(e)?he.noncharacterCharacterReference:jD(e)||e===$.CARRIAGE_RETURN?he.controlCharacterReference:null}class une{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=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new qte(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new rne(Xte,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=cne(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(he.endTagWithAttributes),t.selfClosing&&this._err(he.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 Tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Tt.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:Tt.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=BD(t)?Tt.WHITESPACE_CHARACTER:t===$.NULL?Tt.NULL_CHARACTER:Tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ta.Attribute:ta.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case K.DATA:{this._stateData(t);break}case K.RCDATA:{this._stateRcdata(t);break}case K.RAWTEXT:{this._stateRawtext(t);break}case K.SCRIPT_DATA:{this._stateScriptData(t);break}case K.PLAINTEXT:{this._statePlaintext(t);break}case K.TAG_OPEN:{this._stateTagOpen(t);break}case K.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case K.TAG_NAME:{this._stateTagName(t);break}case K.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case K.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case K.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case K.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case K.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case K.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case K.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case K.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case K.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case K.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case K.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case K.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case K.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case K.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case K.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case K.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case K.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case K.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case K.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case K.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case K.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case K.BOGUS_COMMENT:{this._stateBogusComment(t);break}case K.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case K.COMMENT_START:{this._stateCommentStart(t);break}case K.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case K.COMMENT:{this._stateComment(t);break}case K.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case K.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case K.COMMENT_END:{this._stateCommentEnd(t);break}case K.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case K.DOCTYPE:{this._stateDoctype(t);break}case K.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case K.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case K.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case K.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case K.CDATA_SECTION:{this._stateCdataSection(t);break}case K.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case K.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case K.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case K.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(he.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=K.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(xn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(xn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(xn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(xn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ja(t))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=K.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=K.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=K.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ja(t))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=K.DATA;break}case $.EOF:{this._err(he.eofBeforeTagName),this._emitChars("");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(xn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ja(t)?(this._emitChars("<"),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ja(t)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case $.NULL:{this._err(he.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(xn);break}case $.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Gr.SCRIPT,!1)&&G2(this.preprocessor.peek(Gr.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])!==_e.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(mne,_e.HTML)}clearBackToTableBodyContext(){this.clearBackTo(pne,_e.HTML)}clearBackToTableRowContext(){this.clearBackTo(hne,_e.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 _e.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case _e.SVG:{if(Q2.has(s))return!1;break}case _e.MATHML:{if(X2.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,fg)}hasInListItemScope(t){return this.hasInDynamicScope(t,dne)}hasInButtonScope(t){return this.hasInDynamicScope(t,fne)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case _e.HTML:{if(nx.has(n))return!0;if(fg.has(n))return!1;break}case _e.SVG:{if(Q2.has(n))return!1;break}case _e.MATHML:{if(X2.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===_e.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])===_e.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])===_e.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&&FD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&q2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&q2.has(this.currentTagId);)this.pop()}}const vb=3;var Ri;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ri||(Ri={}));const Z2={type:Ri.Marker};class bne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=vb&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(Z2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ri.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ri.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(Z2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ri.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ri.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ri.Element&&n.element===t)}}const Da={createDocument(){return{nodeName:"#document",mode:Os.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};Da.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(Da.isTextNode(n)){n.value+=t;return}}Da.appendChild(e,Da.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Da.isTextNode(r)?r.value+=t:Da.insertBefore(e,Da.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function kne(e){return e.name===UD&&e.publicId===null&&(e.systemId===null||e.systemId===Ene)}function Nne(e){if(e.name!==UD)return Os.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xne)return Os.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),vne.has(n))return Os.QUIRKS;let r=t===null?wne:$D;if(J2(n,r))return Os.QUIRKS;if(r=t===null?HD:_ne,J2(n,r))return Os.LIMITED_QUIRKS}return Os.NO_QUIRKS}const eA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Sne="definitionurl",Tne="definitionURL",Ane=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])),Cne=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:_e.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:_e.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:_e.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:_e.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:_e.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:_e.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:_e.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:_e.XML}],["xml:space",{prefix:"xml",name:"space",namespace:_e.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:_e.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:_e.XMLNS}]]),Ine=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])),Rne=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 One(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Qo.COLOR||r===Qo.SIZE||r===Qo.FACE)||Rne.has(t)}function zD(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)===_e.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,_e.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=X.TEXT}switchToPlaintextParsing(){this.insertionMode=X.TEXT,this.originalInsertionMode=X.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)===ae.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==_e.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(l=>this.treeAdapter.isDocumentTypeNode(l));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,_e.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,_e.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(ae.HTML,_e.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===Tt.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)===ae.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===_e.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,_e.HTML)}_processToken(t){switch(t.type){case Tt.CHARACTER:{this.onCharacter(t);break}case Tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Tt.COMMENT:{this.onComment(t);break}case Tt.DOCTYPE:{this.onDoctype(t);break}case Tt.START_TAG:{this._processStartTag(t);break}case Tt.END_TAG:{this.onEndTag(t);break}case Tt.EOF:{this.onEof(t);break}case Tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Dne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ri.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=X.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=X.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=X.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=X.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=X.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=X.IN_TABLE;return}case v.BODY:{this.insertionMode=X.IN_BODY;return}case v.FRAMESET:{this.insertionMode=X.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?X.AFTER_HEAD:X.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=X.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=X.IN_HEAD;return}break}}this.insertionMode=X.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=X.IN_SELECT_IN_TABLE;return}}this.insertionMode=X.IN_SELECT}_isElementCausesFosterParenting(t){return KD.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)===_e.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 ane[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gse(this,t);return}switch(this.insertionMode){case X.INITIAL:{Ju(this,t);break}case X.BEFORE_HTML:{zd(this,t);break}case X.BEFORE_HEAD:{Vd(this,t);break}case X.IN_HEAD:{Kd(this,t);break}case X.IN_HEAD_NO_SCRIPT:{Yd(this,t);break}case X.AFTER_HEAD:{Wd(this,t);break}case X.IN_BODY:case X.IN_CAPTION:case X.IN_CELL:case X.IN_TEMPLATE:{WD(this,t);break}case X.TEXT:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{_b(this,t);break}case X.IN_TABLE_TEXT:{JD(this,t);break}case X.IN_COLUMN_GROUP:{hg(this,t);break}case X.AFTER_BODY:{pg(this,t);break}case X.AFTER_AFTER_BODY:{um(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mse(this,t);return}switch(this.insertionMode){case X.INITIAL:{Ju(this,t);break}case X.BEFORE_HTML:{zd(this,t);break}case X.BEFORE_HEAD:{Vd(this,t);break}case X.IN_HEAD:{Kd(this,t);break}case X.IN_HEAD_NO_SCRIPT:{Yd(this,t);break}case X.AFTER_HEAD:{Wd(this,t);break}case X.TEXT:{this._insertCharacters(t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{_b(this,t);break}case X.IN_COLUMN_GROUP:{hg(this,t);break}case X.AFTER_BODY:{pg(this,t);break}case X.AFTER_AFTER_BODY:{um(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){rx(this,t);return}switch(this.insertionMode){case X.INITIAL:case X.BEFORE_HTML:case X.BEFORE_HEAD:case X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:case X.IN_BODY:case X.IN_TABLE:case X.IN_CAPTION:case X.IN_COLUMN_GROUP:case X.IN_TABLE_BODY:case X.IN_ROW:case X.IN_CELL:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:case X.IN_TEMPLATE:case X.IN_FRAMESET:case X.AFTER_FRAMESET:{rx(this,t);break}case X.IN_TABLE_TEXT:{ed(this,t);break}case X.AFTER_BODY:{Wne(this,t);break}case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{Gne(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case X.INITIAL:{qne(this,t);break}case X.BEFORE_HEAD:case X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case X.IN_TABLE_TEXT:{ed(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?yse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case X.INITIAL:{Ju(this,t);break}case X.BEFORE_HTML:{Xne(this,t);break}case X.BEFORE_HEAD:{Zne(this,t);break}case X.IN_HEAD:{xi(this,t);break}case X.IN_HEAD_NO_SCRIPT:{tre(this,t);break}case X.AFTER_HEAD:{rre(this,t);break}case X.IN_BODY:{Ar(this,t);break}case X.IN_TABLE:{Zc(this,t);break}case X.IN_TABLE_TEXT:{ed(this,t);break}case X.IN_CAPTION:{Jre(this,t);break}case X.IN_COLUMN_GROUP:{c_(this,t);break}case X.IN_TABLE_BODY:{S0(this,t);break}case X.IN_ROW:{T0(this,t);break}case X.IN_CELL:{nse(this,t);break}case X.IN_SELECT:{nP(this,t);break}case X.IN_SELECT_IN_TABLE:{sse(this,t);break}case X.IN_TEMPLATE:{ase(this,t);break}case X.AFTER_BODY:{lse(this,t);break}case X.IN_FRAMESET:{cse(this,t);break}case X.AFTER_FRAMESET:{dse(this,t);break}case X.AFTER_AFTER_BODY:{hse(this,t);break}case X.AFTER_AFTER_FRAMESET:{pse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?bse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case X.INITIAL:{Ju(this,t);break}case X.BEFORE_HTML:{Qne(this,t);break}case X.BEFORE_HEAD:{Jne(this,t);break}case X.IN_HEAD:{ere(this,t);break}case X.IN_HEAD_NO_SCRIPT:{nre(this,t);break}case X.AFTER_HEAD:{sre(this,t);break}case X.IN_BODY:{N0(this,t);break}case X.TEXT:{zre(this,t);break}case X.IN_TABLE:{Of(this,t);break}case X.IN_TABLE_TEXT:{ed(this,t);break}case X.IN_CAPTION:{ese(this,t);break}case X.IN_COLUMN_GROUP:{tse(this,t);break}case X.IN_TABLE_BODY:{sx(this,t);break}case X.IN_ROW:{tP(this,t);break}case X.IN_CELL:{rse(this,t);break}case X.IN_SELECT:{rP(this,t);break}case X.IN_SELECT_IN_TABLE:{ise(this,t);break}case X.IN_TEMPLATE:{ose(this,t);break}case X.AFTER_BODY:{iP(this,t);break}case X.IN_FRAMESET:{use(this,t);break}case X.AFTER_FRAMESET:{fse(this,t);break}case X.AFTER_AFTER_BODY:{um(this,t);break}}}onEof(t){switch(this.insertionMode){case X.INITIAL:{Ju(this,t);break}case X.BEFORE_HTML:{zd(this,t);break}case X.BEFORE_HEAD:{Vd(this,t);break}case X.IN_HEAD:{Kd(this,t);break}case X.IN_HEAD_NO_SCRIPT:{Yd(this,t);break}case X.AFTER_HEAD:{Wd(this,t);break}case X.IN_BODY:case X.IN_TABLE:case X.IN_CAPTION:case X.IN_COLUMN_GROUP:case X.IN_TABLE_BODY:case X.IN_ROW:case X.IN_CELL:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:{QD(this,t);break}case X.TEXT:{Vre(this,t);break}case X.IN_TABLE_TEXT:{ed(this,t);break}case X.IN_TEMPLATE:{sP(this,t);break}case X.AFTER_BODY:case X.IN_FRAMESET:case X.AFTER_FRAMESET:case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{l_(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 X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:case X.TEXT:case X.IN_COLUMN_GROUP:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:case X.IN_FRAMESET:case X.AFTER_FRAMESET:{this._insertCharacters(t);break}case X.IN_BODY:case X.IN_CAPTION:case X.IN_CELL:case X.IN_TEMPLATE:case X.AFTER_BODY:case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{YD(this,t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{_b(this,t);break}case X.IN_TABLE_TEXT:{ZD(this,t);break}}}};function $ne(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):XD(e,t),n}function Hne(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 zne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Fne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Vne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Vne(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 Kne(e,t,n){const r=e.treeAdapter.getTagName(t),s=wu(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===_e.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Yne(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 o_(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 qne(e,t){e._setDocumentType(t);const n=t.forceQuirks?Os.QUIRKS:Nne(t);kne(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=X.BEFORE_HTML}function Ju(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Os.QUIRKS),e.insertionMode=X.BEFORE_HTML,e._processToken(t)}function Xne(e,t){t.tagID===v.HTML?(e._insertElement(t,_e.HTML),e.insertionMode=X.BEFORE_HEAD):zd(e,t)}function Qne(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&zd(e,t)}function zd(e,t){e._insertFakeRootElement(),e.insertionMode=X.BEFORE_HEAD,e._processToken(t)}function Zne(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.HEAD:{e._insertElement(t,_e.HTML),e.headElement=e.openElements.current,e.insertionMode=X.IN_HEAD;break}default:Vd(e,t)}}function Jne(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Vd(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function Vd(e,t){e._insertFakeElement(ae.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=X.IN_HEAD,e._processToken(t)}function xi(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,_e.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,_e.HTML),e.insertionMode=X.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=X.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(X.IN_TEMPLATE);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Kd(e,t)}}function ere(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=X.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Kd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function wl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Kd(e,t){e.openElements.pop(),e.insertionMode=X.AFTER_HEAD,e._processToken(t)}function tre(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{xi(e,t);break}case v.NOSCRIPT:{e._err(t,he.nestedNoscriptInHead);break}default:Yd(e,t)}}function nre(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=X.IN_HEAD;break}case v.BR:{Yd(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Yd(e,t){const n=t.type===Tt.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=X.IN_HEAD,e._processToken(t)}function rre(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.BODY:{e._insertElement(t,_e.HTML),e.framesetOk=!1,e.insertionMode=X.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,_e.HTML),e.insertionMode=X.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,he.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),xi(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Wd(e,t)}}function sre(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Wd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Wd(e,t){e._insertFakeElement(ae.BODY,v.BODY),e.insertionMode=X.IN_BODY,k0(e,t)}function k0(e,t){switch(t.type){case Tt.CHARACTER:{WD(e,t);break}case Tt.WHITESPACE_CHARACTER:{YD(e,t);break}case Tt.COMMENT:{rx(e,t);break}case Tt.START_TAG:{Ar(e,t);break}case Tt.END_TAG:{N0(e,t);break}case Tt.EOF:{QD(e,t);break}}}function YD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function WD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function ire(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function are(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function ore(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,_e.HTML),e.insertionMode=X.IN_FRAMESET)}function lre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,_e.HTML)}function cre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&nx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,_e.HTML)}function ure(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,_e.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function dre(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,_e.HTML),n||(e.formElement=e.openElements.current))}function fre(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,_e.HTML)}function hre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,_e.HTML),e.tokenizer.state=Vn.PLAINTEXT}function pre(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML),e.framesetOk=!1}function mre(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);n&&(o_(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(o_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,_e.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Ere(e,t){e.treeAdapter.getDocumentMode(e.document)!==Os.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,_e.HTML),e.framesetOk=!1,e.insertionMode=X.IN_TABLE}function GD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_e.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qD(e){const t=PD(e,Qo.TYPE);return t!=null&&t.toLowerCase()===Pne}function xre(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_e.HTML),qD(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function wre(e,t){e._appendElement(t,_e.HTML),t.ackSelfClosing=!0}function vre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,_e.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function _re(e,t){t.tagName=ae.IMG,t.tagID=v.IMG,GD(e,t)}function kre(e,t){e._insertElement(t,_e.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Vn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=X.TEXT}function Nre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Vn.RAWTEXT)}function Sre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Vn.RAWTEXT)}function rA(e,t){e._switchToTextParsing(t,Vn.RAWTEXT)}function Tre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===X.IN_TABLE||e.insertionMode===X.IN_CAPTION||e.insertionMode===X.IN_TABLE_BODY||e.insertionMode===X.IN_ROW||e.insertionMode===X.IN_CELL?X.IN_SELECT_IN_TABLE:X.IN_SELECT}function Are(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML)}function Cre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,_e.HTML)}function Ire(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,_e.HTML)}function Rre(e,t){e._reconstructActiveFormattingElements(),zD(t),a_(t),t.selfClosing?e._appendElement(t,_e.MATHML):e._insertElement(t,_e.MATHML),t.ackSelfClosing=!0}function Ore(e,t){e._reconstructActiveFormattingElements(),VD(t),a_(t),t.selfClosing?e._appendElement(t,_e.SVG):e._insertElement(t,_e.SVG),t.ackSelfClosing=!0}function sA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_e.HTML)}function Ar(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:{gre(e,t);break}case v.A:{mre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{cre(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:{lre(e,t);break}case v.LI:case v.DD:case v.DT:{fre(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{GD(e,t);break}case v.HR:{vre(e,t);break}case v.RB:case v.RTC:{Cre(e,t);break}case v.RT:case v.RP:{Ire(e,t);break}case v.PRE:case v.LISTING:{ure(e,t);break}case v.XMP:{Nre(e,t);break}case v.SVG:{Ore(e,t);break}case v.HTML:{ire(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:{xi(e,t);break}case v.BODY:{are(e,t);break}case v.FORM:{dre(e,t);break}case v.NOBR:{yre(e,t);break}case v.MATH:{Rre(e,t);break}case v.TABLE:{Ere(e,t);break}case v.INPUT:{xre(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{wre(e,t);break}case v.IMAGE:{_re(e,t);break}case v.BUTTON:{pre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{bre(e,t);break}case v.IFRAME:{Sre(e,t);break}case v.SELECT:{Tre(e,t);break}case v.OPTION:case v.OPTGROUP:{Are(e,t);break}case v.NOEMBED:case v.NOFRAMES:{rA(e,t);break}case v.FRAMESET:{ore(e,t);break}case v.TEXTAREA:{kre(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?rA(e,t):sA(e,t);break}case v.PLAINTEXT:{hre(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:sA(e,t)}}function Lre(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=X.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Mre(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=X.AFTER_BODY,iP(e,t))}function jre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Dre(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 Pre(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ae.P,v.P),e._closePElement()}function Bre(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Fre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Ure(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function $re(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Hre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function XD(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 N0(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:{o_(e,t);break}case v.P:{Pre(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:{jre(e,t);break}case v.LI:{Bre(e);break}case v.DD:case v.DT:{Fre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Ure(e);break}case v.BR:{Hre(e);break}case v.BODY:{Lre(e,t);break}case v.HTML:{Mre(e,t);break}case v.FORM:{Dre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{$re(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:XD(e,t)}}function QD(e,t){e.tmplInsertionModeStack.length>0?sP(e,t):l_(e,t)}function zre(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 Vre(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function _b(e,t){if(e.openElements.currentTagId!==void 0&&KD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=X.IN_TABLE_TEXT,t.type){case Tt.CHARACTER:{JD(e,t);break}case Tt.WHITESPACE_CHARACTER:{ZD(e,t);break}}else uh(e,t)}function Kre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,_e.HTML),e.insertionMode=X.IN_CAPTION}function Yre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_e.HTML),e.insertionMode=X.IN_COLUMN_GROUP}function Wre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,v.COLGROUP),e.insertionMode=X.IN_COLUMN_GROUP,c_(e,t)}function Gre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_e.HTML),e.insertionMode=X.IN_TABLE_BODY}function qre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,v.TBODY),e.insertionMode=X.IN_TABLE_BODY,S0(e,t)}function Xre(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Qre(e,t){qD(t)?e._appendElement(t,_e.HTML):uh(e,t),t.ackSelfClosing=!0}function Zre(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,_e.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Zc(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{qre(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{xi(e,t);break}case v.COL:{Wre(e,t);break}case v.FORM:{Zre(e,t);break}case v.TABLE:{Xre(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{Gre(e,t);break}case v.INPUT:{Qre(e,t);break}case v.CAPTION:{Kre(e,t);break}case v.COLGROUP:{Yre(e,t);break}default:uh(e,t)}}function Of(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{wl(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:uh(e,t)}}function uh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,k0(e,t),e.fosterParentingEnabled=n}function ZD(e,t){e.pendingCharacterTokens.push(t)}function JD(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ed(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:{wl(e,t);break}}}function sse(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)):nP(e,t)}function ise(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)):rP(e,t)}function ase(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:{xi(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=X.IN_TABLE,e.insertionMode=X.IN_TABLE,Zc(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=X.IN_COLUMN_GROUP,e.insertionMode=X.IN_COLUMN_GROUP,c_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=X.IN_TABLE_BODY,e.insertionMode=X.IN_TABLE_BODY,S0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=X.IN_ROW,e.insertionMode=X.IN_ROW,T0(e,t);break}default:e.tmplInsertionModeStack[0]=X.IN_BODY,e.insertionMode=X.IN_BODY,Ar(e,t)}}function ose(e,t){t.tagID===v.TEMPLATE&&wl(e,t)}function sP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):l_(e,t)}function lse(e,t){t.tagID===v.HTML?Ar(e,t):pg(e,t)}function iP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=X.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 pg(e,t)}function pg(e,t){e.insertionMode=X.IN_BODY,k0(e,t)}function cse(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.FRAMESET:{e._insertElement(t,_e.HTML);break}case v.FRAME:{e._appendElement(t,_e.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{xi(e,t);break}}}function use(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=X.AFTER_FRAMESET))}function dse(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.NOFRAMES:{xi(e,t);break}}}function fse(e,t){t.tagID===v.HTML&&(e.insertionMode=X.AFTER_AFTER_FRAMESET)}function hse(e,t){t.tagID===v.HTML?Ar(e,t):um(e,t)}function um(e,t){e.insertionMode=X.IN_BODY,k0(e,t)}function pse(e,t){switch(t.tagID){case v.HTML:{Ar(e,t);break}case v.NOFRAMES:{xi(e,t);break}}}function mse(e,t){t.chars=xn,e._insertCharacters(t)}function gse(e,t){e._insertCharacters(t),e.framesetOk=!1}function aP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==_e.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function yse(e,t){if(One(t))aP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===_e.MATHML?zD(t):r===_e.SVG&&(Lne(t),VD(t)),a_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function bse(e,t){if(t.tagID===v.P||t.tagID===v.BR){aP(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)===_e.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const Ese=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,xse=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),iA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function oP(e,t){const n=Ise(e),r=v3("type",{handlers:{root:wse,element:vse,text:_se,comment:cP,doctype:kse,raw:Sse},unknown:Tse}),s={parser:n?new nA(iA):nA.getFragmentParser(void 0,iA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),vu(s,Hi());const i=n?s.parser.document:s.parser.getFragment(),a=Rte(i,{file:s.options.file});return s.stitches&&lh(a,"comment",function(l,c,u){const d=l;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 lP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Tt.CHARACTER,chars:e.value,location:dh(e)};vu(t,Hi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function kse(e,t){const n={type:Tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:dh(e)};vu(t,Hi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Nse(e,t){t.stitches=!0;const n=Rse(e);if("children"in e&&"children"in n){const r=oP({type:"root",children:e.children},t.options);n.children=r.children}cP({type:"comment",value:{stitch:n}},t)}function cP(e,t){const n=e.value,r={type:Tt.COMMENT,data:n,location:dh(e)};vu(t,Hi(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Sse(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,uP(t,Hi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Ese,"<$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 Tse(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Nse(n,t);else{let r="";throw xse.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 vu(e,t){uP(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 uP(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 Ase(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Vn.PLAINTEXT)return;vu(t,Hi(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ho.html;s===Ho.html&&n==="svg"&&(s=Ho.svg);const i=Dte({...e,children:[]},{space:s===Ho.svg?"svg":"html"}),a={type:Tt.START_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:dh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Cse(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Vte.includes(n)||t.parser.tokenizer.state===Vn.PLAINTEXT)return;vu(t,b0(e));const r={type:Tt.END_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:dh(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 Ise(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function dh(e){const t=Hi(e)||{line:void 0,column:void 0,offset:void 0},n=b0(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 Rse(e){return"children"in e?Xc({...e,children:[]}):Xc(e)}function Ose(e){return function(t,n){return oP(t,{...e,file:n})}}const dP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function fP(e){if(!e)return!1;try{const t=e.toLowerCase();return dP.some(n=>t.includes(n))}catch{return!1}}function Lse(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(fP(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 dP.some(i=>s.includes(i))}return!1}function Mse({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(PX,{remarkPlugins:[XZ],rehypePlugins:n?[Ose,H2]:[H2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(fP(d)||Lse(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(kc,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(bM,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(kc,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(kc,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(c0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(br,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const fh=E.memo(Mse),aA=6,oA=7,jse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ix(e){return jse[(e||"").trim().toLowerCase()]||"未知"}function lA(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 Dse(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 Pse(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 Bse({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Fse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function cA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 ax(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function uA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(cA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(cA,{direction:"right"})})]})]})}function dm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function Use({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(Bse,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Fse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ix(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(ax,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(fh,{text:Pse(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(dm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function $se(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,A]=E.useState(""),[S,R]=E.useState(null),[I,D]=E.useState(null),[F,W]=E.useState(!1),[L,U]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let z=!0;return u(!0),f(""),VK({region:e,page:s,pageSize:aA}).then(G=>{if(!z)return;const P=G.items||[];r(P),l(G.totalCount||0),p(se=>P.find(Q=>Q.id===(se==null?void 0:se.id))||null)}).catch(G=>{z&&(r([]),l(0),p(null),f(G instanceof Error?G.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{z&&u(!1)}),()=>{z=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let z=!0;return k(!0),A(""),KK(h.id,{region:e,page:w,pageSize:oA,project:h.projectName}).then(G=>{z&&(g(G.items||[]),x(G.totalCount||0))}).catch(G=>{z&&(g([]),x(0),A(G instanceof Error?G.message:"读取技能失败,请稍后重试"))}).finally(()=>{z&&k(!1)}),()=>{z=!1}},[e,h,w]);const M=z=>{z!==e&&(j(),t(z),i(1),y(1),p(null),g([]))},O=z=>{j(),p(z),y(1)},j=()=>{C.current+=1,R(null),D(null),U(""),W(!1)},T=async z=>{if(!h)return;const G=C.current+1;C.current=G,R(z),D(null),U(""),W(!0);try{const P=await YK(h.id,z.skillId,z.version,e,h.projectName);C.current===G&&D(P)}catch(P){C.current===G&&U(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{C.current===G&&W(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>M("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>M("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(dm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(z=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===z.id?"active":""}`,onClick:()=>O(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.name,children:z.name}),o.jsx("span",{className:"skillcenter-item-description",children:z.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${lA(z.status)}`,children:ix(z.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:z.projectName||"default",children:["Project · ",z.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[z.skillCount??0," 个技能"]}),z.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",Dse(z.updatedAt)]})]})]})},`${z.projectName||"default"}:${z.id}`))})]}),o.jsx(uA,{page:s,total:a,pageSize:aA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(dm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(z=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void T(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.skillName,children:z.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:z.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${lA(z.skillStatus)}`,children:ix(z.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",z.version||"—"]})]})]})},`${z.skillId}:${z.version}`))})]}),o.jsx(uA,{page:w,total:b,pageSize:oA,onPage:y})]}):o.jsx(dm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(Use,{skill:S,space:h,region:e,detail:I,loading:F,error:L,onClose:j})]})}function Hse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await xj(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(ro(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx(zt,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function tr(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function A0(){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}})}fm.prototype=A0.prototype={constructor:fm,on:function(e,t){var n=this._,r=Vse(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)),fA.hasOwnProperty(t)?{space:fA[t],local:e}:e}function Yse(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ox&&t.documentElement.namespaceURI===ox?t.createElement(e):t.createElementNS(n,e)}}function Wse(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hP(e){var t=C0(e);return(t.local?Wse:Yse)(t)}function Gse(){}function u_(e){return e==null?Gse:function(){return this.querySelector(e)}}function qse(e){typeof e!="function"&&(e=u_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function xie(e){e||(e=wie);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 vie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _ie(){return Array.from(this)}function kie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?jie:typeof t=="function"?Pie:Die)(e,t,n??"")):Jc(this.node(),e)}function Jc(e,t){return e.style.getPropertyValue(t)||bP(e).getComputedStyle(e,null).getPropertyValue(t)}function Fie(e){return function(){delete this[e]}}function Uie(e,t){return function(){this[e]=t}}function $ie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Hie(e,t){return arguments.length>1?this.each((t==null?Fie:typeof t=="function"?$ie:Uie)(e,t)):this.node()[e]}function EP(e){return e.trim().split(/^|\s+/)}function d_(e){return e.classList||new xP(e)}function xP(e){this._node=e,this._names=EP(e.getAttribute("class")||"")}xP.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 wP(e,t){for(var n=d_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function gae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function lx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}lx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Sae(e){return!e.ctrlKey&&!e.button}function Tae(){return this.parentNode}function Aae(e,t){return t??{x:e.x,y:e.y}}function Cae(){return navigator.maxTouchPoints||"ontouchstart"in this}function TP(){var e=Sae,t=Tae,n=Aae,r=Cae,s={},i=A0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Nae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(ds(_.view).on("mousemove.drag",m,Lf).on("mouseup.drag",g,Lf),NP(_.view),kb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Tc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){ds(_.view).on("mousemove.drag mouseup.drag",null),SP(_.view,u),Tc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,A=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_p(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_p(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=Rae.exec(e))?new Zr(t[1],t[2],t[3],1):(t=Oae.exec(e))?new Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Lae.exec(e))?_p(t[1],t[2],t[3],t[4]):(t=Mae.exec(e))?_p(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jae.exec(e))?EA(t[1],t[2]/100,t[3]/100,1):(t=Dae.exec(e))?EA(t[1],t[2]/100,t[3]/100,t[4]):hA.hasOwnProperty(e)?gA(hA[e]):e==="transparent"?new Zr(NaN,NaN,NaN,0):null}function gA(e){return new Zr(e>>16&255,e>>8&255,e&255,1)}function _p(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zr(e,t,n,r)}function Fae(e){return e instanceof ph||(e=cl(e)),e?(e=e.rgb(),new Zr(e.r,e.g,e.b,e.opacity)):new Zr}function cx(e,t,n,r){return arguments.length===1?Fae(e):new Zr(e,t,n,r??1)}function Zr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}f_(Zr,cx,AP(ph,{brighter(e){return e=e==null?gg:Math.pow(gg,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mf:Math.pow(Mf,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zr(Zo(this.r),Zo(this.g),Zo(this.b),yg(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:yA,formatHex:yA,formatHex8:Uae,formatRgb:bA,toString:bA}));function yA(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}`}function Uae(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}${zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function bA(){const e=yg(this.opacity);return`${e===1?"rgb(":"rgba("}${Zo(this.r)}, ${Zo(this.g)}, ${Zo(this.b)}${e===1?")":`, ${e})`}`}function yg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zo(e){return e=Zo(e),(e<16?"0":"")+e.toString(16)}function EA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new li(e,t,n,r)}function CP(e){if(e instanceof li)return new li(e.h,e.s,e.l,e.opacity);if(e instanceof ph||(e=cl(e)),!e)return new li;if(e instanceof li)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new li(a,l,c,e.opacity)}function $ae(e,t,n,r){return arguments.length===1?CP(e):new li(e,t,n,r??1)}function li(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}f_(li,$ae,AP(ph,{brighter(e){return e=e==null?gg:Math.pow(gg,e),new li(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mf:Math.pow(Mf,e),new li(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 Zr(Nb(e>=240?e-240:e+120,s,r),Nb(e,s,r),Nb(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new li(xA(this.h),kp(this.s),kp(this.l),yg(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=yg(this.opacity);return`${e===1?"hsl(":"hsla("}${xA(this.h)}, ${kp(this.s)*100}%, ${kp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xA(e){return e=(e||0)%360,e<0?e+360:e}function kp(e){return Math.max(0,Math.min(1,e||0))}function Nb(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 h_=e=>()=>e;function Hae(e,t){return function(n){return e+n*t}}function zae(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 Vae(e){return(e=+e)==1?IP:function(t,n){return n-t?zae(t,n,e):h_(isNaN(t)?n:t)}}function IP(e,t){var n=t-e;return n?Hae(e,n):h_(isNaN(e)?t:e)}const bg=function e(t){var n=Vae(t);function r(s,i){var a=n((s=cx(s)).r,(i=cx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=IP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Kae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:Oi(r,s)})),n=Sb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Oi(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Oi(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:Oi(u,f)},{i:g-2,x:Oi(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--eu}function _A(){ul=(xg=Df.now())+I0,eu=bd=0;try{aoe()}finally{eu=0,loe(),ul=0}}function ooe(){var e=Df.now(),t=e-xg;t>MP&&(I0-=t,xg=e)}function loe(){for(var e,t=Eg,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:Eg=n);Ed=e,fx(r)}function fx(e){if(!eu){bd&&(bd=clearTimeout(bd));var t=e-ul;t>24?(e<1/0&&(bd=setTimeout(_A,e-Df.now()-I0)),td&&(td=clearInterval(td))):(td||(xg=Df.now(),td=setInterval(ooe,MP)),eu=1,jP(_A))}}function kA(e,t,n){var r=new wg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var coe=A0("start","end","cancel","interrupt"),uoe=[],PP=0,NA=1,hx=2,pm=3,SA=4,px=5,mm=6;function R0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;doe(e,n,{name:t,index:r,group:s,on:coe,tween:uoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:PP})}function m_(e,t){var n=wi(e,t);if(n.state>PP)throw new Error("too late; already scheduled");return n}function Vi(e,t){var n=wi(e,t);if(n.state>pm)throw new Error("too late; already running");return n}function wi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function doe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=DP(i,0,n.time);function i(u){n.state=NA,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!==NA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===pm)return kA(a);p.state===SA?(p.state=mm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dhx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function $oe(e,t,n){var r,s,i=Uoe(t)?m_:Vi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function Hoe(e,t){var n=this._id;return arguments.length<2?wi(this.node(),n).on.on(e):this.each($oe(n,e,t))}function zoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Voe(){return this.on("end.remove",zoe(this._id))}function Koe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=u_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function gle(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 sa(e,t,n){this.k=e,this.x=t,this.y=n}sa.prototype={constructor:sa,scale:function(e){return e===1?this:new sa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sa(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 O0=new sa(1,0,0);$P.prototype=sa.prototype;function $P(e){for(;!e.__zoom;)if(!(e=e.parentNode))return O0;return e.__zoom}function Tb(e){e.stopImmediatePropagation()}function nd(e){e.preventDefault(),e.stopImmediatePropagation()}function yle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ble(){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 TA(){return this.__zoom||O0}function Ele(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xle(){return navigator.maxTouchPoints||"ontouchstart"in this}function wle(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 HP(){var e=yle,t=ble,n=wle,r=Ele,s=xle,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=hm,u=A0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(L){L.property("__zoom",TA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,U,C,M){var O=L.selection?L.selection():L;O.property("__zoom",TA),L!==O?k(L,U,C,M):O.interrupt().each(function(){N(this,arguments).event(M).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},y.scaleBy=function(L,U,C,M){y.scaleTo(L,function(){var O=this.__zoom.k,j=typeof U=="function"?U.apply(this,arguments):U;return O*j},C,M)},y.scaleTo=function(L,U,C,M){y.transform(L,function(){var O=t.apply(this,arguments),j=this.__zoom,T=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,z=j.invert(T),G=typeof U=="function"?U.apply(this,arguments):U;return n(x(b(j,G),T,z),O,a)},C,M)},y.translateBy=function(L,U,C,M){y.transform(L,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(L,U,C,M,O){y.transform(L,function(){var j=t.apply(this,arguments),T=this.__zoom,z=M==null?_(j):typeof M=="function"?M.apply(this,arguments):M;return n(O0.translate(z[0],z[1]).scale(T.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),j,a)},M,O)};function b(L,U){return U=Math.max(i[0],Math.min(i[1],U)),U===L.k?L:new sa(U,L.x,L.y)}function x(L,U,C){var M=U[0]-C[0]*L.k,O=U[1]-C[1]*L.k;return M===L.x&&O===L.y?L:new sa(L.k,M,O)}function _(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function k(L,U,C,M){L.on("start.zoom",function(){N(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(M).end()}).tween("zoom",function(){var O=this,j=arguments,T=N(O,j).event(M),z=t.apply(O,j),G=C==null?_(z):typeof C=="function"?C.apply(O,j):C,P=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),se=O.__zoom,Q=typeof U=="function"?U.apply(O,j):U,ne=c(se.invert(G).concat(P/se.k),Q.invert(G).concat(P/Q.k));return function(fe){if(fe===1)fe=Q;else{var Z=ne(fe),pe=P/Z[2];fe=new sa(pe,G[0]-Z[0]*pe,G[1]-Z[1]*pe)}T.zoom(null,fe)}})}function N(L,U,C){return!C&&L.__zooming||new A(L,U)}function A(L,U){this.that=L,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,U),this.taps=0}A.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,U){return this.mouse&&L!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var U=ds(this.that).datum();u.call(L,this.that,new gle(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),U)}};function S(L,...U){if(!e.apply(this,arguments))return;var C=N(this,U).event(L),M=this.__zoom,O=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),j=ii(L);if(C.wheel)(C.mouse[0][0]!==j[0]||C.mouse[0][1]!==j[1])&&(C.mouse[1]=M.invert(C.mouse[0]=j)),clearTimeout(C.wheel);else{if(M.k===O)return;C.mouse=[j,M.invert(j)],gm(this),C.start()}nd(L),C.wheel=setTimeout(T,m),C.zoom("mouse",n(x(b(M,O),C.mouse[0],C.mouse[1]),C.extent,a));function T(){C.wheel=null,C.end()}}function R(L,...U){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,M=N(this,U,!0).event(L),O=ds(L.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",P,!0),j=ii(L,C),T=L.clientX,z=L.clientY;NP(L.view),Tb(L),M.mouse=[j,this.__zoom.invert(j)],gm(this),M.start();function G(se){if(nd(se),!M.moved){var Q=se.clientX-T,ne=se.clientY-z;M.moved=Q*Q+ne*ne>g}M.event(se).zoom("mouse",n(x(M.that.__zoom,M.mouse[0]=ii(se,C),M.mouse[1]),M.extent,a))}function P(se){O.on("mousemove.zoom mouseup.zoom",null),SP(se.view,M.moved),nd(se),M.event(se).end()}}function I(L,...U){if(e.apply(this,arguments)){var C=this.__zoom,M=ii(L.changedTouches?L.changedTouches[0]:L,this),O=C.invert(M),j=C.k*(L.shiftKey?.5:2),T=n(x(b(C,j),M,O),t.apply(this,U),a);nd(L),l>0?ds(this).transition().duration(l).call(k,T,M,L):ds(this).call(y.transform,T,M,L)}}function D(L,...U){if(e.apply(this,arguments)){var C=L.touches,M=C.length,O=N(this,U,L.changedTouches.length===M).event(L),j,T,z,G;for(Tb(L),T=0;T`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.`},Pf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],zP=["Enter"," ","Escape"],VP={"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 tu;(function(e){e.Strict="strict",e.Loose="loose"})(tu||(tu={}));var Jo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jo||(Jo={}));var Bf;(function(e){e.Partial="partial",e.Full="full"})(Bf||(Bf={}));const KP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var za;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(za||(za={}));var nu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nu||(nu={}));var Ve;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ve||(Ve={}));const AA={[Ve.Left]:Ve.Right,[Ve.Right]:Ve.Left,[Ve.Top]:Ve.Bottom,[Ve.Bottom]:Ve.Top};function YP(e){return e===null?null:e?"valid":"invalid"}const WP=e=>"id"in e&&"source"in e&&"target"in e,vle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),y_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),mh=(e,t=[0,0])=>{const{width:n,height:r}=Ea(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},_le=(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):y_(s)?s:t.nodeLookup.get(s.id));const l=a?vg(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return L0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return M0(n)},gh=(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=L0(n,vg(s)),r=!0)}),r?M0(n):{x:0,y:0,width:0,height:0}},b_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={..._u(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,g=Ff(l,su(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},kle=(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 Nle(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 Sle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Nle(e,a),c=gh(l),u=x_(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 GP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",Ei.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&fl(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=fl(f)?dl(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",Ei.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 Tle({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=kle(a,c);for(const h of c)l.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 ru=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dl=(e={x:0,y:0},t,n)=>({x:ru(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ru(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function qP(e,t,n){const{width:r,height:s}=Ea(n),{x:i,y:a}=n.internals.positionAbsolute;return dl(e,[[i,a],[i+r,a+s]],t)}const CA=(e,t,n)=>en?-ru(Math.abs(e-n),1,t)/t:0,E_=(e,t,n=15,r=40)=>{const s=CA(e.x,r,t.width-r)*n,i=CA(e.y,r,t.height-r)*n;return[s,i]},L0=(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)}),mx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),M0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),su=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:mh(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}},vg=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:mh(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)}},XP=(e,t)=>M0(L0(mx(e),mx(t))),Ff=(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)},IA=e=>ui(e.width)&&ui(e.height)&&ui(e.x)&&ui(e.y),ui=e=>!isNaN(e)&&isFinite(e),QP=(e,t)=>(n,r)=>{},yh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_u=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?yh(l,a):l},iu=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Pl(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 Ale(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Pl(e,n),s=Pl(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Pl(e.top??e.y??0,n),s=Pl(e.bottom??e.y??0,n),i=Pl(e.left??e.x??0,t),a=Pl(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 Cle(e,t,n,r,s,i){const{x:a,y:l}=iu(e,[t,n,r]),{x:c,y:u}=iu({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const x_=(e,t,n,r,s,i)=>{const a=Ale(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=ru(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,g=Cle(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Uf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fl(e){return e!=null&&e!=="parent"}function Ea(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 w_(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 ZP(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function RA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ile(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Rle(e){return{...VP,...e||{}}}function qd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=di(e),l=_u({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?yh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const v_=e=>({width:e.offsetWidth,height:e.offsetHeight}),JP=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Ole=["INPUT","SELECT","TEXTAREA"];function e4(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:Ole.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const t4=e=>"clientX"in e,di=(e,t)=>{var i,a;const n=t4(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)}},OA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...v_(a)}})};function n4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Tp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function LA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case Ve.Left:return[t-Tp(t-r,i),n];case Ve.Right:return[t+Tp(r-t,i),n];case Ve.Top:return[t,n-Tp(n-s,i)];case Ve.Bottom:return[t,n+Tp(s-n,i)]}}function r4({sourceX:e,sourceY:t,sourcePosition:n=Ve.Bottom,targetX:r,targetY:s,targetPosition:i=Ve.Top,curvature:a=.25}){const[l,c]=LA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=LA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=n4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function s4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const jle=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Dle=(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)),Ple=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Ei.error006()),t;const r=n.getEdgeId||jle;let s;return WP(e)?s={...e}:s={...e,id:r(e)},Dle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function i4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=s4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const MA={[Ve.Left]:{x:-1,y:0},[Ve.Right]:{x:1,y:0},[Ve.Top]:{x:0,y:-1},[Ve.Bottom]:{x:0,y:1}},Ble=({source:e,sourcePosition:t=Ve.Bottom,target:n})=>t===Ve.Left||t===Ve.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Fle({source:e,sourcePosition:t=Ve.Bottom,target:n,targetPosition:r=Ve.Top,center:s,offset:i,stepPosition:a}){const l=MA[t],c=MA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=Ble({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=s4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const L=Math.abs(e[h]-n[h]);if(L<=i){const U=Math.min(i-1,i-L);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*U:b[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const L=h==="x"?"y":"x",U=l[h]===c[L],C=u[L]>d[L],M=u[L]=W?(g=(I.x+D.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+D.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function Ule(e,t,n,r){const s=Math.min(jA(e,t)/2,jA(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 gx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Hle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=gx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const a4=1e3,zle=10,__={nodeOrigin:[0,0],nodeExtent:Pf,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Vle={...__,checkEquality:!0};function k_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Kle(e,t,n){const r=k_(__,n);for(const s of e.values())if(s.parentId)S_(s,e,t,r);else{const i=mh(s,r.nodeOrigin),a=fl(s.extent)?s.extent:r.nodeExtent,l=dl(i,a,Ea(s));s.internals.positionAbsolute=l}}function Yle(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 N_(e){return e==="manual"}function yx(e,t,n,r={}){var d,f;const s=k_(Vle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!N_(s.zIndexMode)?a4: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=mh(h,s.nodeOrigin),g=fl(h.extent)?h.extent:s.nodeExtent,w=dl(m,g,Ea(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:Yle(h,p),z:o4(h,l,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&&S_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Wle(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 S_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=k_(__,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}Wle(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*zle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!N_(c)?a4:0,{x:h,y:p,z:m}=Gle(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function o4(e,t,n){const r=ui(e.zIndex)?e.zIndex:0;return N_(n)?r:r+(e.selected?t:0)}function Gle(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=Ea(e),u=mh(e,n),d=fl(e.extent)?dl(u,e.extent,c):u;let f=dl({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=qP(f,c,t));const h=o4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function T_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??su(c),d=XP(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Ea(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=T_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function Xle({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 FA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 l4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;FA("source",c,d,e,s,a),FA("target",c,u,e,i,l),t.set(r.id,r)}}function c4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:c4(n,t):!1}function UA(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 Qle(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!c4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Ab({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Zle({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=yh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function Jle({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:A=0}){h=ds(_);function S({x:F,y:W}){const{nodeLookup:L,nodeExtent:U,snapGrid:C,snapToGrid:M,nodeOrigin:O,onNodeDrag:j,onSelectionDrag:T,onError:z,updateNodePositions:G}=t();i={x:F,y:W};let P=!1;const se=l.size>1,Q=se&&U?mx(gh(l)):null,ne=se&&M?Zle({dragItems:l,snapGrid:C,x:F,y:W}):null;for(const[fe,Z]of l){if(!L.has(fe))continue;let pe={x:F-Z.distance.x,y:W-Z.distance.y};M&&(pe=ne?{x:Math.round(pe.x+ne.x),y:Math.round(pe.y+ne.y)}:yh(pe,C));let J=null;if(se&&U&&!Z.extent&&Q){const{positionAbsolute:we}=Z.internals,ve=we.x-Q.x+U[0][0],Te=we.x+Z.measured.width-Q.x2+U[1][0],Re=we.y-Q.y+U[0][1],Ke=we.y+Z.measured.height-Q.y2+U[1][1];J=[[ve,Re],[Te,Ke]]}const{position:be,positionAbsolute:ye}=GP({nodeId:fe,nextPosition:pe,nodeLookup:L,nodeExtent:J||U,nodeOrigin:O,onError:z});P=P||Z.position.x!==be.x||Z.position.y!==be.y,Z.position=be,Z.internals.positionAbsolute=ye}if(m=m||P,!!P&&(G(l,!0),g&&(r||j||!N&&T))){const[fe,Z]=Ab({nodeId:N,dragItems:l,nodeLookup:L});r==null||r(g,l,fe,Z),j==null||j(g,fe,Z),N||T==null||T(g,Z)}}async function R(){if(!d)return;const{transform:F,panBy:W,autoPanSpeed:L,autoPanOnNodeDrag:U}=t();if(!U){c=!1,cancelAnimationFrame(a);return}const[C,M]=E_(u,d,L);(C!==0||M!==0)&&(i.x=(i.x??0)-C/F[2],i.y=(i.y??0)-M/F[2],await W({x:C,y:M})&&S(i)),a=requestAnimationFrame(R)}function I(F){var se;const{nodeLookup:W,multiSelectionActive:L,nodesDraggable:U,transform:C,snapGrid:M,snapToGrid:O,selectNodesOnDrag:j,onNodeDragStart:T,onSelectionDragStart:z,unselectNodesAndEdges:G}=t();f=!0,(!j||!k)&&!L&&N&&((se=W.get(N))!=null&&se.selected||G()),k&&j&&N&&(e==null||e(N));const P=qd(F.sourceEvent,{transform:C,snapGrid:M,snapToGrid:O,containerBounds:d});if(i=P,l=Qle(W,U,P,N),l.size>0&&(n||T||!N&&z)){const[Q,ne]=Ab({nodeId:N,dragItems:l,nodeLookup:W});n==null||n(F.sourceEvent,l,Q,ne),T==null||T(F.sourceEvent,Q,ne),N||z==null||z(F.sourceEvent,ne)}}const D=TP().clickDistance(A).on("start",F=>{const{domNode:W,nodeDragThreshold:L,transform:U,snapGrid:C,snapToGrid:M}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,p=!1,m=!1,g=F.sourceEvent,L===0&&I(F),i=qd(F.sourceEvent,{transform:U,snapGrid:C,snapToGrid:M,containerBounds:d}),u=di(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:W,transform:L,snapGrid:U,snapToGrid:C,nodeDragThreshold:M,nodeLookup:O}=t(),j=qd(F.sourceEvent,{transform:L,snapGrid:U,snapToGrid:C,containerBounds:d});if(g=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||N&&!O.has(N))&&(p=!0),!p){if(!c&&W&&f&&(c=!0,R()),!f){const T=di(F.sourceEvent,d),z=T.x-u.x,G=T.y-u.y;Math.sqrt(z*z+G*G)>M&&I(F)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&l&&f&&(u=di(F.sourceEvent,d),S(j))}}).on("end",F=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:W,updateNodePositions:L,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(L(l,!1),m=!1),s||U||!N&&C){const[M,O]=Ab({nodeId:N,dragItems:l,nodeLookup:W,dragging:!1});s==null||s(F.sourceEvent,l,M,O),U==null||U(F.sourceEvent,M,O),N||C==null||C(F.sourceEvent,O)}}}).filter(F=>{const W=F.target;return!F.button&&(!b||!UA(W,`.${b}`,_))&&(!x||UA(W,x,_))});h.call(D)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function ece(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())Ff(s,su(i))>0&&r.push(i);return r}const tce=250;function nce(e,t,n,r){var l,c;let s=[],i=1/0;const a=ece(e,n,t+tce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=hl(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 u4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...hl(a,c,c.position,!0)}:c}function d4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function rce(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const f4=()=>!0;function sce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=f4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:A=1,handleDomNode:S}){const R=JP(e.target);let I=0,D;const{x:F,y:W}=di(e),L=d4(i,S),U=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!U||!L)return;const M=u4(s,L,r,c,t);if(!M)return;let O=di(e,U),j=!1,T=null,z=!1,G=null;function P(){if(!d||!U)return;const[be,ye]=E_(O,U,N);h({x:be,y:ye}),I=requestAnimationFrame(P)}const se={...M,nodeId:s,type:L,position:M.position},Q=c.get(s);let fe={inProgress:!0,isValid:null,from:hl(Q,se,Ve.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:Q,to:O,toHandle:null,toPosition:AA[se.position],toNode:null,pointer:O};function Z(){C=!0,x(fe),m==null||m(e,{nodeId:s,handleId:r,handleType:L})}A===0&&Z();function pe(be){if(!C){const{x:Ke,y:Oe}=di(be),mt=Ke-F,Xe=Oe-W;if(!(mt*mt+Xe*Xe>A*A))return;Z()}if(!k()||!se){J(be);return}const ye=_();O=di(be,U),D=nce(_u(O,ye,!1,[1,1]),n,c,se),j||(P(),j=!0);const we=h4(be,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});G=we.handleDomNode,T=we.connection,z=rce(!!D,we.isValid);const ve=c.get(s),Te=ve?hl(ve,se,Ve.Left,!0):fe.from,Re={...fe,from:Te,isValid:z,to:we.toHandle&&z?iu({x:we.toHandle.x,y:we.toHandle.y},ye):O,toHandle:we.toHandle,toPosition:z&&we.toHandle?we.toHandle.position:AA[se.position],toNode:we.toHandle?c.get(we.toHandle.nodeId):null,pointer:O};x(Re),fe=Re}function J(be){if(!("touches"in be&&be.touches.length>0)){if(C){(D||G)&&T&&z&&(g==null||g(T));const{inProgress:ye,...we}=fe,ve={...we,toPosition:fe.toHandle?fe.toPosition:null};w==null||w(be,ve),i&&(b==null||b(be,ve))}p(),cancelAnimationFrame(I),j=!1,z=!1,T=null,G=null,R.removeEventListener("mousemove",pe),R.removeEventListener("mouseup",J),R.removeEventListener("touchmove",pe),R.removeEventListener("touchend",J)}}R.addEventListener("mousemove",pe),R.addEventListener("mouseup",J),R.addEventListener("touchmove",pe),R.addEventListener("touchend",J)}function h4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=f4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=di(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=d4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const A={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=A;const R=k&&N&&(n===tu.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(A),y.toHandle=u4(x,b,_,d,n,!0)}return y}const bx={onPointerDown:sce,isValid:h4};function ice({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ds(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Uf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,A=_[2]*Math.pow(2,N*k);t.scaleTo(A)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const A=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*A,y:_[1]-N[1]*A},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=HP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ii}}const j0=e=>({x:e.x,y:e.y,zoom:e.k}),Cb=({x:e,y:t,zoom:n})=>O0.translate(e,t).scale(n),dc=(e,t)=>e.target.closest(`.${t}`),p4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ace=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ib=(e,t=0,n=ace,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},m4=e=>{const t=e.ctrlKey&&Uf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(dc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ii(d),y=m4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Jo.Vertical?0:d.deltaX*h,m=s===Jo.Horizontal?0:d.deltaY*h;!Uf()&&d.shiftKey&&s!==Jo.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=j0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function lce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=dc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function cce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=j0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function uce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&p4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,j0(i.transform)))}}function dce({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&p4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=j0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function fce({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(dc(f,`${u}-flow__node`)||dc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||dc(f,l)&&m||dc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function hce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=HP().scaleExtent([t,n]).translateExtent(r),h=ds(e).call(f);b({x:s.x,y:s.y,zoom:ru(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(m4);async function g(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gd:hm).transform(Ib(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function w({noWheelClassName:D,noPanClassName:F,onPaneContextMenu:W,userSelectionActive:L,panOnScroll:U,panOnDrag:C,panOnScrollMode:M,panOnScrollSpeed:O,preventScrolling:j,zoomOnPinch:T,zoomOnScroll:z,zoomOnDoubleClick:G,zoomActivationKeyPressed:P,lib:se,onTransformChange:Q,connectionInProgress:ne,paneClickDistance:fe,selectionOnDrag:Z}){L&&!u.isZoomingOrPanning&&y();const pe=U&&!P&&!L;f.clickDistance(Z?1/0:!ui(fe)||fe<0?0:fe);const J=pe?oce({zoomPanValues:u,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:O,zoomOnPinch:T,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):lce({noWheelClassName:D,preventScrolling:j,d3ZoomHandler:p});h.on("wheel.zoom",J,{passive:!1});const be=cce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",be);const ye=uce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!W,onPanZoom:i,onTransformChange:Q});f.on("zoom",ye);const we=dce({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:W,onPanZoomEnd:l,onDraggingChange:c});f.on("end",we);const ve=fce({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:z,panOnScroll:U,zoomOnDoubleClick:G,zoomOnPinch:T,userSelectionActive:L,noPanClassName:F,noWheelClassName:D,lib:se,connectionInProgress:ne});f.filter(ve),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(D,F,W){const L=Cb(D),U=f==null?void 0:f.constrain()(L,F,W);return U&&await g(U),U}async function x(D,F){const W=Cb(D);return await g(W,F),W}function _(D){if(h){const F=Cb(D),W=h.property("__zoom");(W.k!==D.zoom||W.x!==D.x||W.y!==D.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function k(){const D=h?$P(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(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gd:hm).scaleTo(Ib(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}async function A(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gd:hm).scaleBy(Ib(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function R(D){f==null||f.translateExtent(D)}function I(D){const F=!ui(D)||D<0?0:D;f==null||f.clickDistance(F)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:A,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var au;(function(e){e.Line="line",e.Handle="handle"})(au||(au={}));function pce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function $A(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 Ra(e,t){return Math.max(0,t-e)}function Oa(e,t){return Math.max(0,e-t)}function Ap(e,t,n){return Math.max(0,t-e,e-n)}function HA(e,t){return e?!t:t}function mce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:A}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),D=N+(u?-R:R),F=-i[0]*k,W=-i[1]*N;let L=Ap(I,g,w),U=Ap(D,y,b);if(a){let O=0,j=0;c&&S<0?O=Ra(x+S+F,a[0][0]):!c&&S>0&&(O=Oa(x+I+F,a[1][0])),u&&R<0?j=Ra(_+R+W,a[0][1]):!u&&R>0&&(j=Oa(_+D+W,a[1][1])),L=Math.max(L,O),U=Math.max(U,j)}if(l){let O=0,j=0;c&&S>0?O=Oa(x+S,l[0][0]):!c&&S<0&&(O=Ra(x+I,l[1][0])),u&&R>0?j=Oa(_+R,l[0][1]):!u&&R<0&&(j=Ra(_+D,l[1][1])),L=Math.max(L,O),U=Math.max(U,j)}if(s){if(d){const O=Ap(I/A,y,b)*A;if(L=Math.max(L,O),a){let j=0;!c&&!u||c&&!u&&h?j=Oa(_+W+I/A,a[1][1])*A:j=Ra(_+W+(c?S:-S)/A,a[0][1])*A,L=Math.max(L,j)}if(l){let j=0;!c&&!u||c&&!u&&h?j=Ra(_+I/A,l[1][1])*A:j=Oa(_+(c?S:-S)/A,l[0][1])*A,L=Math.max(L,j)}}if(f){const O=Ap(D*A,g,w)/A;if(U=Math.max(U,O),a){let j=0;!c&&!u||u&&!c&&h?j=Oa(x+D*A+F,a[1][0])/A:j=Ra(x+(u?R:-R)*A+F,a[0][0])/A,U=Math.max(U,j)}if(l){let j=0;!c&&!u||u&&!c&&h?j=Ra(x+D*A,l[1][0])/A:j=Oa(x+(u?R:-R)*A,l[0][0])/A,U=Math.max(U,j)}}}R=R+(R<0?U:-U),S=S+(S<0?L:-L),s&&(h?I>D*A?R=(HA(c,u)?-S:S)/A:S=(HA(c,u)?-R:R)*A:d?(R=S/A,u=c):(S=R*A,c=u));const C=c?x+S:x,M=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+M}}const g4={width:0,height:0,x:0,y:0},gce={...g4,pointerX:0,pointerY:0,aspectRatio:1};function yce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function bce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=ds(e);let a={controlDirection:$A("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...g4},b={...gce};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:$A(u)};let x,_=null,k=[],N,A,S,R=!1;const I=TP().on("start",D=>{const{nodeLookup:F,transform:W,snapGrid:L,snapToGrid:U,nodeOrigin:C,paneDomNode:M}=n();if(x=F.get(t),!x)return;_=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:j}=qd(D.sourceEvent,{transform:W,snapGrid:L,snapToGrid:U,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:O,pointerY:j,aspectRatio:y.width/y.height},N=void 0,A=fl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=F.get(x.parentId)),N&&x.extent==="parent"&&(A=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[T,z]of F)if(z.parentId===t&&(k.push({id:T,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const G=yce(z,x,z.origin??C);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,{...y})}).on("drag",D=>{const{transform:F,snapGrid:W,snapToGrid:L,nodeOrigin:U}=n(),C=qd(D.sourceEvent,{transform:F,snapGrid:W,snapToGrid:L,containerBounds:_}),M=[];if(!x)return;const{x:O,y:j,width:T,height:z}=y,G={},P=x.origin??U,{width:se,height:Q,x:ne,y:fe}=mce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,A,S),Z=se!==T,pe=Q!==z,J=ne!==O&&Z,be=fe!==j&&pe;if(!J&&!be&&!Z&&!pe)return;if((J||be||P[0]===1||P[1]===1)&&(G.x=J?ne:y.x,G.y=be?fe:y.y,y.x=G.x,y.y=G.y,k.length>0)){const Te=ne-O,Re=fe-j;for(const Ke of k)Ke.position={x:Ke.position.x-Te+P[0]*(se-T),y:Ke.position.y-Re+P[1]*(Q-z)},M.push(Ke)}if((Z||pe)&&(G.width=Z&&(!a.resizeDirection||a.resizeDirection==="horizontal")?se:y.width,G.height=pe&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:y.height,y.width=G.width,y.height=G.height),N&&x.expandParent){const Te=P[0]*(G.width??0);G.x&&G.x{R&&(g==null||g(D,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var y4={exports:{}},b4={},E4={exports:{}},x4={};/** - * @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 ou=E;function Ece(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xce=typeof Object.is=="function"?Object.is:Ece,wce=ou.useState,vce=ou.useEffect,_ce=ou.useLayoutEffect,kce=ou.useDebugValue;function Nce(e,t){var n=t(),r=wce({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return _ce(function(){s.value=n,s.getSnapshot=t,Rb(s)&&i({inst:s})},[e,n,t]),vce(function(){return Rb(s)&&i({inst:s}),e(function(){Rb(s)&&i({inst:s})})},[e]),kce(n),n}function Rb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xce(e,n)}catch{return!0}}function Sce(e,t){return t()}var Tce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Sce:Nce;x4.useSyncExternalStore=ou.useSyncExternalStore!==void 0?ou.useSyncExternalStore:Tce;E4.exports=x4;var Ace=E4.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 D0=E,Cce=Ace;function Ice(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rce=typeof Object.is=="function"?Object.is:Ice,Oce=Cce.useSyncExternalStore,Lce=D0.useRef,Mce=D0.useEffect,jce=D0.useMemo,Dce=D0.useDebugValue;b4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Lce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=jce(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,Rce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=Oce(e,i[0],i[1]);return Mce(function(){a.hasValue=!0,a.value=l},[l]),Dce(l),l};y4.exports=b4;var Pce=y4.exports;const Bce=Kf(Pce),Fce={},zA=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:()=>{(Fce?"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},Uce=e=>e?zA(e):zA,{useDebugValue:$ce}=kt,{useSyncExternalStoreWithSelector:Hce}=Bce,zce=e=>e;function w4(e,t=zce,n){const r=Hce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $ce(r),r}const VA=(e,t)=>{const n=Uce(e),r=(s,i=t)=>w4(n,s,i);return Object.assign(r,n),r},Vce=(e,t)=>e?VA(e,t):VA;function _n(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 P0=E.createContext(null),Kce=P0.Provider,v4=Ei.error001("react");function Ot(e,t){const n=E.useContext(P0);if(n===null)throw new Error(v4);return w4(n,e,t)}function kn(){const e=E.useContext(P0);if(e===null)throw new Error(v4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const KA={display:"none"},Yce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_4="react-flow__node-desc",k4="react-flow__edge-desc",Wce="react-flow__aria-live",Gce=e=>e.ariaLiveMessage,qce=e=>e.ariaLabelConfig;function Xce({rfId:e}){const t=Ot(Gce);return o.jsx("div",{id:`${Wce}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Yce,children:t})}function Qce({rfId:e,disableKeyboardA11y:t}){const n=Ot(qce);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${_4}-${e}`,style:KA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${k4}-${e}`,style:KA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Xce,{rfId:e})]})}const B0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:tr(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});B0.displayName="Panel";function Zce({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(B0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Jce=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}},Cp=e=>e.id;function eue(e,t){return _n(e.selectedNodes.map(Cp),t.selectedNodes.map(Cp))&&_n(e.selectedEdges.map(Cp),t.selectedEdges.map(Cp))}function tue({onSelectionChange:e}){const t=kn(),{selectedNodes:n,selectedEdges:r}=Ot(Jce,eue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const nue=e=>!!e.onSelectionChangeHandlers;function rue({onSelectionChange:e}){const t=Ot(nue);return e||t?o.jsx(tue,{onSelectionChange:e}):null}const N4=[0,0],sue={x:0,y:0,zoom:1},iue=["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"],YA=[...iue,"rfId"],aue=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}),WA={translateExtent:Pf,nodeOrigin:N4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function oue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Ot(aue,_n),u=kn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=WA,l()}),[]);const d=E.useRef(WA);return E.useEffect(()=>{for(const f of YA){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:Rle(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},YA.map(f=>e[f])),null}function GA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lue(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=GA(),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=GA())!=null&&r.matches?"dark":"light"}const qA=typeof document<"u"?document:null;function $f(e=null,t={target:qA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.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 E.useEffect(()=>{const c=(t==null?void 0:t.target)??qA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&e4(p))return!1;const g=QA(p.code,l);if(i.current.add(p[g]),XA(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=QA(p.code,l);XA(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 XA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function QA(e,t){return t.includes(e)?"code":"key"}const cue=()=>{const e=kn();return E.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:l}=e.getState(),c=x_(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return _u(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=iu(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function S4(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 l={...i};for(const c of a)uue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function uue(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 T4(e,t){return S4(e,t)}function A4(e,t){return S4(e,t)}function Oo(e,t){return{id:e,type:"select",selected:t}}function fc(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(Oo(i.id,a)))}return r}function ZA({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 JA(e){return{id:e.id,type:"remove"}}const due=QP();function C4(e,t,n={}){return Ple(e,t,{...n,onError:n.onError??due})}const eC=e=>vle(e),fue=e=>WP(e);function I4(e){return E.forwardRef(e)}const hue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function tC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>pue(()=>n(s=>s+BigInt(1))));return hue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function pue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const R4=E.createContext(null);function mue({children:e}){const t=kn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=ZA({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=tC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(ZA({items:p,lookup:h}))},[]),i=tC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(R4.Provider,{value:a,children:e})}function gue(){const e=E.useContext(R4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const yue=e=>!!e.panZoom;function F0(){const e=cue(),t=kn(),n=gue(),r=Ot(yue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=eC(f)?f:h.get(f.id),g=m.parentId?ZP(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return su(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&eC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&fue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Tle({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),A=N.length>0,S=k.length>0;if(A){const R=N.map(JA);w==null||w(N),b(R)}if(S){const R=k.map(JA);g==null||g(k),y(R)}return(S||A)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=IA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=su(w?y:b),_=Ff(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=IA(f)?f:c(f);if(!g)return!1;const w=Ff(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return _le(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??Ile();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const nC=e=>e.selected,bue=typeof window<"u"?window:void 0;function Eue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=kn(),{deleteElements:r}=F0(),s=$f(e,{actInsideInputWithModifier:!1}),i=$f(t,{target:bue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(nC),edges:a.filter(nC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function xue(e){const t=kn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=v_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Ei.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 U0={position:"absolute",width:"100%",height:"100%",top:0,left:0},wue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Jo.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=kn(),N=E.useRef(null),{userSelectionActive:A,lib:S,connectionInProgress:R}=Ot(wue,_n),I=$f(h),D=E.useRef();xue(N);const F=E.useCallback(W=>{y==null||y({x:W[0],y:W[1],zoom:W[2]}),b||k.setState({transform:W})},[y,b]);return E.useEffect(()=>{if(N.current){D.current=hce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(M=>M.paneDragging===C?M:{paneDragging:C}),onPanZoomStart:(C,M)=>{const{onViewportChangeStart:O,onMoveStart:j}=k.getState();j==null||j(C,M),O==null||O(M)},onPanZoom:(C,M)=>{const{onViewportChange:O,onMove:j}=k.getState();j==null||j(C,M),O==null||O(M)},onPanZoomEnd:(C,M)=>{const{onViewportChangeEnd:O,onMoveEnd:j}=k.getState();j==null||j(C,M),O==null||O(M)}});const{x:W,y:L,zoom:U}=D.current.getViewport();return k.setState({panZoom:D.current,transform:[W,L,U],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=D.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var W;(W=D.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:A,noWheelClassName:g,lib:S,onTransformChange:F,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,A,g,S,F,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:U0,children:m})}const _ue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kue(){const{userSelectionActive:e,userSelectionRect:t}=Ot(_ue,_n);return e&&t?o.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 Ob=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Nue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Sue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Bf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=kn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:A}=Ot(Nue,_n),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),D=E.useRef(new Set),F=E.useRef(new Set),W=E.useRef(!1),L=E.useRef({x:0,y:0}),U=E.useRef(!1),C=Z=>{if(W.current||k){W.current=!1;return}u==null||u(Z),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},M=Z=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){Z.preventDefault();return}d==null||d(Z)},O=f?Z=>f(Z):void 0,j=Z=>{W.current&&(Z.stopPropagation(),W.current=!1)},T=Z=>{var Ke,Oe;const{domNode:pe,transform:J}=y.getState();if(I.current=pe==null?void 0:pe.getBoundingClientRect(),!I.current)return;const be=Z.target===R.current;if(!be&&!!Z.target.closest(".nokey")||!e||!(a&&be||t)||Z.button!==0||!Z.isPrimary)return;(Oe=(Ke=Z.target)==null?void 0:Ke.setPointerCapture)==null||Oe.call(Ke,Z.pointerId),W.current=!1;const{x:ve,y:Te}=di(Z.nativeEvent,I.current),Re=_u({x:ve,y:Te},J);y.setState({userSelectionRect:{width:0,height:0,startX:Re.x,startY:Re.y,x:ve,y:Te}}),be||(Z.stopPropagation(),Z.preventDefault())};function z(Z,pe){const{userSelectionRect:J}=y.getState();if(!J)return;const{transform:be,nodeLookup:ye,edgeLookup:we,connectionLookup:ve,triggerNodeChanges:Te,triggerEdgeChanges:Re,defaultEdgeOptions:Ke}=y.getState(),Oe={x:J.startX,y:J.startY},{x:mt,y:Xe}=iu(Oe,be),Ye={startX:Oe.x,startY:Oe.y,x:Zct.id)),F.current=new Set;const st=(Ke==null?void 0:Ke.selectable)??!0;for(const ct of D.current){const q=ve.get(ct);if(q)for(const{edgeId:ee}of q.values()){const ge=we.get(ee);ge&&(ge.selectable??st)&&F.current.add(ee)}}if(!RA(ce,D.current)){const ct=fc(ye,D.current,!0);Te(ct)}if(!RA(Se,F.current)){const ct=fc(we,F.current);Re(ct)}y.setState({userSelectionRect:Ye,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!s||!I.current)return;const[Z,pe]=E_(L.current,I.current,A);N({x:Z,y:pe}).then(J=>{if(!W.current||!J){w.current=requestAnimationFrame(G);return}const{x:be,y:ye}=L.current;z(be,ye),w.current=requestAnimationFrame(G)})}const P=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};E.useEffect(()=>()=>P(),[]);const se=Z=>{const{userSelectionRect:pe,transform:J,resetSelectedElements:be}=y.getState();if(!I.current||!pe)return;const{x:ye,y:we}=di(Z.nativeEvent,I.current);L.current={x:ye,y:we};const ve=iu({x:pe.startX,y:pe.startY},J);if(!W.current){const Te=t?0:i;if(Math.hypot(ye-ve.x,we-ve.y)<=Te)return;be(),l==null||l(Z)}W.current=!0,U.current||(G(),U.current=!0),z(ye,we)},Q=Z=>{var pe,J;Z.button===0&&((J=(pe=Z.target)==null?void 0:pe.releasePointerCapture)==null||J.call(pe,Z.pointerId),!b&&Z.target===R.current&&y.getState().userSelectionRect&&(C==null||C(Z)),y.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(c==null||c(Z),y.setState({nodesSelectionActive:D.current.size>0})),P())},ne=Z=>{var pe,J;(J=(pe=Z.target)==null?void 0:pe.releasePointerCapture)==null||J.call(pe,Z.pointerId),P()},fe=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:tr(["react-flow__pane",{draggable:fe,dragging:_,selection:e}]),onClick:S?void 0:Ob(C,R),onContextMenu:Ob(M,R),onWheel:Ob(O,R),onPointerEnter:S?void 0:h,onPointerMove:S?se:p,onPointerUp:S?Q:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?T:void 0,onClickCapture:S?j:void 0,onPointerLeave:m,ref:R,style:U0,children:[g,o.jsx(kue,{})]})}function Ex({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Ei.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 O4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=kn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=Jle({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Ex({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 Tue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function L4(){const e=kn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Tue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=yh(b,i));const{position:x,positionAbsolute:_}=GP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const A_=E.createContext(null),Aue=A_.Provider;A_.Consumer;const M4=()=>E.useContext(A_),Cue=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Iue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===tu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Rue({type:e="source",position:t=Ve.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,g=e==="target",w=kn(),y=M4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Ot(Cue,_n),{connectingFrom:k,connectingTo:N,clickConnecting:A,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:D}=Ot(Iue(y,m,e),_n);y||(C=(U=w.getState()).onError)==null||C.call(U,"010",Ei.error010());const F=M=>{const{defaultEdgeOptions:O,onConnect:j,hasDefaultEdges:T}=w.getState(),z={...O,...M};if(T){const{edges:G,setEdges:P,onError:se}=w.getState();P(C4(z,G,{onError:se}))}j==null||j(z),l==null||l(z)},W=M=>{if(!y)return;const O=t4(M.nativeEvent);if(s&&(O&&M.button===0||!O)){const j=w.getState();bx.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:g,handleId:m,nodeId:y,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...T)=>{var z,G;return(G=(z=w.getState()).onConnectEnd)==null?void 0:G.call(z,...T)},updateConnection:j.updateConnection,onConnect:F,isValidConnection:n||((...T)=>{var z,G;return((G=(z=w.getState()).isValidConnection)==null?void 0:G.call(z,...T))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}O?d==null||d(M):f==null||f(M)},L=M=>{const{onClickConnectStart:O,onClickConnectEnd:j,connectionClickStartHandle:T,connectionMode:z,isValidConnection:G,lib:P,rfId:se,nodeLookup:Q,connection:ne}=w.getState();if(!y||!T&&!s)return;if(!T){O==null||O(M.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const fe=JP(M.target),Z=n||G,{connection:pe,isValid:J}=bx.isValid(M.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:z,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:Z,flowId:se,doc:fe,lib:P,nodeLookup:Q});J&&pe&&F(pe);const be=structuredClone(ne);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,j==null||j(M,be),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:tr(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:A,connectingfrom:k,connectingto:N,valid:D,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:W,onTouchStart:W,onClick:b?L:void 0,ref:p,...h,children:c})}const Nr=E.memo(I4(Rue));function Oue({data:e,isConnectable:t,sourcePosition:n=Ve.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Nr,{type:"source",position:n,isConnectable:t})]})}function Lue({data:e,isConnectable:t,targetPosition:n=Ve.Top,sourcePosition:r=Ve.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Nr,{type:"source",position:r,isConnectable:t})]})}function Mue(){return null}function jue({data:e,isConnectable:t,targetPosition:n=Ve.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const kg={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rC={input:Oue,default:Lue,output:jue,group:Mue};function Due(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 Pue=e=>{const{width:t,height:n,x:r,y:s}=gh(e.nodeLookup,{filter:i=>!!i.selected});return{width:ui(t)?t:null,height:ui(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 Bue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=kn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Ot(Pue,_n),c=L4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(O4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(kg,p.key)&&(p.preventDefault(),c({direction:kg[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:tr(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 sC=typeof window<"u"?window:void 0,Fue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function j4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:A,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,preventScrolling:L,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:T}){const{nodesSelectionActive:z,userSelectionActive:G}=Ot(Fue,_n),P=$f(u,{target:sC}),se=$f(g,{target:sC}),Q=se||S,ne=se||_,fe=d&&Q!==!0,Z=P||G||fe;return Eue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(vue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:ne,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:A,panOnDrag:!P&&Q,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,zoomActivationKeyCode:w,preventScrolling:L,noWheelClassName:C,noPanClassName:M,onViewportChange:j,isControlledViewport:T,paneClickDistance:l,selectionOnDrag:fe,children:o.jsxs(Sue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:R,isSelecting:!!Z,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:fe,children:[e,z&&o.jsx(Bue,{onSelectionContextMenu:U,noPanClassName:M,disableKeyboardA11y:O})]})})}j4.displayName="FlowRenderer";const Uue=E.memo(j4),$ue=e=>t=>e?b_(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 Hue(e){return Ot(E.useCallback($ue(e),[e]),_n)}const zue=e=>e.updateNodeInternals;function Vue(){const e=Ot(zue),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Kue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=kn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 Yue({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Ot(Z=>{const pe=Z.nodeLookup.get(e),J=Z.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:J}},_n);let N=x.type||"default",A=(w==null?void 0:w[N])||rC[N];A===void 0&&(b==null||b("003",Ei.error003(N)),N="default",A=(w==null?void 0:w.default)||rC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),D=!!(x.focusable||d&&typeof x.focusable>"u"),F=kn(),W=w_(x),L=Kue({node:x,nodeType:N,hasDimensions:W,resizeObserver:f}),U=O4({nodeRef:L,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=L4();if(x.hidden)return null;const M=Ea(x),O=Due(x),j=R||S||t||n||r||s,T=n?Z=>n(Z,{..._.userNode}):void 0,z=r?Z=>r(Z,{..._.userNode}):void 0,G=s?Z=>s(Z,{..._.userNode}):void 0,P=i?Z=>i(Z,{..._.userNode}):void 0,se=a?Z=>a(Z,{..._.userNode}):void 0,Q=Z=>{const{selectNodesOnDrag:pe,nodeDragThreshold:J}=F.getState();R&&(!pe||!S||J>0)&&Ex({id:e,store:F,nodeRef:L}),t&&t(Z,{..._.userNode})},ne=Z=>{if(!(e4(Z.nativeEvent)||m)){if(zP.includes(Z.key)&&R){const pe=Z.key==="Escape";Ex({id:e,store:F,unselect:pe,nodeRef:L})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(kg,Z.key)){Z.preventDefault();const{ariaLabelConfig:pe}=F.getState();F.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:Z.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:kg[Z.key],factor:Z.shiftKey?4:1})}}},fe=()=>{var ve;if(m||!((ve=L.current)!=null&&ve.matches(":focus-visible")))return;const{transform:Z,width:pe,height:J,autoPanOnNodeFocus:be,setCenter:ye}=F.getState();if(!be)return;b_(new Map([[e,x]]),{x:0,y:0,width:pe,height:J},Z,!0).length>0||ye(x.position.x+M.width/2,x.position.y+M.height/2,{zoom:Z[2]})};return o.jsx("div",{className:tr(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:U}]),ref:L,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:W?"visible":"hidden",...x.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:z,onMouseLeave:G,onContextMenu:P,onClick:Q,onDoubleClick:se,onKeyDown:D?ne:void 0,tabIndex:D?0:void 0,onFocus:D?fe:void 0,role:x.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${_4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(Aue,{value:e,children:o.jsx(A,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:U,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...M})})})}var Wue=E.memo(Yue);const Gue=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function D4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Ot(Gue,_n),a=Hue(e.onlyRenderVisibleElements),l=Vue();return o.jsx("div",{className:"react-flow__nodes",style:U0,children:a.map(c=>o.jsx(Wue,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}D4.displayName="NodeRenderer";const que=E.memo(D4);function Xue(e){return Ot(E.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&&Mle({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),_n)}const Que=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Zue=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},iC={[nu.Arrow]:Que,[nu.ArrowClosed]:Zue};function Jue(e){const t=kn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(iC,e)?iC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",Ei.error009(e)),null)},[e])}const ede=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Jue(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},P4=({defaultColor:e,rfId:t})=>{const n=Ot(i=>i.edges),r=Ot(i=>i.defaultEdgeOptions),s=E.useMemo(()=>Hle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(ede,{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};P4.displayName="MarkerDefinitions";var tde=E.memo(P4);function B4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=tr(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}B4.displayName="EdgeText";const nde=E.memo(B4);function bh({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:tr(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ui(t)&&ui(n)?o.jsx(nde,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function aC({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ve.Left||e===Ve.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function F4({sourceX:e,sourceY:t,sourcePosition:n=Ve.Bottom,targetX:r,targetY:s,targetPosition:i=Ve.Top}){const[a,l]=aC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=aC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=n4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function U4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=F4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(bh,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const rde=U4({isInternal:!1}),$4=U4({isInternal:!0});rde.displayName="SimpleBezierEdge";$4.displayName="SimpleBezierEdgeInternal";function H4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Ve.Bottom,targetPosition:m=Ve.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=_g({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(bh,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const z4=H4({isInternal:!1}),V4=H4({isInternal:!0});z4.displayName="SmoothStepEdge";V4.displayName="SmoothStepEdgeInternal";function K4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(z4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const sde=K4({isInternal:!1}),Y4=K4({isInternal:!0});sde.displayName="StepEdge";Y4.displayName="StepEdgeInternal";function W4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=i4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(bh,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const ide=W4({isInternal:!1}),G4=W4({isInternal:!0});ide.displayName="StraightEdge";G4.displayName="StraightEdgeInternal";function q4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Ve.Bottom,targetPosition:l=Ve.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=r4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(bh,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const ade=q4({isInternal:!1}),X4=q4({isInternal:!0});ade.displayName="BezierEdge";X4.displayName="BezierEdgeInternal";const oC={default:X4,straight:G4,step:Y4,smoothstep:V4,simplebezier:$4},lC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ode=(e,t,n)=>n===Ve.Left?e-t:n===Ve.Right?e+t:e,lde=(e,t,n)=>n===Ve.Top?e-t:n===Ve.Bottom?e+t:e,cC="react-flow__edgeupdater";function uC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:tr([cC,`${cC}-${l}`]),cx:ode(t,r,e),cy:lde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function cde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=kn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:A,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:D,cancelConnection:F,nodeLookup:W,rfId:L,panBy:U,updateConnection:C}=m.getState(),M=k.type==="target",O=(z,G)=>{h(!1),f==null||f(z,n,k.type,G)},j=z=>u==null?void 0:u(n,z),T=(z,G)=>{h(!0),d==null||d(_,n,k.type),D==null||D(z,G)};bx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:A,handleId:k.id,nodeId:k.nodeId,nodeLookup:W,isTarget:M,edgeUpdaterType:k.type,lib:I,flowId:L,cancelConnection:F,panBy:U,isValidConnection:(...z)=>{var G,P;return((P=(G=m.getState()).isValidConnection)==null?void 0:P.call(G,...z))??!0},onConnect:j,onConnectStart:T,onConnectEnd:(...z)=>{var G,P;return(P=(G=m.getState()).onConnectEnd)==null?void 0:P.call(G,...z)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(uC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(uC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function ude({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Ot(ye=>ye.edgeLookup.get(e));const _=Ot(ye=>ye.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||oC[k];N===void 0&&(y==null||y("011",Ei.error011(k)),k="default",N=(g==null?void 0:g.default)||oC.default);const A=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[D,F]=E.useState(!1),[W,L]=E.useState(!1),U=kn(),{zIndex:C,sourceX:M,sourceY:O,targetX:j,targetY:T,sourcePosition:z,targetPosition:G}=Ot(E.useCallback(ye=>{const we=ye.nodeLookup.get(x.source),ve=ye.nodeLookup.get(x.target);if(!we||!ve)return{zIndex:x.zIndex,...lC};const Te=$le({id:e,sourceNode:we,targetNode:ve,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ye.connectionMode,onError:y});return{zIndex:Lle({selected:x.selected,zIndex:x.zIndex,sourceNode:we,targetNode:ve,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...Te||lC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),_n),P=E.useMemo(()=>x.markerStart?`url('#${gx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),se=E.useMemo(()=>x.markerEnd?`url('#${gx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||M===null||O===null||j===null||T===null)return null;const Q=ye=>{var Re;const{addSelectedEdges:we,unselectNodesAndEdges:ve,multiSelectionActive:Te}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),x.selected&&Te?(ve({nodes:[],edges:[x]}),(Re=I.current)==null||Re.blur()):we([e])),s&&s(ye,x)},ne=i?ye=>{i(ye,{...x})}:void 0,fe=a?ye=>{a(ye,{...x})}:void 0,Z=l?ye=>{l(ye,{...x})}:void 0,pe=c?ye=>{c(ye,{...x})}:void 0,J=u?ye=>{u(ye,{...x})}:void 0,be=ye=>{var we;if(!b&&zP.includes(ye.key)&&R){const{unselectNodesAndEdges:ve,addSelectedEdges:Te}=U.getState();ye.key==="Escape"?((we=I.current)==null||we.blur(),ve({edges:[x]})):Te([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:tr(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:D,selectable:R}]),onClick:Q,onDoubleClick:ne,onContextMenu:fe,onMouseEnter:Z,onMouseMove:pe,onMouseLeave:J,onKeyDown:A?be:void 0,tabIndex:A?0:void 0,role:x.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":A?`${k4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!W&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:M,sourceY:O,targetX:j,targetY:T,sourcePosition:z,targetPosition:G,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:P,markerEnd:se,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(cde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:M,sourceY:O,targetX:j,targetY:T,sourcePosition:z,targetPosition:G,setUpdateHover:F,setReconnecting:L})]})})}var dde=E.memo(ude);const fde=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Q4({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Ot(fde,_n),_=Xue(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(tde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(dde,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}Q4.displayName="EdgeRenderer";const hde=E.memo(Q4),pde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function mde({children:e}){const t=Ot(pde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function gde(e){const t=F0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const yde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function bde(e){const t=Ot(yde),n=kn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Ede(e){return e.connection.inProgress?{...e.connection,to:_u(e.connection.to,e.transform)}:{...e.connection}}function xde(e){return Ede}function wde(e){const t=xde();return Ot(t,_n)}const vde=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _de({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Ot(vde,_n);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:tr(["react-flow__connection",YP(l)]),children:o.jsx(Z4,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Z4=({style:e,type:t=za.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=wde();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:YP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case za.Bezier:[m]=r4(g);break;case za.SimpleBezier:[m]=F4(g);break;case za.Step:[m]=_g({...g,borderRadius:0});break;case za.SmoothStep:[m]=_g(g);break;default:[m]=i4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Z4.displayName="ConnectionLine";const kde={};function dC(e=kde){E.useRef(e),kn(),E.useEffect(()=>{},[e])}function Nde(){kn(),E.useRef(!1),E.useEffect(()=>{},[])}function J4({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:A,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:L,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:z,zoomOnDoubleClick:G,panOnDrag:P,autoPanOnSelection:se,onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:fe,onPaneMouseLeave:Z,onPaneScroll:pe,onPaneContextMenu:J,paneClickDistance:be,nodeClickDistance:ye,onEdgeContextMenu:we,onEdgeMouseEnter:ve,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ke,onReconnect:Oe,onReconnectStart:mt,onReconnectEnd:Xe,noDragClassName:Ye,noWheelClassName:ce,noPanClassName:Se,disableKeyboardA11y:st,nodeExtent:ct,rfId:q,viewport:ee,onViewportChange:ge}){return dC(e),dC(t),Nde(),gde(n),bde(ee),o.jsx(Uue,{onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:fe,onPaneMouseLeave:Z,onPaneContextMenu:J,onPaneScroll:pe,paneClickDistance:be,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:M,zoomOnPinch:O,zoomOnDoubleClick:G,panOnScroll:j,panOnScrollSpeed:T,panOnScrollMode:z,panOnDrag:P,autoPanOnSelection:se,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:L,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:Ye,noWheelClassName:ce,noPanClassName:Se,disableKeyboardA11y:st,onViewportChange:ge,isControlledViewport:!!ee,children:o.jsxs(mde,{children:[o.jsx(hde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Oe,onReconnectStart:mt,onReconnectEnd:Xe,onlyRenderVisibleElements:R,onEdgeContextMenu:we,onEdgeMouseEnter:ve,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ke,defaultMarkerColor:C,noPanClassName:Se,disableKeyboardA11y:st,rfId:q}),o.jsx(_de,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(que,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ye,onlyRenderVisibleElements:R,noPanClassName:Se,noDragClassName:Ye,disableKeyboardA11y:st,nodeExtent:ct,rfId:q}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}J4.displayName="GraphView";const Sde=E.memo(J4),Tde=QP(),fC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Pf;l4(g,w,y);const{nodesInitialized:k}=yx(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const A=gh(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:R,zoom:I}=x_(A,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Pf,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...KP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Tde,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:VP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ade=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Vce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:A}=m();y&&(await Sle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:A},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...fC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:A}=m(),{nodesInitialized:S,hasSelectedNodes:R}=yx(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=A&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();l4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:A,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:D}=qle(w,b,x,_,k,N,R);D&&(Kle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:A,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const D=_.get(R),F=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(I!=null&&I.position)),W={id:R,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(D&&N.inProgress&&N.fromNode.id===D.id){const L=hl(D,N.fromHandle,Ve.Left,!0);A({...N,from:L})}F&&D.parentId&&b.push({id:R,parentId:D.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(W)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),D=T_(b,_,R,I);x.push(...D)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=T4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=A4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(A=>Oo(A,!0));_(N);return}_(fc(x,new Set([...w]),!0)),k(fc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(A=>Oo(A,!0));k(N);return}k(fc(b,new Set([...w]))),_(fc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),A=w||x,S=y||b,R=[];for(const D of A){if(!D.selected)continue;const F=_.get(D.id);F&&(F.selected=!1),R.push(Oo(D.id,!1))}const I=[];for(const D of S)D.selected&&I.push(Oo(D.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((A,S)=>S.selected?[...A,Oo(S.id,!1)]:A,[]),N=w.reduce((A,S)=>S.selected?[...A,Oo(S.id,!1)]:A,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:A}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(yx(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:A}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return Xle({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const A=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*A,y:_/2-y*A,zoom:A},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...KP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...fC()})}},Object.is);function C_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>Ade({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Kce,{value:m,children:o.jsx(mue,{children:p})})}function Cde({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(P0)?o.jsx(o.Fragment,{children:e}):o.jsx(C_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Ide={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Rde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onSelectionChange:W,onSelectionDragStart:L,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:j,onBeforeDelete:T,connectionMode:z,connectionLineType:G=za.Bezier,connectionLineStyle:P,connectionLineComponent:se,connectionLineContainerStyle:Q,deleteKeyCode:ne="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:Z=!1,selectionMode:pe=Bf.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:be=Uf()?"Meta":"Control",zoomActivationKeyCode:ye=Uf()?"Meta":"Control",snapToGrid:we,snapGrid:ve,onlyRenderVisibleElements:Te=!1,selectNodesOnDrag:Re,nodesDraggable:Ke,autoPanOnNodeFocus:Oe,nodesConnectable:mt,nodesFocusable:Xe,nodeOrigin:Ye=N4,edgesFocusable:ce,edgesReconnectable:Se,elementsSelectable:st=!0,defaultViewport:ct=sue,minZoom:q=.5,maxZoom:ee=2,translateExtent:ge=Pf,preventScrolling:Pe=!0,nodeExtent:Ge,defaultMarkerColor:et="#b1b1b7",zoomOnScroll:$t=!0,zoomOnPinch:bt=!0,panOnScroll:Vt=!1,panOnScrollSpeed:Wt=.5,panOnScrollMode:St=Jo.Free,zoomOnDoubleClick:Pt=!0,panOnDrag:je=!0,onPaneClick:gt,onPaneMouseEnter:tt,onPaneMouseMove:Ae,onPaneMouseLeave:Ht,onPaneScroll:Bt,onPaneContextMenu:oe,paneClickDistance:ze=1,nodeClickDistance:dt=0,children:Fn,onReconnect:cn,onReconnectStart:Xt,onReconnectEnd:Qt,onEdgeContextMenu:un,onEdgeDoubleClick:dn,onEdgeMouseEnter:Gn,onEdgeMouseMove:qn,onEdgeMouseLeave:Rt,reconnectRadius:Kt=10,onNodesChange:de,onEdgesChange:ke,noDragClassName:Ie="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ft="nopan",fitView:nt,fitViewOptions:ie,connectOnClick:Ze,attributionPosition:ot,proOptions:xe,defaultEdgeOptions:ht,elevateNodesOnSelect:Je=!0,elevateEdgesOnSelect:lt=!1,disableKeyboardA11y:_t=!1,autoPanOnConnect:Gt,autoPanOnNodeDrag:bn,autoPanOnSelection:En=!0,autoPanSpeed:tn,connectionRadius:Nn,isValidConnection:Et,onError:Sn,style:On,id:Mt,nodeDragThreshold:Ln,connectionDragThreshold:Hr,viewport:Mn,onViewportChange:fn,width:fr,height:Cr,colorMode:Ys="light",debug:ss,onScroll:ir,ariaLabelConfig:Ir,zIndexMode:_i="basic",...xa},bo){const zr=Mt||"1",Ki=lue(Ys),wa=E.useCallback(ki=>{ki.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ir==null||ir(ki)},[ir]);return o.jsx("div",{"data-testid":"rf__wrapper",...xa,onScroll:wa,style:{...On,...Ide},ref:bo,className:tr(["react-flow",s,Ki]),id:Mt,role:"application",children:o.jsxs(Cde,{nodes:e,edges:t,width:fr,height:Cr,fitView:nt,fitViewOptions:ie,minZoom:q,maxZoom:ee,nodeOrigin:Ye,nodeExtent:Ge,zIndexMode:_i,children:[o.jsx(oue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:Ke,autoPanOnNodeFocus:Oe,nodesConnectable:mt,nodesFocusable:Xe,edgesFocusable:ce,edgesReconnectable:Se,elementsSelectable:st,elevateNodesOnSelect:Je,elevateEdgesOnSelect:lt,minZoom:q,maxZoom:ee,nodeExtent:Ge,onNodesChange:de,onEdgesChange:ke,snapToGrid:we,snapGrid:ve,connectionMode:z,translateExtent:ge,connectOnClick:Ze,defaultEdgeOptions:ht,fitView:nt,fitViewOptions:ie,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ft,nodeOrigin:Ye,rfId:zr,autoPanOnConnect:Gt,autoPanOnNodeDrag:bn,autoPanSpeed:tn,onError:Sn,connectionRadius:Nn,isValidConnection:Et,selectNodesOnDrag:Re,nodeDragThreshold:Ln,connectionDragThreshold:Hr,onBeforeDelete:T,debug:ss,ariaLabelConfig:Ir,zIndexMode:_i}),o.jsx(Sde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:G,connectionLineStyle:P,connectionLineComponent:se,connectionLineContainerStyle:Q,selectionKeyCode:fe,selectionOnDrag:Z,selectionMode:pe,deleteKeyCode:ne,multiSelectionKeyCode:be,panActivationKeyCode:J,zoomActivationKeyCode:ye,onlyRenderVisibleElements:Te,defaultViewport:ct,translateExtent:ge,minZoom:q,maxZoom:ee,preventScrolling:Pe,zoomOnScroll:$t,zoomOnPinch:bt,zoomOnDoubleClick:Pt,panOnScroll:Vt,panOnScrollSpeed:Wt,panOnScrollMode:St,panOnDrag:je,autoPanOnSelection:En,onPaneClick:gt,onPaneMouseEnter:tt,onPaneMouseMove:Ae,onPaneMouseLeave:Ht,onPaneScroll:Bt,onPaneContextMenu:oe,paneClickDistance:ze,nodeClickDistance:dt,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:j,onReconnect:cn,onReconnectStart:Xt,onReconnectEnd:Qt,onEdgeContextMenu:un,onEdgeDoubleClick:dn,onEdgeMouseEnter:Gn,onEdgeMouseMove:qn,onEdgeMouseLeave:Rt,reconnectRadius:Kt,defaultMarkerColor:et,noDragClassName:Ie,noWheelClassName:Qe,noPanClassName:ft,rfId:zr,disableKeyboardA11y:_t,nodeExtent:Ge,viewport:Mn,onViewportChange:fn}),o.jsx(rue,{onSelectionChange:W}),Fn,o.jsx(Zce,{proOptions:xe,position:ot}),o.jsx(Qce,{rfId:zr,disableKeyboardA11y:_t})]})})}var e6=I4(Rde);const Ode=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Lde({children:e}){const t=Ot(Ode);return t?$s.createPortal(e,t):null}function t6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>T4(s,i)),[]);return[t,n,r]}function n6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>A4(s,i)),[]);return[t,n,r]}const Mde=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||!w_(n.userNode))return!1;return!0};function jde(e={includeHiddenNodes:!1}){return Ot(Mde(e))}function Dde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:tr(["react-flow__background-pattern",n,r])})}function Pde({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:tr(["react-flow__background-pattern","dots",t])})}var so;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(so||(so={}));const Bde={[so.Dots]:1,[so.Lines]:1,[so.Cross]:6},Fde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function r6({id:e,variant:t=so.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Ot(Fde,_n),m=r||Bde[t],g=t===so.Dots,w=t===so.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],A=`${p}${e||""}`;return o.jsxs("svg",{className:tr(["react-flow__background",u]),style:{...c,...U0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:A,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Pde,{radius:x/2,className:d}):o.jsx(Dde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}r6.displayName="Background";const s6=E.memo(r6);function Ude(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $de(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Hde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 zde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Vde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Ip({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:tr(["react-flow__controls-button",t]),...n,children:e})}const Kde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function i6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=kn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Ot(Kde,_n),{zoomIn:x,zoomOut:_,fitView:k}=F0(),N=()=>{x(),i==null||i()},A=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs(B0,{className:tr(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Ip,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Ude,{})}),o.jsx(Ip,{onClick:A,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx($de,{})})]}),n&&o.jsx(Ip,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(Hde,{})}),r&&o.jsx(Ip,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Vde,{}):o.jsx(zde,{})}),d]})}i6.displayName="Controls";const a6=E.memo(i6);function Yde({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:tr(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Wde=E.memo(Yde),Gde=e=>e.nodes.map(t=>t.id),Lb=e=>e instanceof Function?e:()=>e;function qde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=Wde,onClick:a}){const l=Ot(Gde,_n),c=Lb(t),u=Lb(e),d=Lb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(Qde,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Xde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Ot(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=Ea(w);return{node:w,x:y,y:b,width:x,height:_}},_n);return!u||u.hidden||!w_(u)?null:o.jsx(l,{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 Qde=E.memo(Xde);var Zde=E.memo(qde);const Jde=200,efe=150,tfe=e=>!e.hidden,nfe=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?XP(gh(e.nodeLookup,{filter:tfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},rfe="react-flow__minimap-desc";function o6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=kn(),N=E.useRef(null),{boundingRect:A,viewBB:S,rfId:R,panZoom:I,translateExtent:D,flowWidth:F,flowHeight:W,ariaLabelConfig:L}=Ot(nfe,_n),U=(e==null?void 0:e.width)??Jde,C=(e==null?void 0:e.height)??efe,M=A.width/U,O=A.height/C,j=Math.max(M,O),T=j*U,z=j*C,G=_*j,P=A.x-(T-A.width)/2-G,se=A.y-(z-A.height)/2-G,Q=T+G*2,ne=z+G*2,fe=`${rfe}-${R}`,Z=E.useRef(0),pe=E.useRef();Z.current=j,E.useEffect(()=>{if(N.current&&I)return pe.current=ice({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>Z.current}),()=>{var we;(we=pe.current)==null||we.destroy()}},[I]),E.useEffect(()=>{var we;(we=pe.current)==null||we.update({translateExtent:D,width:F,height:W,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,D,F,W]);const J=p?we=>{var Re;const[ve,Te]=((Re=pe.current)==null?void 0:Re.pointer(we))||[0,0];p(we,{x:ve,y:Te})}:void 0,be=m?E.useCallback((we,ve)=>{const Te=k.getState().nodeLookup.get(ve).internals.userNode;m(we,Te)},[]):void 0,ye=y??L["minimap.ariaLabel"];return o.jsx(B0,{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*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:tr(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:U,height:C,viewBox:`${P} ${se} ${Q} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:N,onClick:J,children:[ye&&o.jsx("title",{id:fe,children:ye}),o.jsx(Zde,{onClick:be,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-G},${se-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"})]})})}o6.displayName="MiniMap";const sfe=E.memo(o6),ife=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,afe={[au.Line]:"right",[au.Handle]:"bottom-right"};function ofe({nodeId:e,position:t,variant:n=au.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=M4(),x=typeof e=="string"?e:b,_=kn(),k=E.useRef(null),N=n===au.Handle,A=Ot(E.useCallback(ife(N&&p),[N,p]),_n),S=E.useRef(null),R=t??afe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=bce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:L,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:L,nodeOrigin:U,paneDomNode:C}},onChange:(D,F)=>{const{triggerNodeChanges:W,nodeLookup:L,parentLookup:U,nodeOrigin:C}=_.getState(),M=[],O={x:D.x,y:D.y},j=L.get(x);if(j&&j.expandParent&&j.parentId){const T=j.origin??C,z=D.width??j.measured.width??0,G=D.height??j.measured.height??0,P={id:j.id,parentId:j.parentId,rect:{width:z,height:G,...ZP({x:D.x??j.position.x,y:D.y??j.position.y},{width:z,height:G},j.parentId,L,T)}},se=T_([P],L,U,C);M.push(...se),O.x=D.x?Math.max(T[0]*z,D.x):void 0,O.y=D.y?Math.max(T[1]*G,D.y):void 0}if(O.x!==void 0&&O.y!==void 0){const T={id:x,type:"position",position:{...O}};M.push(T)}if(D.width!==void 0&&D.height!==void 0){const z={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};M.push(z)}for(const T of F){const z={...T,type:"position"};M.push(z)}W(M)},onEnd:({width:D,height:F})=>{const W={id:x,type:"dimensions",resizing:!1,dimensions:{width:D,height:F}};_.getState().triggerNodeChanges([W])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:tr(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:A,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(ofe);var l6=Object.defineProperty,lfe=(e,t,n)=>t in e?l6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cfe=(e,t)=>{for(var n in t)l6(e,n,{get:t[n],enumerable:!0})},ufe=(e,t,n)=>lfe(e,t+"",n),c6={};cfe(c6,{Graph:()=>Ks,alg:()=>I_,json:()=>d6,version:()=>hfe});var dfe=Object.defineProperty,u6=(e,t)=>{for(var n in t)dfe(e,n,{get:t[n],enumerable:!0})},Ks=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=xd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=ffe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,hC(this._preds[i],s),hC(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?Mb(this._isDirected,e):xd(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?Mb(this._isDirected,e):xd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Mb(this._isDirected,e):xd(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],pC(this._preds[a],i),pC(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 hC(e,t){e[t]?e[t]++:e[t]=1}function pC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function xd(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 ffe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function Mb(e,t){return xd(e,t.v,t.w,t.name)}var hfe="4.0.1",d6={};u6(d6,{read:()=>yfe,write:()=>pfe});function pfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:mfe(e),edges:gfe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function mfe(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 gfe(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 yfe(e){let t=new Ks(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 I_={};u6(I_,{CycleException:()=>Sg,bellmanFord:()=>f6,components:()=>xfe,dijkstra:()=>Ng,dijkstraAll:()=>_fe,findCycles:()=>kfe,floydWarshall:()=>Sfe,isAcyclic:()=>Afe,postorder:()=>Ife,preorder:()=>Rfe,prim:()=>Ofe,shortestPaths:()=>Lfe,tarjan:()=>p6,topsort:()=>m6});var bfe=()=>1;function f6(e,t,n,r){return Efe(e,String(t),n||bfe,r||function(s){return e.outEdges(s)})}function Efe(e,t,n,r){let s={},i,a=0,l=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 Ng(e,t,n,r){let s=function(i){return e.outEdges(i)};return vfe(e,String(t),n||wfe,r||s)}function vfe(e,t,n,r){let s={},i=new h6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function _fe(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Ng(e,s,t,n),r},{})}function p6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 kfe(e){return p6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Nfe=()=>1;function Sfe(e,t,n){return Tfe(e,t||Nfe,n||function(r){return e.outEdges(r)})}function Tfe(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=g6(e,l,n==="post",a,i,r,s)}),s}function g6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=g6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function y6(e,t,n){return Cfe(e,t,n,function(r,s){return r.push(s),r},[])}function Ife(e,t){return y6(e,t,"post")}function Rfe(e,t){return y6(e,t,"pre")}function Ofe(e,t){let n=new Ks,r={},s=new h6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function Lfe(e,t,n,r){return Mfe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function Mfe(e,t,n,r){if(n===void 0)return Ng(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 b6(e){let t=new Ks({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 mC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function Eh(e){let t=Hf(x6(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 Dfe(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 Pfe(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 l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function gC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),ku(e,"border",s,t)}function Bfe(e,t=E6){let n=[];for(let r=0;rE6){let n=Bfe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function x6(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 Ffe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function w6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function v6(e,t){return t()}var Ufe=0;function R_(e){let t=++Ufe;return e+(""+t)}function Hf(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 $fe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var H0="\0",Hfe="3.0.0",zfe=class{constructor(){ufe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return yC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&yC(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,Vfe)),n=n._prev;return"["+e.join(", ")+"]"}};function yC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Vfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Kfe=zfe,Yfe=()=>1;function Wfe(e,t){if(e.nodeCount()<=1)return[];let n=qfe(e,t||Yfe);return Gfe(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function Gfe(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)jb(e,t,n,l);for(;l=i.dequeue();)jb(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(jb(e,t,n,l,!0)||[]);break}}}return s}function jb(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,xx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,xx(t,n,d)}),e.removeNode(r.v),a}function qfe(e,t){let n=new Ks,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=Xfe(s+r+3).map(()=>new Kfe),a=r+1;return n.nodes().forEach(l=>{xx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function xx(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 Xfe(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,R_("rev"))});function t(n){return r=>n.edge(r).weight}}function Zfe(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 Jfe(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 ehe(e){e.graph().dummyChains=[],e.edges().forEach(t=>the(e,t))}function the(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 O_(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):[],l=Mi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function lu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var _6=rhe;function rhe(e){let t=new Ks({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(;she(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!lu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function ihe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=lu(t,r)),st.node(r).rank+=n)}var{preorder:ohe,postorder:lhe}=I_,che=vl;vl.initLowLimValues=M_;vl.initCutValues=L_;vl.calcCutValue=k6;vl.leaveEdge=S6;vl.enterEdge=T6;vl.exchangeEdges=A6;function vl(e){e=jfe(e),O_(e);let t=_6(e);M_(t),L_(t,e);let n,r;for(;n=S6(t);)r=T6(t,e,n),A6(t,e,n,r)}function L_(e,t){let n=lhe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>uhe(e,t,r))}function uhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=k6(e,t,n)}function k6(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 l=t.nodeEdges(n);return l&&l.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,fhe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function M_(e,t){arguments.length<2&&(t=e.nodes()[0]),N6(e,{},1,t)}function N6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=N6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function S6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function T6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===bC(e,e.node(u.v),l)&&c!==bC(e,e.node(u.w),l)).reduce((u,d)=>lu(t,d)!e.node(s).parent);if(!n)return;let r=ohe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function fhe(e,t,n){return e.hasEdge(t,n)}function bC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var hhe=phe;function phe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":EC(e);break;case"tight-tree":ghe(e);break;case"longest-path":mhe(e);break;case"none":break;default:EC(e)}}var mhe=O_;function ghe(e){O_(e),_6(e)}function EC(e){che(e)}var yhe=bhe;function bhe(e){let t=xhe(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=Ehe(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 xhe(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(H0).forEach(r),t}function whe(e){let t=ku(e,"root",{},"_root"),n=vhe(e),r=Object.values(n),s=Mi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=_he(e)+1;e.children(H0).forEach(l=>C6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function C6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=gC(e,"_bt"),d=gC(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;C6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function vhe(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(H0).forEach(r=>n(r,1)),t}function _he(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function khe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Nhe=She;function She(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;iwC(e.node(t))),e.edges().forEach(t=>wC(e.edge(t)))}function wC(e){let t=e.width;e.width=e.height,e.height=t}function Che(e){e.nodes().forEach(t=>Db(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Db),Object.hasOwn(r,"y")&&Db(r)})}function Db(e){e.y=-e.y}function Ihe(e){e.nodes().forEach(t=>Pb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Pb),Object.hasOwn(r,"x")&&Pb(r)})}function Pb(e){let t=e.x;e.x=e.y,e.y=t}function Rhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Mi(Math.max,r),i=Hf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function Ohe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Mhe(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function jhe(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 Dhe(r)}function Dhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Phe(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=>Tg(s,["vs","i","barycenter","weight"]))}function Phe(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 Bhe(e,t){let n=Ffe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Fhe(!!t)),c=vC(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=vC(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function vC(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 Fhe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function R6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=Mhe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=R6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&$he(h,p)}});let d=jhe(u,n);Uhe(d,c);let f=Bhe(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function Uhe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function $he(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 Hhe(e,t,n,r){r||(r=e.nodes());let s=zhe(e),i=new Ks({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function zhe(e){let t;for(;e.hasNode(t=R_("_root")););return t}function Vhe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function O6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,O6);return}let n=x6(e),r=_C(e,Hf(1,n+1),"inEdges"),s=_C(e,Hf(n-1,-1,-1),"outEdges"),i=Rhe(e);if(kC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Khe(u%2?r:s,u%4>=2,c),i=Eh(e);let f=Ohe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return Hhe(e,i,n,r.get(i)||[])})}function Khe(e,t,n){let r=new Ks;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=R6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Vhe(s,r,a.vs)})}function kC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function Yhe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=Ghe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&L6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function Ghe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function L6(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 qhe(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 Xhe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function Zhe(e,t,n,r){let s=new Ks,i=e.graph(),a=rpe(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 Jhe(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=spe(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];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[l]=$0(c,f=>f+d))})})}function tpe(e,t=void 0){let n=e.ul;return n?$0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function npe(e){let t=Eh(e),n=Object.assign(Yhe(e,t),Whe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=Xhe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=Qhe(e,s,c.root,c.align,l==="r");l==="r"&&(u=$0(u,d=>-d)),r[a+l]=u})});let i=Jhe(e,r);return epe(r,i),tpe(r,e.graph().align)}function rpe(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function spe(e,t){return e.node(t).width}function ipe(e){e=b6(e),ape(e),Object.entries(npe(e)).forEach(([t,n])=>e.node(t).x=n)}function ape(e){let t=Eh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function ope(e,t={}){let n=t.debugTiming?w6:v6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>ype(e));return n(" runLayout",()=>lpe(r,n,t)),n(" updateInputGraph",()=>cpe(e,r)),r})}function lpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>bpe(e)),t(" removeSelfEdges",()=>Tpe(e)),t(" acyclic",()=>Qfe(e)),t(" nestingGraph.run",()=>whe(e)),t(" rank",()=>hhe(b6(e))),t(" injectEdgeLabelProxies",()=>Epe(e)),t(" removeEmptyRanks",()=>Pfe(e)),t(" nestingGraph.cleanup",()=>khe(e)),t(" normalizeRanks",()=>Dfe(e)),t(" assignRankMinMax",()=>xpe(e)),t(" removeEdgeLabelProxies",()=>wpe(e)),t(" normalize.run",()=>ehe(e)),t(" parentDummyChains",()=>yhe(e)),t(" addBorderSegments",()=>Nhe(e)),t(" order",()=>O6(e,n)),t(" insertSelfEdges",()=>Ape(e)),t(" adjustCoordinateSystem",()=>The(e)),t(" position",()=>ipe(e)),t(" positionSelfEdges",()=>Cpe(e)),t(" removeBorderNodes",()=>Spe(e)),t(" normalize.undo",()=>nhe(e)),t(" fixupEdgeLabelCoords",()=>kpe(e)),t(" undoCoordinateSystem",()=>Ahe(e)),t(" translateGraph",()=>vpe(e)),t(" assignNodeIntersects",()=>_pe(e)),t(" reversePoints",()=>Npe(e)),t(" acyclic.undo",()=>Jfe(e))}function cpe(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 upe=["nodesep","edgesep","ranksep","marginx","marginy"],dpe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},fpe=["acyclicer","ranker","rankdir","align","rankalign"],hpe=["width","height","rank"],NC={width:0,height:0},ppe=["minlen","weight","width","height","labeloffset"],mpe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gpe=["labelpos"];function ype(e){let t=new Ks({multigraph:!0,compound:!0}),n=Fb(e.graph());return t.setGraph(Object.assign({},dpe,Bb(n,upe),Tg(n,fpe))),e.nodes().forEach(r=>{let s=Fb(e.node(r)),i=Bb(s,hpe);Object.keys(NC).forEach(l=>{i[l]===void 0&&(i[l]=NC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Fb(e.edge(r));t.setEdge(r,Object.assign({},mpe,Bb(s,ppe),Tg(s,gpe)))}),t}function bpe(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 Epe(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};ku(e,"edge-proxy",s,"_ep")}})}function xpe(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 wpe(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 vpe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function _pe(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(mC(r,i)),n.points.push(mC(s,a))})}function kpe(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 Npe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Spe(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 Tpe(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 Ape(e){Eh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{ku(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 Cpe(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function Bb(e,t){return $0(Tg(e,t),Number)}function Fb(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Ipe(e){let t=Eh(e),n=new Ks({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Rpe={graphlib:c6,version:Hfe,layout:ope,debug:Ipe,util:{time:w6,notime:v6}},SC=Rpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const wd={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:il},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:AM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:xM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:wv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:u0}},wx=220,vx=88,TC=96,AC=34,Xd=64,Ub=310,hc=24,M6=56,_x=40,CC=40,Ope=18,Lpe=58,Mpe=!1,jpe=e=>e==="sequential"||e==="parallel"||e==="loop";function kx(e,t){const n=e.agentType??"llm";return jpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Nx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!kx(e,t))return{width:wx,height:vx};if(r&&e.subAgents.length===0)return{width:Ub,height:Xd};const i=e.subAgents.map((f,h)=>Nx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?M6:hc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?Ope+CC:s==="loop"?Lpe:0:CC;return u?{width:Math.max(Ub,i.reduce((f,h)=>f+h.width,0)+_x*Math.max(0,i.length-1)+c*2),height:Xd+hc+l+d+hc}:{width:Math.max(Ub,a+hc*2),height:Xd+c+i.reduce((f,h)=>f+h.height,0)+_x*Math.max(0,i.length-1)+d+c}}function rd(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Dpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function IC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function sd(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:nu.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 RC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=rd(f);return kx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||wd[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=rd(f),y=Nx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":wd[g].label),pattern:g,description:d.description.trim()||wd[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((A,S)=>Nx(A,[...f,S],t,n)),x=b.length&&g!=="parallel"?M6:hc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((A,S)=>{const R=b[S],I=_?{x:k,y:Xd+hc}:{x:(y.width-R.width)/2,y:Xd+k};return k+=(_?R.width:R.height)+_x,i(A,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let A=0;A1&&s.push(sd(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=rd(f);if(kx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||wd[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=rd(y);s.push(sd(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=rd([]),u=l(e,[]);return s.push(sd("terminal-input",c)),u.forEach(d=>s.push(sd(d,"terminal-output"))),Ppe(r,s,t)}function Ppe(e,t,n){const r=new SC.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?TC:i.data.layoutWidth??wx,height:a?AC:i.data.layoutHeight??vx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),SC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?TC:i.data.layoutWidth??wx,u=l?AC:i.data.layoutHeight??vx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const z0=E.createContext(null),V0=E.createContext("horizontal");function Bpe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(z0),[h,p]=E.useState(!1),[m,g,w]=_g({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(bh,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Lde,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(mr,{})})]})})]})}function Fpe({data:e,selected:t}){const n=E.useContext(z0),r=E.useContext(V0),s=r==="vertical"?Ve.Top:Ve.Left,i=r==="vertical"?Ve.Bottom:Ve.Right,a=r==="vertical"?Ve.Right:Ve.Bottom,l=e.pattern??"llm",c=wd[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Nr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(pi,{})}),o.jsx(Nr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Nr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Nr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Upe({data:e,selected:t}){const n=E.useContext(z0),r=E.useContext(V0),s=r==="vertical"?Ve.Top:Ve.Left,i=r==="vertical"?Ve.Bottom:Ve.Right,a=r==="vertical"?Ve.Right:Ve.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Nr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(mr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(mr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(mr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(mr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(pi,{})}),o.jsx(Nr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Nr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Nr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function $pe({data:e}){const t=E.useContext(V0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Nr,{type:"target",position:t==="vertical"?Ve.Top:Ve.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Nr,{type:"source",position:t==="vertical"?Ve.Bottom:Ve.Right,className:"abc-handle"})]})}const Hpe={agent:Fpe,group:Upe,terminal:$pe},zpe={insertStep:Bpe};function Vpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>RC(e,c,a),[]),[d,f,h]=t6(u.nodes),[p,m,g]=n6(u.edges),w=jde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${IC(e)}`),b=E.useRef(null),{fitView:x}=F0(),_=E.useMemo(()=>RC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),A=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(A))})},[A,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),D=F=>N(F.matches);return I.addEventListener("change",D),()=>I.removeEventListener("change",D)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${IC(e)}`,D=I!==y.current;y.current=I,m(_.edges),f(F=>{const W=new Map(F.map(L=>[L.id,L.position]));return _.nodes.map(L=>({...L,position:!D&&W.get(L.id)?W.get(L.id):L.position,selected:L.data.kind==="agent"&&!!L.data.path&&Dpe(L.data.path,t)}))}),D&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(V0.Provider,{value:c,children:o.jsx(z0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(e6,{nodes:d,edges:p,nodeTypes:Hpe,edgeTypes:zpe,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,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||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:A,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(s6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(a6,{showInteractive:!1}),Mpe]})})})})})}function Ag(e){return o.jsx(C_,{children:o.jsx(Vpe,{...e})})}const Kpe="doubao-seed-2-1-pro-260628",Ype="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Wpe=`你是一个专业、可靠的智能助手。 - -你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 - -约束: -- 信息不足时主动提问澄清,不要臆造事实。 -- 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Pr(){return{name:"",description:Ype,instruction:Wpe,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:Kpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Wc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const Gpe=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],qpe=[{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"}]}],Xpe=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function j6(e){const t=e.tools??[],n=ol.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Pr(),name:e.name,description:e.description,instruction:e.instruction||Pr().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(j6)}}function Qpe(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?j6(e.graph):{...Pr(),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 D6(e){return e?1+e.children.reduce((t,n)=>t+D6(n),0):1}function P6(e){return 1+e.subAgents.reduce((t,n)=>t+P6(n),0)}function Sx(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function Zpe(e){const t=Sx(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function Jpe(e,t){return e.find(n=>n.kind===t)}function eme(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Cg=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],tme=Cg.findIndex(e=>e.phase==="build");function B6(e){if(e.status==="success")return Cg.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Cg.findIndex(r=>r.phase===t);return n<0?0:n}function nme(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function rme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&B6(e)===tme,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` -`),f=s?u:d.slice(-36).join(` -`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=nme(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Vs,{"aria-hidden":!0}):o.jsx(l0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function sme({task:e}){const t=B6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx(zt,{className:"spin"}):e.status==="success"?o.jsx(kM,{}):e.status==="error"?o.jsx(o0,{}):o.jsx(NE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Cg.map((s,i)=>{const a=e.status==="success"||inew Set),[Ye,ce]=E.useState(()=>new Set),[Se,st]=E.useState(!1),[ct,q]=E.useState(""),[ee,ge]=E.useState([]),[Pe,Ge]=E.useState([]),[et,$t]=E.useState(!1),[bt,Vt]=E.useState(""),[Wt,St]=E.useState(0),[Pt,je]=E.useState(!1),[gt,tt]=E.useState(()=>new Set),[Ae,Ht]=E.useState(!1),[Bt,oe]=E.useState(""),[ze,dt]=E.useState(""),[Fn,cn]=E.useState(()=>new Set),Xt=E.useRef(!1),Qt=E.useRef(""),un=E.useRef(null),[dn,Gn]=E.useState(qpe),[qn,Rt]=E.useState("");E.useEffect(()=>{e.length!==0&&Gn(H=>H.map((re,le)=>le===0&&re.agentIds.length===0?{...re,agentIds:e.slice(0,2).map(Fe=>Fe.id)}:re))},[e]);const Kt=E.useMemo(()=>{const H=new Map;for(const re of e)re.runtimeId&&H.set(re.runtimeId,re);return H},[e]),de=E.useMemo(()=>{var re;const H=new Map;for(const le of t){const Fe=(re=le.deploymentTarget)==null?void 0:re.runtimeId;if(!Fe||!Kt.has(Fe))continue;const Nt=H.get(Fe);(!Nt||le.updatedAt>Nt.updatedAt)&&H.set(Fe,le)}return H},[Kt,t]),ke=E.useMemo(()=>{const H=new Map;for(const re of d){if(!re.runtimeId)continue;const le=H.get(re.runtimeId);(!le||re.startedAt>le.startedAt)&&H.set(re.runtimeId,re)}return H},[d]),Ie=E.useMemo(()=>{const H=Q.trim().toLowerCase();return H?e.filter(re=>{const le=re.runtimeId?de.get(re.runtimeId):void 0,Fe=re.runtimeId?ke.get(re.runtimeId):void 0;return[re.label,re.app,re.host??"",(le==null?void 0:le.draft.name)??"",(le==null?void 0:le.draft.description)??"",(Fe==null?void 0:Fe.runtimeName)??""].join(" ").toLowerCase().includes(H)}):e},[e,ke,Q,de]),Qe=E.useMemo(()=>{const H=Q.trim().toLowerCase();return t.filter(re=>{var Fe;const le=(Fe=re.deploymentTarget)==null?void 0:Fe.runtimeId;return le&&Kt.has(le)?!1:H?`${re.draft.name} ${re.draft.description}`.toLowerCase().includes(H):!0})},[Kt,t,Q]),ft=E.useMemo(()=>t.filter(H=>{var le;const re=(le=H.deploymentTarget)==null?void 0:le.runtimeId;return!re||!Kt.has(re)}).length,[Kt,t]),nt=E.useMemo(()=>{const H=Q.trim().toLowerCase();return H?dn.filter(re=>re.name.toLowerCase().includes(H)):dn},[dn,Q]),ie=e.find(H=>H.id===U),Ze=t.find(H=>H.id===M),ot=f?d.find(H=>H.id===f):void 0,xe=ie!=null&&ie.runtimeId?de.get(ie.runtimeId):void 0,ht=g?z:U&&s===U?r:null,Je=E.useMemo(()=>{const H=new Map(e.map((le,Fe)=>[le.id,Fe])),re=new Map(n.map((le,Fe)=>[le,Fe]));return[...Ie].sort((le,Fe)=>{const Nt=le.runtimeId?ke.get(le.runtimeId):void 0,Y=Fe.runtimeId?ke.get(Fe.runtimeId):void 0,ue=(Nt==null?void 0:Nt.status)==="running"?Nt.startedAt:0,Ue=(Y==null?void 0:Y.status)==="running"?Y.startedAt:0;if(ue!==Ue)return Ue-ue;const $e=re.get(le.id),At=re.get(Fe.id);return $e!=null&&At!=null?$e-At:$e!=null?-1:At!=null?1:(H.get(le.id)??0)-(H.get(Fe.id)??0)})},[n,e,Ie,ke]),lt=(ie==null?void 0:ie.label)||(ht==null?void 0:ht.name)||(Ze==null?void 0:Ze.draft.name)||(ot==null?void 0:ot.runtimeName)||"未选择智能体",_t=dn.find(H=>H.id===qn),Gt=Je.filter(H=>H.canDelete===!0),bn=Je.filter(H=>mt.has(H.id)&&H.canDelete===!0),En=Qe.filter(H=>Ye.has(H.id)),tn=Gt.length+Qe.length,Nn=bn.length+En.length,Et=E.useMemo(()=>(ot==null?void 0:ot.agentDraft)??(Ze==null?void 0:Ze.draft)??(xe==null?void 0:xe.draft)??Qpe(ht,(ie==null?void 0:ie.label)??"agent"),[ht,ie==null?void 0:ie.label,xe==null?void 0:xe.draft,Ze==null?void 0:Ze.draft,ot==null?void 0:ot.agentDraft]),Sn=E.useMemo(()=>{if(ht)return ht.tools;const H=(Et.builtinTools??[]).map(re=>{var le;return((le=ol.find(Fe=>Fe.id===re))==null?void 0:le.label)??re});return Array.from(new Set([...Et.tools,...H,...(Et.customTools??[]).map(re=>re.name),...(Et.mcpTools??[]).map(re=>re.name)].filter(Boolean)))},[Et,ht]),On=E.useMemo(()=>ht?ht.skillsPreviewSupported?ht.skills.map(H=>H.name):null:Array.from(new Set([...(Et.selectedSkills??[]).map(H=>H.name),...Et.skills].filter(Boolean))),[Et,ht]),Mt=E.useMemo(()=>{if(ot)return ot;if(Ze)return d.filter(H=>{var re,le;return((re=H.agentDraft)==null?void 0:re.name)===Ze.draft.name||H.runtimeName===Ze.draft.name||!!((le=Ze.deploymentTarget)!=null&&le.runtimeId)&&H.runtimeId===Ze.deploymentTarget.runtimeId}).sort((H,re)=>re.startedAt-H.startedAt)[0];if(ie)return d.filter(H=>!!ie.runtimeId&&H.runtimeId===ie.runtimeId||H.runtimeName===ie.label).sort((H,re)=>re.startedAt-H.startedAt)[0]},[d,ie,Ze,ot]),Ln=!!(f&&Mt&&Mt.id===f),Hr=!!(Mt&&(Mt.status!=="success"||Ln)),Mn=E.useMemo(()=>eme(Et),[Et]),fn=(ie==null?void 0:ie.currentVersion)??(j==null?void 0:j.currentVersion)??null,fr=fn??(ot==null?void 0:ot.startedAt)??"unknown",Cr=ht?`runtime:${(ie==null?void 0:ie.runtimeId)??ht.name}:v${fr}:${Mn}`:`draft:${(ot==null?void 0:ot.id)??(Ze==null?void 0:Ze.id)??(ie==null?void 0:ie.id)??lt}:${Mn}`,Ys=!!(g&&(ie!=null&&ie.runtimeId)&&!P);E.useEffect(()=>{if(!f)return;const H=d.find(le=>le.id===f),re=H!=null&&H.runtimeId?Kt.get(H.runtimeId):void 0;if(re){O(""),C(re.id),L("basic");return}C(""),O(""),L("basic")},[Kt,d,f]),E.useEffect(()=>{if(!h){Qt.current="";return}const H=`${h}:${p}:${m}`;Qt.current!==H&&e.some(re=>re.id===h)&&(Qt.current=H,O(""),C(h),L(p),p==="evaluations"&&(Z(m),J("")))},[e,h,p,m]),E.useEffect(()=>{let H=!1;if(G(null),se(!g||!(ie!=null&&ie.runtimeId)||!ie.region),!(!g||!(ie!=null&&ie.runtimeId)||!ie.region))return Ov(ie.runtimeId,ie.region,ie.runtimeApp).then(re=>{H||G(re)}).catch(()=>{H||G(null)}).finally(()=>{H||se(!0)}),()=>{H=!0}},[g,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeApp,ie==null?void 0:ie.runtimeId]),E.useEffect(()=>{let H=!1;if(T(null),!(!(ie!=null&&ie.runtimeId)||!ie.region))return Lv(ie.runtimeId,ie.region).then(re=>{H||T(re)}).catch(()=>{H||T(null)}),()=>{H=!0}},[ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),E.useEffect(()=>{let H=!1;if(ge([]),Ge([]),Vt(""),W!=="evaluations"||!(ie!=null&&ie.runtimeId)||!ie.region){$t(!1);return}return $t(!0),HM({runtimeId:ie.runtimeId,region:ie.region,appName:ie.app,pageSize:100}).then(re=>{H||(Ge(re.sets),ge(re.items.map(le=>({...le,tag:le.kind==="good"?"Good case":"Bad case"})).sort((le,Fe)=>Sx(Fe.createdAt)-Sx(le.createdAt))))}).catch(re=>{H||Vt(re instanceof Error?re.message:String(re))}).finally(()=>{H||$t(!1)}),()=>{H=!0}},[Wt,W,ie==null?void 0:ie.app,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),E.useEffect(()=>{const H=new Set(ee.map(re=>re.id));tt(re=>{const le=new Set([...re].filter(Fe=>H.has(Fe)));return le.size===re.size?re:le}),cn(re=>{const le=new Set([...re].filter(Fe=>H.has(Fe)));return le.size===re.size?re:le}),ze&&!H.has(ze)&&dt("")},[ee,ze]),E.useEffect(()=>{je(!1),tt(new Set),cn(new Set),oe(""),dt("")},[ie==null?void 0:ie.runtimeId]),E.useEffect(()=>{const H=new Set(Je.filter(re=>re.canDelete===!0).map(re=>re.id));Xe(re=>{const le=new Set([...re].filter(Fe=>H.has(Fe)));return le.size===re.size?re:le})},[Je]),E.useEffect(()=>{const H=new Set(Qe.map(re=>re.id));ce(re=>{const le=new Set([...re].filter(Fe=>H.has(Fe)));return le.size===re.size?re:le})},[Qe]);const ss=ie!=null&&ie.runtimeId?ee:Gpe,ir=ss.filter(H=>{if(H.kind!==fe)return!1;const re=pe.trim().toLowerCase();return re?[H.input,H.output,H.referenceOutput,H.comment,H.tag??"",H.sessionId,H.messageId,H.userId,H.evaluationSetName].join(" ").toLowerCase().includes(re):!0}),Ir=ir.filter(H=>gt.has(H.id)),_i=!!(ie!=null&&ie.runtimeId),xa=H=>{Z(H),J(""),oe("");const re=ss.find(le=>le.kind===H);dt((re==null?void 0:re.id)??""),window.setTimeout(()=>{var le;(le=un.current)==null||le.scrollIntoView({behavior:"smooth",block:"start"})},0)},bo=H=>{oe(""),tt(re=>{const le=new Set(re);return le.has(H.id)?le.delete(H.id):le.add(H.id),le})},zr=()=>{oe(""),tt(new Set(ir.map(H=>H.id)))},Ki=()=>{oe(""),tt(new Set),je(!1)},wa=H=>{cn(re=>{const le=new Set(re);return le.has(H)?le.delete(H):le.add(H),le})},ki=H=>{dt(H.id),oe(""),!(!H.sessionId||!H.messageId)&&(N==null||N(H))},Nl=async H=>{if(!(ie!=null&&ie.runtimeId)||!ie.region||Ae||H.length===0)return;const re=H.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${H.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(re))return;const le=H.map(Nt=>Nt.id),Fe=new Set(le);Ht(!0),oe("");try{await zM({runtimeId:ie.runtimeId,region:ie.region,appName:ie.app,itemIds:le});const Nt=new Map;for(const Y of H)Nt.set(Y.kind,(Nt.get(Y.kind)??0)+1);ge(Y=>Y.filter(ue=>!Fe.has(ue.id))),Ge(Y=>Y.map(ue=>({...ue,itemCount:Math.max(0,ue.itemCount-(Nt.get(ue.kind)??0))}))),tt(Y=>new Set([...Y].filter(ue=>!Fe.has(ue)))),cn(Y=>new Set([...Y].filter(ue=>!Fe.has(ue)))),ze&&Fe.has(ze)&&dt(""),H.length>1&&je(!1),A==null||A(H)}catch(Nt){oe(Nt instanceof Error?Nt.message:String(Nt))}finally{Ht(!1)}},ws=H=>{Gn(re=>re.map(le=>le.id===H.id?H:le))},Sl=()=>{const H=new Set(e.map(Fe=>Fe.id)),re=n.filter(Fe=>H.has(Fe)),le=new Set(re);return[...re,...e.filter(Fe=>!le.has(Fe.id)).map(Fe=>Fe.id)]},Ws=(H,re,le)=>{if(!y||H===re)return;const Fe=Sl().filter(ue=>ue!==H),Nt=Fe.indexOf(re),Y=Nt<0?Fe.length:le==="after"?Nt+1:Nt;Fe.splice(Y,0,H),y(Fe)},vs=(H,re)=>{if(!be||be===re)return;const le=H.currentTarget.getBoundingClientRect();ve(re),Re(H.clientY>le.top+le.height/2?"after":"before")},va=(H,re)=>{if(!y)return;const le=Sl(),Fe=le.indexOf(H),Nt=Math.max(0,Math.min(le.length-1,Fe+re));Fe<0||Fe===Nt||(le.splice(Fe,1),le.splice(Nt,0,H),y(le))},ar=H=>{H.canDelete===!0&&(q(""),Xe(re=>{const le=new Set(re);return le.has(H.id)?le.delete(H.id):le.add(H.id),le}))},Eo=H=>{q(""),ce(re=>{const le=new Set(re);return le.has(H.id)?le.delete(H.id):le.add(H.id),le})},_a=()=>{q(""),Xe(new Set(Gt.map(H=>H.id))),ce(new Set(Qe.map(H=>H.id)))},Tl=()=>{q(""),Xe(new Set),ce(new Set),Oe(!1)},Al=async()=>{if(Nn===0||Se)return;const H=bn.length,re=En.length,le=H===1&&re===0?`确定删除 Agent "${bn[0].label}"?该 Runtime 将被永久删除。`:H===0&&re===1?`确定删除草稿 "${En[0].draft.name||"未命名 Agent"}"?`:`确定删除选中的 ${Nn} 个项目?${H>0?`${H} 个 Runtime 将被永久删除。`:""}`;if(window.confirm(le)){st(!0),q("");try{if(bn.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(bn)}En.length>0&&(x==null||x(En)),Xe(new Set),ce(new Set),Oe(!1),bn.some(Fe=>Fe.id===U)&&C(""),En.some(Fe=>Fe.id===M)&&O("")}catch(Fe){q(Fe instanceof Error?Fe.message:String(Fe))}finally{st(!1)}}},ka=async H=>{if(!(!b||H.canDelete!==!0||Se)&&window.confirm(`确定删除 Agent "${H.label}"?该 Runtime 将被永久删除。`)){st(!0),q("");try{await b([H]),U===H.id&&C("")}catch(re){q(re instanceof Error?re.message:String(re))}finally{st(!1)}}},Yi=H=>{if(!x||Se)return;const re=H.draft.name||"未命名 Agent";window.confirm(`确定删除草稿 "${re}"?`)&&(q(""),x([H]),M===H.id&&O(""))},Na=()=>{const H=`eval-${Date.now()}`,re={id:H,name:`新评测组 ${dn.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Gn(le=>[re,...le]),Rt(H)},Cl=H=>{ws({...H,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+H.history.length%7,status:"completed"},...H.history]})};return o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:D==="library"?"is-active":"","aria-pressed":D==="library",onClick:()=>{F("library"),ne("")},children:"智能体库"}),o.jsx("button",{type:"button",className:D==="evaluation"?"is-active":"","aria-pressed":D==="evaluation",onClick:()=>{F("evaluation"),ne("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":D==="evaluation"||void 0,ref:H=>H==null?void 0:H.toggleAttribute("inert",D==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":D==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(kf,{"aria-hidden":!0}),o.jsx("input",{value:Q,onChange:H=>ne(H.currentTarget.value),placeholder:D==="library"?"搜索智能体":"搜索评测组","aria-label":D==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:D==="library"?S:Na,disabled:D==="library"&&!a,children:[o.jsx(mr,{"aria-hidden":!0}),o.jsx("span",{children:D==="library"?"新建 Agent":"新建评测组"})]}),D==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${Ke?" is-active":""}`,children:Ke?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Nn," 个"]}),o.jsx("button",{type:"button",onClick:_a,disabled:tn===0||Se,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Al(),disabled:Nn===0||Se,children:Se?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Tl,disabled:Se,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{q(""),Oe(!0)},disabled:tn===0,children:"选择"})}),D==="library"&&ct&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ct}),o.jsx("div",{className:"aw-agent-list",children:D==="evaluation"?nt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):nt.map(H=>o.jsxs("button",{type:"button",className:`aw-agent-item${H.id===qn?" is-active":""}`,onClick:()=>Rt(H.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:H.name}),o.jsxs("small",{children:[H.agentIds.length," 个智能体 · ",H.history.length," 次运行"]})]}),o.jsx(Pd,{"aria-hidden":!0})]},H.id)):c&&Je.length===0&&Qe.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&Je.length===0&&Qe.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):Je.length===0&&Qe.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[Qe.map(H=>{const re=d.filter(Fe=>{var Nt,Y;return((Nt=Fe.agentDraft)==null?void 0:Nt.name)===H.draft.name||Fe.runtimeName===H.draft.name||!!((Y=H.deploymentTarget)!=null&&Y.runtimeId)&&Fe.runtimeId===H.deploymentTarget.runtimeId}).sort((Fe,Nt)=>Nt.startedAt-Fe.startedAt)[0],le=Ye.has(H.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Ke?"is-selecting":"",le?"is-selected-for-delete":"",H.id===M?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Ke?le:void 0,onClick:()=>{if(Ke){Eo(H);return}C(""),O(H.id),L("basic")},children:[Ke&&o.jsx("span",{className:`aw-select-marker${le?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(re==null?void 0:re.status)==="running"?" is-deploying":""}`,children:(re==null?void 0:re.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:H.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Pd,{"aria-hidden":!0})]},H.id)}),Je.map(H=>{const re=H.runtimeId?ke.get(H.runtimeId):void 0,le=H.runtimeId?de.get(H.runtimeId):void 0,Fe=mt.has(H.id),Nt=H.canDelete===!0,Y=(re==null?void 0:re.status)==="running"?{label:"部署中",className:" is-deploying"}:(re==null?void 0:re.status)==="error"?{label:"失败",className:" is-error"}:(re==null?void 0:re.status)==="cancelled"?{label:"已取消",className:" is-muted"}:le?{label:"待更新",className:""}:null,ue=(re==null?void 0:re.status)==="running"?"正在更新部署":le?"待更新":H.remote?H.host||"远程智能体":"本地智能体",Ue=["aw-agent-item","aw-agent-item--sortable",H.id===U?"is-active":"",Ke?"is-selecting":"",Fe?"is-selected-for-delete":"",Ke&&!Nt?"is-selection-disabled":"",H.id===be?"is-dragging":"",H.id===we&&H.id!==be?`is-drop-target is-drop-${Te}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!Ke,className:Ue,"aria-pressed":Ke?Fe:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:$e=>{y&&(Xt.current=!0,ye(H.id),$e.dataTransfer.effectAllowed="move",$e.dataTransfer.setData("text/plain",H.id))},onDragEnter:$e=>{vs($e,H.id)},onDragOver:$e=>{!be||be===H.id||($e.preventDefault(),$e.dataTransfer.dropEffect="move",vs($e,H.id))},onDragLeave:$e=>{const At=$e.relatedTarget;At instanceof Node&&$e.currentTarget.contains(At)||we===H.id&&ve("")},onDrop:$e=>{$e.preventDefault();const At=$e.dataTransfer.getData("text/plain")||be;Ws(At,H.id,Te),ye(""),ve(""),Re("before")},onDragEnd:()=>{ye(""),ve(""),Re("before"),window.setTimeout(()=>{Xt.current=!1},0)},onKeyDown:$e=>{$e.altKey&&($e.key==="ArrowUp"?($e.preventDefault(),va(H.id,-1)):$e.key==="ArrowDown"&&($e.preventDefault(),va(H.id,1)))},onClick:$e=>{if(Ke){$e.preventDefault(),ar(H);return}if(Xt.current){$e.preventDefault(),Xt.current=!1;return}O(""),C(H.id),L("basic"),_(H.id)},children:[Ke&&o.jsx("span",{className:`aw-select-marker${Fe?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.label}),H.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",H.currentVersion]}),Y&&o.jsx("span",{className:`aw-draft-badge${Y.className}`,children:Y.label})]}),o.jsx("small",{children:ue})]}),o.jsx(Pd,{"aria-hidden":!0})]},H.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",D==="library"?e.length+ft:dn.length," 个"]})]}),D==="evaluation"&&_t?o.jsx(ome,{group:_t,agents:e,cases:ss,onChange:ws,onRun:Cl}):D==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!ie&&!Ze&&!ot?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[ie&&!ht&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:lt}),fn!=null&&o.jsxs("span",{children:["v",fn]}),Ze&&o.jsx("span",{children:"草稿"}),xe&&o.jsx("span",{children:"待更新"}),!ie&&!Ze&&ot&&o.jsx("span",{children:ot.label})]}),o.jsx("p",{children:Et.description||(i||g&&!P?"正在读取智能体信息…":"暂无描述")})]}),(Ze||xe)&&o.jsx("div",{className:"aw-head-actions",children:(Ze||xe)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const H=Ze??xe;H&&Yi(H)},disabled:Se,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(pi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]})})]}),Mt&&Hr&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(sme,{task:Mt})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:Xpe.map(H=>o.jsx("button",{type:"button",className:W===H.id?"is-active":"","aria-pressed":W===H.id,onClick:()=>L(H.id),children:H.label},H.id))}),o.jsxs("div",{className:"aw-content",children:[W==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(j==null?void 0:j.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(j==null?void 0:j.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(j==null?void 0:j.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(j==null?void 0:j.region)||(ie==null?void 0:ie.region)||(Mt==null?void 0:Mt.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:j!=null&&j.networkTypes.length?j.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:Ys?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Ag,{draft:Et,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Cr)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(ht==null?void 0:ht.model)||Et.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:ht!=null&&ht.graph?D6(ht.graph):P6(Et)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:Sn.length?Sn.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:On===null?"暂不支持预览":On.length?On.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:fn!=null?`v${fn}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:Ze?"草稿":(Mt==null?void 0:Mt.status)==="error"?"部署失败":(Mt==null?void 0:Mt.status)==="cancelled"?"已取消":xe?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([H,re])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:H}),o.jsx("small",{children:re})]})]},H))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),W==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[ie!=null&&ie.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(H=>{const re=Jpe(Pe,H),le=(re==null?void 0:re.itemCount)??ee.filter(Fe=>Fe.kind===H).length;return o.jsxs("button",{type:"button",onClick:()=>xa(H),children:[o.jsx("strong",{children:le}),o.jsx("span",{children:H==="good"?"Good cases":"Bad cases"})]},H)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(H=>o.jsx("button",{type:"button",className:fe===H?"is-active":"","aria-pressed":fe===H,onClick:()=>Z(H),children:H==="good"?"Good case":"Bad case"},H))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(kf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:pe,onChange:H=>J(H.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),_i&&o.jsx("div",{className:`aw-case-toolbar${Pt?" is-active":""}`,children:Pt?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Ir.length," 条"]}),o.jsx("button",{type:"button",onClick:zr,disabled:ir.length===0||Ae,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Nl(Ir),disabled:Ir.length===0||Ae,children:Ae?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Ki,disabled:Ae,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{oe(""),je(!0)},disabled:ir.length===0||Ae,children:"选择案例"})}),Bt&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Bt}),o.jsx("div",{ref:un,children:o.jsx(ame,{cases:ir,loading:et,error:bt,runtimeBacked:!!(ie!=null&&ie.runtimeId),selectionMode:Pt,selectedCaseIds:gt,focusedCaseId:ze,expandedCaseIds:Fn,deleting:Ae,canDelete:_i,onOpenCase:ki,onToggleCase:bo,onToggleExpanded:wa,onDeleteCase:H=>void Nl([H]),onRetry:()=>St(H=>H+1)})})]})]}),W==="basic"&&(ie||Ze)&&o.jsxs("div",{className:"aw-basic-actions",children:[ie&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(ie.id),children:[o.jsx(nV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:Ze||xe?!a:!(ie!=null&&ie.runtimeId)||!l||!i&&!ht,onClick:()=>Ze?I==null?void 0:I(Ze):xe?I==null?void 0:I(xe):R(Et),children:Ze||xe?"继续编辑":"更新"}),(Ze||xe)&&o.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>{const H=Ze??xe;H&&Yi(H)},disabled:Se,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(pi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(ie==null?void 0:ie.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete studio-update-action",onClick:()=>void ka(ie),disabled:Se,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(pi,{"aria-hidden":!0}),o.jsx("span",{children:Se?"删除中…":"删除 Agent"})]})]})]})]}),D==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]})}function ame({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(pi,{"aria-hidden":!0})})]}),o.jsx("small",{children:Zpe(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function ome({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Kz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Vs,{}),"已完成"]}),o.jsx(Pd,{"aria-hidden":!0})]},f.id))})]})})]})}const OC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],lme=100,cme=3e4,Rp=new Map,$b=new Map;function ume(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function dme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function fme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function hme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function pme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function LC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:pme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function mme(e,t,n){const r=`${e}:${t}`,s=$b.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(LC)),s.page.nextToken;s&&$b.delete(r);let i=Rp.get(r);i||(i=Nc({scope:"mine",region:e,pageSize:lme,nextToken:t}),Rp.set(r,i),i.then(()=>Rp.delete(r),()=>Rp.delete(r)));const a=await i;return $b.set(r,{page:a,expiresAt:Date.now()+cme}),n(a.runtimes.map(LC)),a.nextToken}function gme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function yme({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s=""}){const i=E.useRef(null),a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState("general"),[d,f]=E.useState("cn-beijing"),[h,p]=E.useState(!1),[m,g]=E.useState(""),[w,y]=E.useState([]),[b,x]=E.useState(""),[_,k]=E.useState(!0),[N,A]=E.useState(""),[S,R]=E.useState(""),I=E.useCallback((T,z)=>{const G=++l.current;return k(!0),A(""),mme(d,T,P=>{l.current===G&&y(se=>z?P:[...se,...P])}).then(P=>{l.current===G&&x(P)}).catch(P=>{l.current===G&&A(P instanceof Error?P.message:String(P))}).finally(()=>{l.current===G&&k(!1)})},[d]);E.useEffect(()=>(y([]),x(""),I("",!0),()=>{l.current+=1}),[I]),E.useEffect(()=>{const T=a.current,z=i.current;if(!T||!z||c!=="general"||!b||_)return;const G=new IntersectionObserver(([P])=>{P.isIntersecting&&I(b,!1)},{root:z,rootMargin:"180px 0px",threshold:.01});return G.observe(T),()=>G.disconnect()},[c,I,_,b]);const D=E.useCallback(async T=>{if(!S){R(T.id);try{await new Promise(z=>requestAnimationFrame(()=>z())),await n(T)}finally{R("")}}},[S,n]),F=E.useMemo(()=>{if(c!=="general")return[];const T=m.trim().toLocaleLowerCase(),z=T?w.filter(P=>P.name.toLocaleLowerCase().includes(T)):w,G=z.findIndex(P=>{var se;return((se=P.runtime)==null?void 0:se.runtimeId)===s});return G<=0?z:[z[G],...z.slice(0,G),...z.slice(G+1)]},[c,s,m,w]),W=OC.find(T=>T.id===c),L=(W==null?void 0:W.label)??"智能体",U=(W==null?void 0:W.createLabel)??"添加智能体",C=c==="general"&&_&&w.length===0,M=!C&&F.length===0,O=c==="openclaw"||c==="hermes"?"暂未开放":m.trim()?"没有匹配的智能体":`${L}暂无内容`,j=c==="general"?()=>e(d):c==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:T=>{T.key==="Escape"&&p(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":h,onClick:()=>p(T=>!T),children:[o.jsx("span",{children:d==="cn-beijing"?"北京":"上海"}),o.jsx(fme,{className:`my-agents-region-chevron${h?" is-open":""}`})]}),h&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>p(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(T=>{const z=T.value===d;return o.jsxs("button",{type:"button",role:"option","aria-selected":z,className:`my-agents-region-option${z?" is-selected":""}`,onClick:()=>{f(T.value),p(!1)},children:[o.jsx("span",{children:T.label}),z&&o.jsx(hme,{})]},T.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(ume,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:m,onChange:T=>g(T.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:OC.map(T=>o.jsx("button",{type:"button",className:`my-agent-type-pill${c===T.id?" is-active":""}`,"aria-pressed":c===T.id,onClick:()=>u(T.id),children:T.label},T.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!j,onClick:()=>j==null?void 0:j(),children:[o.jsx(dme,{}),U]})]}),o.jsxs("section",{className:"my-agent-results",ref:i,"aria-label":`${L}列表`,children:[C?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):N&&c==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:N}),o.jsx("button",{type:"button",onClick:()=>void I("",!0),children:"重新加载"})]}):M?o.jsxs("div",{className:"my-agent-empty",children:[!m.trim()&&c==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(d),children:"点此创建"})]}):o.jsx("p",{children:O}),m.trim()&&c!=="openclaw"&&c!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:F.map(T=>{var z;return o.jsx(gme,{agent:T,onUse:D,onViewDetails:r,connecting:T.id===S,connected:((z=T.runtime)==null?void 0:z.runtimeId)===s},T.id)})}),c==="general"&&F.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:a,"aria-live":"polite",children:_?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):b?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const bme={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 Eme(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 xme(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function wme(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function j_(e,t){if(xme(e))return Eme(t,e.path);if(wme(e)){const n=bme[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=j_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function vme(e,t){const n=j_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const F6=new Map;function _l(e,t){F6.set(e,t)}function _me(e){return F6.get(e)}function kme(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;ij_(r,e.dataModel),resolveString:r=>vme(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=_me(s.component)??Nme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Tme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 D_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(al,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(br,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(vM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(br,{})}):null]}):null]})}function P_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function $6(e){var n,r,s,i;const t=P_(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 H6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function z6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?qM(t,e.uri):""}function Ame({kind:e}){return e==="image"?o.jsx(xv,{}):e==="video"?o.jsx(NM,{}):e==="pdf"?o.jsx(zz,{}):o.jsx(bv,{})}function B_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=P_(a.mimeType),c=z6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(uV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Ame,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:$6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(zt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":H6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(kc,{className:"media-card-open"}):null]});return o.jsxs(en.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(bM,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(br,{})}):null]},a.id)})}),o.jsx(oi,{children:s?o.jsx(Cme,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function Cme({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>z6(t,e),[e,t]),s=P_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(en.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:o.jsxs(en.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[$6(t),t.sizeBytes?` · ${H6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(c0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(br,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(zt,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(fh,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Ime(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 Rme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 V6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Ome(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function Lme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Mme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function jme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Dme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function K6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Pme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(ma,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(K6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Bme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Ime},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Dme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Rme},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:V6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:Ome},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Lme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Mme},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:jme}};function Fme(e){return Bme[e]}const Y6="send_a2ui_json_to_client",Ume=28;function $me(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Hme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function W6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function zme({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 Vme(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 Kme(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 G6({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=W6(c,!t||n,r),{ref:d,onScroll:f}=Tme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(zme,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(ma,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx(Ds,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function q6(){return o.jsx(G6,{text:"",done:!1})}const Yme=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=W6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(fh,{text:s})}):null});function Wme({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===Y6?"渲染 UI":e,l=Fme(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 o.jsxs(en.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(Pme,{definition:l,label:Kme(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(Vme,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(ma,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(K6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function Gme({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx(zt,{className:"spin"}):o.jsx(yv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx(zt,{className:"spin"}):o.jsx(c0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(br,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function qme({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(en.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(cT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(en.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(cT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(zt,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function F_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(G6,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(Yme,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx(B_,{appName:t,items:c.files},u);case"artifact":return o.jsx(Gme,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(D_,{value:c.value},u);case"tool":return c.name===Y6&&c.done?null:o.jsx(Wme,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(qme,{block:c,onAuth:i},u);case"a2ui":return U6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(en.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Sme,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function X6(e){return e.isComposing||e.keyCode===229}const Xme="/assets/arkclaw-DG3MhHYM.png",Qme="/assets/codex-Csw-JJxq.png",Zme="/assets/hermes-C6L-CfGS.png",ei=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],Jme=[{label:"ArkClaw",logo:Xme},{label:"Hermes 智能体",logo:Zme}];function MC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Kc,{className:"new-chat-mode__agent-icon"})}function ege(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function tge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>ei.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=ei.find(k=>k.value===e)??ei[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var A;(A=f.current)!=null&&A.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+ei.length)%ei.length;while(w(ei[N]));d(N),c(ei[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(ei.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(ei[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(MC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(ei[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:ei.map((k,N)=>{const A=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":A?"menu":void 0,"aria-expanded":A?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(MC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),A?o.jsx(ege,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:Qme,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),Jme.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const Q6={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},nge={ppt:[],image:[],video:["video_task_query"]},U_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function jC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function rge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function sge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function ige(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const age=[{icon:rge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:sge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:ige,text:"帮我整理并润色一段内容,让表达更清晰"}],DC=[{value:"ppt",label:"PPT",icon:aV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:xv,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:V6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function oge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:A,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:D=!1,builtinTools:F=[]}){const W=E.useRef(null),L=E.useRef(null),U=E.useRef(null),C=E.useRef(null),[M,O]=E.useState(!1),[j,T]=E.useState(null),[z,G]=E.useState(0),[P,se]=E.useState(!1);async function Q(){if(e)try{await navigator.clipboard.writeText(e),se(!0),setTimeout(()=>se(!1),1500)}catch{se(!1)}}E.useLayoutEffect(()=>{const ce=W.current;ce&&(ce.style.height="auto",ce.style.height=`${Math.min(ce.scrollHeight,200)}px`)},[s]);const ne=x==="skill-create";E.useEffect(()=>{ne&&(O(!1),T(null))},[ne]);const fe=!ne&&d.some(ce=>ce.status!=="ready"),Z=!l&&!c&&!fe&&(s.trim().length>0||!ne&&d.length>0),pe=(j==null?void 0:j.query.toLocaleLowerCase())??"",J=(j==null?void 0:j.kind)==="skill"?f.filter(ce=>!p.skills.some(Se=>Se.name===ce.name)).filter(ce=>`${ce.name} ${ce.description}`.toLocaleLowerCase().includes(pe)).map(ce=>({kind:"skill",value:ce})):(j==null?void 0:j.kind)==="agent"?h.filter(ce=>`${ce.name} ${ce.description}`.toLocaleLowerCase().includes(pe)).map(ce=>({kind:"agent",value:ce})):[];function be(ce){var Se;O(!1),T(null),(Se=ce.current)==null||Se.click()}function ye(ce){i(ce),O(!1),T(null),requestAnimationFrame(()=>{var Se,st;(Se=W.current)==null||Se.focus(),(st=W.current)==null||st.setSelectionRange(ce.length,ce.length)})}function we(ce){S==null||S(ce.value),O(!1),T(null),requestAnimationFrame(()=>{var Se,st;(Se=W.current)==null||Se.focus(),(st=W.current)==null||st.setSelectionRange(s.length,s.length)})}function ve(ce){i(ce),O(!1),T(null),requestAnimationFrame(()=>{var ct,q,ee;(ct=W.current)==null||ct.focus();const Se=ce.indexOf("【"),st=ce.indexOf("】",Se+1);Se>=0&&st>Se?(q=W.current)==null||q.setSelectionRange(Se+1,st):(ee=W.current)==null||ee.setSelectionRange(ce.length,ce.length)})}function Te(){S==null||S(null),i(""),O(!1),T(null),requestAnimationFrame(()=>{var ce,Se;(ce=W.current)==null||ce.focus(),(Se=W.current)==null||Se.setSelectionRange(0,0)})}const Re=DC.find(ce=>ce.value===_),Ke=DC.filter(ce=>Q6[ce.value].every(Se=>F.includes(Se)));function Oe(ce,Se){const st=ce.slice(0,Se),ct=/(^|\s)([/@])([^\s/@]*)$/.exec(st);if(!ct){T(null);return}const q=ct[2].length+ct[3].length,ee={kind:ct[2]==="/"?"skill":"agent",query:ct[3],start:Se-q,end:Se},ge=!j||j.kind!==ee.kind||j.query!==ee.query||j.start!==ee.start||j.end!==ee.end;T(ee),ge&&G(0),O(!1)}function mt(ce){if(!j)return;const Se=s.slice(0,j.start)+s.slice(j.end);i(Se),ce.kind==="skill"?w({...p,skills:[...p.skills,ce.value]}):w({skills:[],targetAgent:ce.value});const st=j.start;T(null),requestAnimationFrame(()=>{var ct,q;(ct=W.current)==null||ct.focus(),(q=W.current)==null||q.setSelectionRange(st,st)})}function Xe(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function Ye(ce){const Se=ce.target.files?Array.from(ce.target.files):[];Se.length&&y(Se),ce.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${ne?" composer--skill-mode":""}${Re?` composer--has-task composer--task-${Re.value}`:""}`,children:[ne?null:o.jsx(D_,{value:p,onRemoveSkill:ce=>w({...p,skills:p.skills.filter(Se=>Se.name!==ce)}),onRemoveAgent:()=>w({skills:[]})}),!ne&&d.length>0&&o.jsx(B_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[j?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":j.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[j.kind==="skill"?o.jsx(al,{}):o.jsx(vM,{}),o.jsx("span",{children:j.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:j.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(zt,{className:"spin"})," 正在读取 Agent 能力…"]}):J.length===0?o.jsx("div",{className:"composer-command-empty",children:j.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:J.map((ce,Se)=>o.jsxs("button",{type:"button",role:"option","aria-selected":Se===z,className:`composer-command-item${Se===z?" is-active":""}`,onMouseDown:st=>{st.preventDefault(),mt(ce)},onMouseEnter:()=>G(Se),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${ce.kind}`,children:ce.kind==="skill"?o.jsx(al,{}):o.jsx(il,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[ce.kind==="skill"?"/":"@",ce.value.name]}),o.jsx("span",{children:ce.value.description||(ce.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:Se===z?"↵":ce.kind==="skill"?"技能":"Agent"})]},`${ce.kind}-${ce.value.name}`))})]}):null,ne?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{T(null),O(ce=>!ce)},children:o.jsx(mr,{className:"icon"})}),M&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>O(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>be(L),children:[o.jsx(xv,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>be(U),children:[o.jsx(bv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>be(C),children:[o.jsx(NM,{className:"icon"}),"上传视频"]})]})]})]}),N&&A?o.jsx(tge,{value:x,onChange:A,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Re&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Re.value}`,"aria-label":`取消${Re.label}任务`,disabled:c,onClick:Te,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Re.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(br,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Re.label})]}):null,k&&ne&&A?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>A("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(jC,{className:"new-chat-task-chip__task-icon"}),o.jsx(br,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:W,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:ne?`描述你想创建的 Skill,将使用 ${U_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!j,onChange:ce=>{i(ce.target.value),ne||Oe(ce.target.value,ce.target.selectionStart)},onSelect:ce=>{ne||Oe(ce.currentTarget.value,ce.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>T(null),0),onKeyDown:ce=>{if(!X6(ce.nativeEvent)){if(j){if(ce.key==="ArrowDown"&&J.length>0){ce.preventDefault(),G(Se=>(Se+1)%J.length);return}if(ce.key==="ArrowUp"&&J.length>0){ce.preventDefault(),G(Se=>(Se-1+J.length)%J.length);return}if((ce.key==="Enter"||ce.key==="Tab")&&J[z]){ce.preventDefault(),mt(J[z]);return}if(ce.key==="Escape"){ce.preventDefault(),T(null);return}}if(ce.key==="Backspace"&&!s&&ce.currentTarget.selectionStart===0&&ce.currentTarget.selectionEnd===0){Xe();return}ce.key==="Enter"&&!ce.shiftKey&&(ce.preventDefault(),Z&&a())}}})}),o.jsx(en.button,{type:"button",className:"comp-send",disabled:!Z,onClick:a,"aria-label":"发送",whileTap:Z?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx(zt,{className:"icon spin"}):o.jsx(wM,{className:"icon"})})]}),k&&x==="agent"&&D&&!Re?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ke.map(ce=>{const Se=ce.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>we(ce),children:[o.jsx(Se,{}),o.jsx("span",{children:ce.label})]},ce.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>A==null?void 0:A("skill-create"),children:[o.jsx(jC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Re?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Re.label}企业提示词`,children:Re.prompts.map(ce=>{const Se=Re.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ve(ce),children:[o.jsx(Se,{}),o.jsx("span",{children:ce})]},ce)})}):null,k&&x==="agent"&&!D&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:age.map(ce=>{const Se=ce.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ye(ce.text),children:[o.jsx(Se,{}),o.jsx("span",{children:ce.text})]},ce.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:P?"已复制":"复制会话 ID","aria-label":P?"已复制会话 ID":"复制会话 ID",onClick:()=>void Q(),children:P?o.jsx(Vs,{}):o.jsx(l0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:L,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Ye}),o.jsx("input",{ref:U,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:Ye}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:Ye})]})}function Z6({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(en.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx(Ds,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const $_=Symbol.for("yaml.alias"),Tx=Symbol.for("yaml.document"),io=Symbol.for("yaml.map"),J6=Symbol.for("yaml.pair"),$i=Symbol.for("yaml.scalar"),Nu=Symbol.for("yaml.seq"),Hs=Symbol.for("yaml.node.type"),Su=e=>!!e&&typeof e=="object"&&e[Hs]===$_,xh=e=>!!e&&typeof e=="object"&&e[Hs]===Tx,wh=e=>!!e&&typeof e=="object"&&e[Hs]===io,Wn=e=>!!e&&typeof e=="object"&&e[Hs]===J6,on=e=>!!e&&typeof e=="object"&&e[Hs]===$i,vh=e=>!!e&&typeof e=="object"&&e[Hs]===Nu;function Kn(e){if(e&&typeof e=="object")switch(e[Hs]){case io:case Nu:return!0}return!1}function Yn(e){if(e&&typeof e=="object")switch(e[Hs]){case $_:case io:case $i:case Nu:return!0}return!1}const e5=e=>(on(e)||Kn(e))&&!!e.anchor,Lo=Symbol("break visit"),lge=Symbol("skip children"),Qd=Symbol("remove node");function Tu(e,t){const n=cge(t);xh(e)?pc(null,e.contents,n,Object.freeze([e]))===Qd&&(e.contents=null):pc(null,e,n,Object.freeze([]))}Tu.BREAK=Lo;Tu.SKIP=lge;Tu.REMOVE=Qd;function pc(e,t,n,r){const s=uge(e,t,n,r);if(Yn(s)||Wn(s))return dge(e,r,s),pc(e,s,n,r);if(typeof s!="symbol"){if(Kn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>fge[t]);class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){const t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.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+hge(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&&Yn(t.contents)){const i={};Tu(t.contents,(a,l)=>{Yn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` -`)}}jr.defaultYaml={explicit:!1,version:"1.2"};jr.defaultTags={"!!":"tag:yaml.org,2002:"};function t5(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 n5(e){const t=new Set;return Tu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function r5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function pge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=n5(e));const a=r5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(on(a.node)||Kn(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function mc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sBs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!e5(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 H_{constructor(t){Object.defineProperty(this,Hs,{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(!xh(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},l=Bs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?mc(i,{"":l},"",l):l}}class z_ extends H_{constructor(t){super($_),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=[],Tu(t,{Node:(i,a)=>{(Su(a)||e5(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 l=r.get(a);if(l||(Bs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ym(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(t5(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 ym(e,t,n){if(Su(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Kn(t)){let r=0;for(const s of t.items){const i=ym(e,s,n);i>r&&(r=i)}return r}else if(Wn(t)){const r=ym(e,t.key,n),s=ym(e,t.value,n);return Math.max(r,s)}return 1}const s5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends H_{constructor(t){super($i),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Bs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const mge="tag:yaml.org,2002:";function gge(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 zf(e,t,n){var f,h,p;if(xh(e)&&(e=e.contents),Yn(e))return e;if(Wn(e)){const m=(h=(f=n.schema[io]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new z_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=mge+t.slice(2));let u=gge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[io]:Symbol.iterator in Object(e)?a[Nu]:a[io]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Ig(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 zf(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 vd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class i5 extends H_{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=>Yn(r)||Wn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(vd(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Kn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ig(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(Kn(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&&on(i)?i.value:i:Kn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Wn(n))return!1;const r=n.value;return r==null||t&&on(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 Kn(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(Kn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ig(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const yge=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ia(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Vo=(e,t,n)=>e.endsWith(` -`)?ia(n,t):n.includes(` -`)?` -`+ia(n,t):(e.endsWith(" ")?"":" ")+n,a5="flow",Ax="block",bm="quoted";function K0(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,g=-1,w=-1,y=-1;n===Ax&&(g=PC(e,g,t.length),g!==-1&&(f=g+c));for(let x;x=e[g+=1];){if(n===bm&&x==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(x===` -`)n===Ax&&(g=PC(e,g,t.length)),f=g+t.length+c,h=void 0;else{if(x===" "&&p&&p!==" "&&p!==` -`&&p!==" "){const _=e[g+1];_&&_!==" "&&_!==` -`&&_!==" "&&(h=g)}if(g>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===bm){for(;p===" "||p===" ";)p=x,x=e[g+=1],m=!0;const _=g>y+1?g-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=x}if(m&&l&&l(),u.length===0)return e;a&&a();let b=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),W0=e=>/^(%|---|\.\.\.)/m.test(e);function bge(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 Zd(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(W0(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,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,l=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(Ix,`$&${u}`));let g=!1,w,y=-1;for(w=0;w{N=!0});const S=K0(`${b}${k}${p}`,u,Ax,A);if(!N)return`>${_} -${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} -${u}${b}${n}${p}`}function Ege(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` -`)||d&&/[[\]{},]/.test(i))return gc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` -`)?gc(i,t):Em(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` -`))return Em(e,t,n,r);if(W0(i)){if(c==="")return t.forceBlockIndent=!0,Em(e,t,n,r);if(l&&c===u)return gc(i,t)}const f=i.replace(/\n+/g,`$& -${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return gc(i,t)}return l?f:K0(f,c,a5,Y0(t,!1))}function V_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?gc(a.value,t):Em(a,t,n,r);case yt.QUOTE_DOUBLE:return Zd(a.value,t);case yt.QUOTE_SINGLE:return Cx(a.value,t);case yt.PLAIN:return Ege(a,t,n,r);default:return null}};let u=c(l);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 o5(e,t){const n=Object.assign({blockQuote:!0,commentString:yge,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 xge(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(on(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 wge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(on(e)||Kn(e))&&e.anchor;i&&t5(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 cu(e,t,n,r){var c;if(Wn(e))return e.toString(t,n,r);if(Su(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=Yn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=xge(t.doc.schema.tags,i));const a=wge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):on(i)?V_(i,t,n,r):i.toString(t,n,r);return a?on(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function vge({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Yn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Kn(e)||!Yn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||Kn(e)||(on(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=cu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Vo(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Vo(w,n.indent,u(h))),w=`? ${w} -${l}:`):(w=`${w}:`,h&&(w+=Vo(w,n.indent,u(h))));let y,b,x;Yn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&on(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&vh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=cu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` -`:"",b){const A=u(b);N+=` -${ia(A,n.indent)}`}k===""&&!n.inFlow?N===` -`&&x&&(N=` - -`):N+=` -${n.indent}`}else if(!p&&Kn(t)){const A=k[0],S=k.indexOf(` -`),R=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let D=!1;if(R&&(A==="&"||A==="!")){let F=k.indexOf(" ");A==="&"&&F!==-1&&Fe===Op||typeof e=="symbol"&&e.description===Op,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(Op)),{addToJSMap:c5}),stringify:()=>Op},_ge=(e,t)=>(ca.identify(t)||on(t)&&(!t.type||t.type===yt.PLAIN)&&ca.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ca.tag&&n.default));function c5(e,t,n){const r=u5(e,n);if(vh(r))for(const s of r.items)Hb(e,t,s);else if(Array.isArray(r))for(const s of r)Hb(e,t,s);else Hb(e,t,r)}function Hb(e,t,n){const r=u5(e,n);if(!wh(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 u5(e,t){return e&&Su(t)?t.resolve(e.doc,e):t}function d5(e,t,{key:n,value:r}){if(Yn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_ge(e,n))c5(e,t,r);else{const s=Bs(n,"",e);if(t instanceof Map)t.set(s,Bs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=kge(n,s,e),a=Bs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function kge(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Yn(e)&&(n!=null&&n.doc)){const r=o5(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)+'..."'),l5(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 K_(e,t,n){const r=zf(e,void 0,n),s=zf(t,void 0,n);return new Fr(r,s)}class Fr{constructor(t,n=null){Object.defineProperty(this,Hs,{value:J6}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Yn(n)&&(n=n.clone(t)),Yn(r)&&(r=r.clone(t)),new Fr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return d5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?vge(this,t,n,r):JSON.stringify(this)}}function f5(e,t,n){return(t.inFlow??e.flow?Sge:Nge)(e,t,n)}function Nge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Vo(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||y.includes(` -`)),m0&&(u||(u=f.reduce((b,x)=>b+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),w&&(y+=Vo(y,r,l(w))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const g of f)m+=g?` -${i}${s}${g}`:` -`;return`${m} -${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Rg({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=ia(t(r),e);n.push(i.trimStart())}}function Ko(e,t){const n=on(t)?t.value:t;for(const r of e)if(Wn(r)&&(r.key===t||r.key===n||on(r.key)&&r.key.value===n))return r}class Ms extends i5{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(io,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),l=(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(K_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;Wn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Fr(t,t==null?void 0:t.value):r=new Fr(t.key,t.value);const s=Ko(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`);on(s.value)&&s5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Ko(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ko(this.items,t),s=r==null?void 0:r.value;return(!n&&on(s)?s.value:s)??void 0}has(t){return!!Ko(this.items,t)}set(t,n){this.add(new Fr(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)d5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Wn(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})),f5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Au={collection:"map",default:!0,nodeClass:Ms,tag:"tag:yaml.org,2002:map",resolve(e,t){return wh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ms.from(e,t,n)};class pl extends i5{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=Lp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Lp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&on(s)?s.value:s}has(t){const n=Lp(t);return typeof n=="number"&&n=0?t:null}const Cu={collection:"seq",default:!0,nodeClass:pl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return vh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>pl.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),V_(e,t,n,r)}},q0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&q0.test.test(e)?e:t.options.nullStr},Y_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Y_.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 vi({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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const h5={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:vi},p5={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():vi(e)}},m5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:vi},X0=e=>typeof e=="bigint"||Number.isInteger(e),W_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function g5(e,t,n){const{value:r}=e;return X0(r)&&r>=0?n+r.toString(t):vi(e)}const y5={identify:e=>X0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>W_(e,2,8,n),stringify:e=>g5(e,8,"0o")},b5={identify:X0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>W_(e,0,10,n),stringify:vi},E5={identify:e=>X0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>W_(e,2,16,n),stringify:e=>g5(e,16,"0x")},Tge=[Au,Cu,G0,q0,Y_,y5,b5,E5,h5,p5,m5];function BC(e){return typeof e=="bigint"||Number.isInteger(e)}const Mp=({value:e})=>JSON.stringify(e),Age=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Mp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Mp},{identify:BC,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})=>BC(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:Mp}],Cge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Ige=[Au,Cu].concat(Age,Cge),G_={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 Fr(new yt(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]=Wn(r)?r:new Fr(r)}}else t("Expected a sequence for this tag");return e}function w5(e,t,n){const{replacer:r}=n,s=new pl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(K_(l,c,n))}return s}const q_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:x5,createNode:w5};class Cc extends pl{constructor(){super(),this.add=Ms.prototype.add.bind(this),this.delete=Ms.prototype.delete.bind(this),this.get=Ms.prototype.get.bind(this),this.has=Ms.prototype.has.bind(this),this.set=Ms.prototype.set.bind(this),this.tag=Cc.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(Wn(s)?(i=Bs(s.key,"",n),a=Bs(s.value,i,n)):i=Bs(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=w5(t,n,r),i=new this;return i.items=s.items,i}}Cc.tag="tag:yaml.org,2002:omap";const X_={collection:"seq",identify:e=>e instanceof Map,nodeClass:Cc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=x5(e,t),r=[];for(const{key:s}of n.items)on(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Cc,n)},createNode:(e,t,n)=>Cc.from(e,t,n)};function v5({value:e,source:t},n){return t&&(e?_5:k5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const _5={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 yt(!0),stringify:v5},k5={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 yt(!1),stringify:v5},Rge={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:vi},Oge={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():vi(e)}},Lge={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 yt(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:vi},_h=e=>typeof e=="bigint"||Number.isInteger(e);function Q0(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 Q_(e,t,n){const{value:r}=e;if(_h(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return vi(e)}const Mge={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Q0(e,2,2,n),stringify:e=>Q_(e,2,"0b")},jge={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Q0(e,1,8,n),stringify:e=>Q_(e,8,"0")},Dge={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Q0(e,0,10,n),stringify:vi},Pge={identify:_h,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Q0(e,2,16,n),stringify:e=>Q_(e,16,"0x")};class Ic extends Ms{constructor(t){super(t),this.tag=Ic.tag}add(t){let n;Wn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Fr(t.key,null):n=new Fr(t,null),Ko(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ko(this.items,t);return!n&&Wn(r)?on(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=Ko(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Fr(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(K_(a,null,r));return i}}Ic.tag="tag:yaml.org,2002:set";const Z_={collection:"map",identify:e=>e instanceof Set,nodeClass:Ic,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Ic.from(e,t,n),resolve(e,t){if(wh(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ic,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function J_(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function N5(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return vi(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 S5={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})=>J_(e,n),stringify:N5},T5={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=>J_(e,!1),stringify:N5},Z0={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(Z0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=J_(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$/,""))??""},FC=[Au,Cu,G0,q0,_5,k5,Mge,jge,Dge,Pge,Rge,Oge,Lge,G_,ca,X_,q_,Z_,S5,T5,Z0],UC=new Map([["core",Tge],["failsafe",[Au,Cu,G0]],["json",Ige],["yaml11",FC],["yaml-1.1",FC]]),$C={binary:G_,bool:Y_,float:m5,floatExp:p5,floatNaN:h5,floatTime:T5,int:b5,intHex:E5,intOct:y5,intTime:S5,map:Au,merge:ca,null:q0,omap:X_,pairs:q_,seq:Cu,set:Z_,timestamp:Z0},Bge={"tag:yaml.org,2002:binary":G_,"tag:yaml.org,2002:merge":ca,"tag:yaml.org,2002:omap":X_,"tag:yaml.org,2002:pairs":q_,"tag:yaml.org,2002:set":Z_,"tag:yaml.org,2002:timestamp":Z0};function zb(e,t,n){const r=UC.get(t);if(r&&!e)return n&&!r.includes(ca)?r.concat(ca):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(UC.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(ca)),s.reduce((i,a)=>{const l=typeof a=="string"?$C[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys($C).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const Fge=(e,t)=>e.keyt.key?1:0;class ek{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?zb(t,"compat"):t?zb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Bge:{},this.tags=zb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,io,{value:Au}),Object.defineProperty(this,$i,{value:G0}),Object.defineProperty(this,Nu,{value:Cu}),this.sortMapEntries=typeof a=="function"?a:a===!0?Fge:null}clone(){const t=Object.create(ek.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Uge(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=o5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ia(u,""))}let a=!1,l=null;if(e.contents){if(Yn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ia(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=cu(e.contents,s,()=>l=null,u);l&&(d+=Vo(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(cu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` -`)?(n.push("..."),n.push(ia(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(ia(i(u),"")))}return n.join(` -`)+` -`}class kh{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Hs,{value:Tx});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 jr({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(kh.prototype,{[Hs]:{value:Tx}});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=Yn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Bl(this.contents)&&this.contents.add(t)}addIn(t,n){Bl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=n5(this);t.anchor=!n||r.has(n)?r5(n||"a",r):n}return new z_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=pge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=zf(t,d,m);return l&&Kn(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Fr(s,i)}delete(t){return Bl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return vd(t)?this.contents==null?!1:(this.contents=null,!0):Bl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Kn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return vd(t)?!n&&on(this.contents)?this.contents.value:this.contents:Kn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Kn(this.contents)?this.contents.has(t):!1}hasIn(t){return vd(t)?this.contents!==void 0:Kn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ig(this.schema,[t],n):Bl(this.contents)&&this.contents.set(t,n)}setIn(t,n){vd(t)?this.contents=n:this.contents==null?this.contents=Ig(this.schema,Array.from(t),n):Bl(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 jr({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 jr({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 ek(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Bs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?mc(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 Uge(this,t)}}function Bl(e){if(Kn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class A5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class _d extends A5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class $ge extends A5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const HC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… -`),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(l=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`: - -${a} -${u} -`}};function uu(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",p=!1,m=!1,g=null,w=null,y=null,b=null,x=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),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(w||y)&&(b=S),d=!0;break;case"anchor":w&&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),w=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{y&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),y=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(w||y)&&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){x&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=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],A=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"),g&&(u&&g.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:_,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:y,newlineAfterProp:b,end:A,start:k??A}}function Vf(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(Vf(t.key)||Vf(t.value))return!0}return!1;default:return!0}}function Rx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Vf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function C5(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||on(i)&&on(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const zC="All mapping items must start at the same column";function Hge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Ms,l=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:g}=f,w=uu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",zC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` -`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||Vf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",zC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Rx(r.indent,p,s),n.atKey=!1,C5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=uu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Rx(r.indent,g,s),c=k.range[2];const N=new Fr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` -`+_.comment:x.comment=_.comment);const k=new Fr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function Vge({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Ms:pl),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 y=0;y0){const y=Nh(m,g,n.options.strict,s);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Yb(e,t,n,r,s,i){const a=n.type==="block-map"?Hge(e,t,n,r,i):n.type==="block-seq"?zge(e,t,n,r,i):Vge(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function Kge(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Yb(e,t,n,s,a)}const u=Yb(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=Yn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function Yge(e,t,n){const r=t.offset,s=Wge(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?Gge(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` -`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let g=0;gc&&(c=w.length);else{w.length=l;--g)a[g][0].length>c&&(l=g+1);let f="",h="",p=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` -`:!p&&h===` -`&&(h=` - -`),f+=h+w.slice(c)+y,h=` -`,p=!0):y===""?h===` -`?f+=` -`:h=` -`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=l;gn(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=Xge(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=Qge(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=Zge(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=Nh(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function Xge(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}`),I5(e)}function Qge(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),I5(e.slice(1,-1)).replace(/''/g,"'")}function I5(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 Jge(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 e0e={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function t0e(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 l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function R5(e,t,n,r){const{value:s,type:i,comment:a,range:l}=t.type==="block-scalar"?Yge(e,t,r):qge(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[$i]:c?u=n0e(e.schema,s,c,n,r):t.type==="scalar"?u=r0e(e,s,t,r):u=e.schema[$i];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=on(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function n0e(e,t,n,r,s){var l;if(n==="!")return e[$i];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((l=c.test)!=null&&l.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[$i])}function r0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[$i];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[$i];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function s0e(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 i0e={composeNode:O5,composeEmptyNode:tk};function O5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=a0e(e,t,r),(l||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=R5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Kge(i0e,e,t,n,r),l&&(u.anchor=l.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=tk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!on(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 tk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:s0e(t,n,r),indent:-1,source:""},f=R5(e,d,l,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 a0e({options:e},{offset:t,source:n,end:r},s){const i=new z_(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,l=Nh(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function o0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new kh(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=uu(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?O5(u,s,d,a):tk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Nh(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function id(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 VC(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=id(n);i?this.warnings.push(new $ge(a,r,s)):this.errors.push(new _d(a,r,s))},this.directives=new jr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=VC(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(Kn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];Wn(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${r} -${l}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} -${a}`:r}}if(n){for(let i=0;i{const i=id(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=o0e(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 _d(id(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 _d(id(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Nh(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 _d(id(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 kh(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 L5="\uFEFF",M5="",j5="",Ox="";function c0e(e){switch(e){case L5:return"byte-order-mark";case M5:return"doc-mode";case j5:return"flow-error-end";case Ox: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 ti(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const KC=new Set("0123456789ABCDEFabcdef"),u0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),jp=new Set(",[]{}"),d0e=new Set(` ,[]{} -\r `),Wb=e=>!e||d0e.has(e);class f0e{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==="...")&&ti(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ti(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===":")&&ti(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(Wb),"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=>ti(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 l=i;for(;a===" ";)a=this.buffer[--i];if(a===` -`&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield Ox,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(ti(i)||t&&jp.has(i))break;n=r}else if(ti(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` -`?(r+=1,s=` -`,i=this.buffer[r+1]):n=r),i==="#"||t&&jp.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&jp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ox,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(Wb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ti(r)||n&&jp.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(;!ti(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(u0e.has(n))n=this.buffer[++t];else if(n==="%"&&KC.has(this.buffer[t+1])&&KC.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 h0e{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 Og(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"&&WC(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&&YC(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 l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(Ua(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(D5(n.key)&&!Ua(n.sep,"newline")){const l=Fl(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:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ua(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Fl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ua(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ua(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(l);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)){Og(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||Ua(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=Dp(r),i=Fl(s);WC(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={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]=l}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=Dp(t),r=Fl(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=Dp(t),r=Fl(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 m0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new h0e||null,prettyErrors:t}}function g0e(e,t={}){const{lineCounter:n,prettyErrors:r}=m0e(t),s=new p0e(n==null?void 0:n.addNewLine),i=new l0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new _d(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(HC(e,n)),a.warnings.forEach(HC(e,n))),a}function y0e(e,t,n){let r;const s=g0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>l5(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 b0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return xh(e)&&!r?e.toString(n):new kh(e,r,n).toString(n)}const P5=new Set(["local","sqlite","mysql","postgresql"]),B5=new Set(["local","opensearch","redis","viking","mem0"]),F5=new Set(["opensearch","viking","context_search"]),U5=new Set(["apmplus","cozeloop","tls"]),$5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),E0e=new Set(["llm","sequential","parallel","loop","a2a"]);function vt(e,t=""){return typeof e=="string"?e:t}function Ls(e){return e===!0}function Jd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function H5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:vt(t.name),description:vt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Rc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function z5(e){return typeof e=="string"&&E0e.has(e)?e:"llm"}function V5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function K5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Ls(t.enabled),registrySpaceId:vt(t.registrySpaceId),registryTopK:vt(t.registryTopK),registryRegion:vt(t.registryRegion),registryEndpoint:vt(t.registryEndpoint)}}function Y5(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=K5(n.a2aRegistry),i=z5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Pr(),name:vt(n.name),description:vt(n.description),instruction:vt(n.instruction),agentType:a,maxIterations:V5(n.maxIterations),a2aUrl:vt(n.a2aUrl),modelName:vt(n.modelName),modelProvider:vt(n.modelProvider),modelApiBase:vt(n.modelApiBase),builtinTools:Jd(n.builtinTools).filter(l=>$5.has(l)),customTools:H5(n.customTools),memory:{shortTerm:Ls(r.shortTerm),longTerm:Ls(r.longTerm)},shortTermBackend:Rc(n.shortTermBackend,P5,"local"),longTermBackend:Rc(n.longTermBackend,B5,"local"),autoSaveSession:Ls(n.autoSaveSession),knowledgebase:Ls(n.knowledgebase),knowledgebaseBackend:Rc(n.knowledgebaseBackend,F5,Wc),knowledgebaseIndex:vt(n.knowledgebaseIndex),tracing:Ls(n.tracing),tracingExporters:Jd(n.tracingExporters).filter(l=>U5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:Y5(n.subAgents),selectedSkills:W5(n)}}):[]}function W5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=vt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=vt(r.name)||vt(r.slug)||vt(r.skillName)||vt(r.skillId)||"skill",l=vt(r.folder)||a,c=vt(r.description);if(i==="skillhub"){const f=vt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:vt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=vt(m.path),w=vt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=vt(r.skillSpaceId),d=vt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:vt(r.skillSpaceName),skillId:d,version:vt(r.version)})}return t}function nk(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=K5(t.a2aRegistry),i=z5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:vt(u.name),transport:d,url:vt(u.url),authToken:vt(u.authToken),command:vt(u.command),args:Jd(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Pr(),name:vt(t.name)||"my_agent",description:vt(t.description),instruction:vt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:V5(t.maxIterations),a2aUrl:vt(t.a2aUrl),modelName:vt(t.modelName),modelProvider:vt(t.modelProvider),modelApiBase:vt(t.modelApiBase),builtinTools:Jd(t.builtinTools).filter(c=>$5.has(c)),customTools:H5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Ls(n.shortTerm),longTerm:Ls(n.longTerm)},shortTermBackend:Rc(t.shortTermBackend,P5,"local"),longTermBackend:Rc(t.longTermBackend,B5,"local"),autoSaveSession:Ls(t.autoSaveSession),knowledgebase:Ls(t.knowledgebase),knowledgebaseBackend:Rc(t.knowledgebaseBackend,F5,Wc),knowledgebaseIndex:vt(t.knowledgebaseIndex),tracing:Ls(t.tracing),tracingExporters:Jd(t.tracingExporters).filter(c=>U5.has(c)),deployment:{feishuEnabled:Ls(r.feishuEnabled)},subAgents:Y5(t.subAgents),selectedSkills:W5(t)}}function G5(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||gi.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||gi.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||gi.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),(l=e.modelName)!=null&&l.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,A,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(A=_.authToken)!=null&&A.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(G5)),t}function x0e(e){return`# VeADK Agent 结构配置 -# 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+b0e(G5(e))}function w0e(e){const t=y0e(e);return nk(t)}const v0e=[{kind:"custom",icon:EV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:rV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:Zz,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:xV,title:"工作流",desc:"敬请期待",disabled:!0}];function _0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=v0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(w0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(Z6,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(yV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const k0e="modulepreload",N0e=function(e){return"/"+e},GC={},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]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=N0e(c),c in GC)return;GC[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":k0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function q5(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 S0e(e,t){return q5([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function X5(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 qC(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const T0e="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",A0e=(()=>{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 C0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Tn(e,t){e.push(t&255,t>>>8&255)}function ls(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const XC=2048,Gb=20,QC=0;function I0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=C0e(g),y=g.length,b=[];ls(b,67324752),Tn(b,Gb),Tn(b,XC),Tn(b,QC),Tn(b,0),Tn(b,0),ls(b,w),ls(b,y),ls(b,y),Tn(b,m.length),Tn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];ls(m,33639248),Tn(m,Gb),Tn(m,Gb),Tn(m,XC),Tn(m,QC),Tn(m,0),Tn(m,0),ls(m,p.crc),ls(m,p.size),ls(m,p.size),Tn(m,p.nameBytes.length),Tn(m,0),Tn(m,0),Tn(m,0),Tn(m,0),ls(m,0),ls(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];ls(c,101010256),Tn(c,0),Tn(c,0),Tn(c,r.length),Tn(c,r.length),ls(c,l),ls(c,i),Tn(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 R0e=E.lazy(()=>Oc(()=>import("./CodeEditor-hLGWnCAj.js"),[]));function O0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function L0e(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 Q5({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>O0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return L0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(lT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx(Ds,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(SM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return $s.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(mv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(br,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(lT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(R0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function M0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(mv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(Q5,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Lg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx(zt,{className:"spin"}):o.jsx(fV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(iV,{}):o.jsx(kc,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(Vs,{}):o.jsx(l0,{})})]})]})}const j0e=5e4;function D0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` -`),r=t.split(` -`),s=Math.min(n.length,r.length,260);for(let i=s;i>0;i-=1){const a=n.slice(-i).join(` -`),l=r.slice(0,i).join(` -`);if(a===l){const c=r.slice(i).join(` -`);return c?`${e} -${c}`:e}}return`${e} -${t}`}function P0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` -`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function ZC(e,t,n=j0e){const r=D0e((e==null?void 0:e.text)??"",t.text??""),s=P0e(r,n),i=s.text?s.text.split(` -`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}ns.registerLanguage("python",sD);ns.registerLanguage("typescript",gD);ns.registerLanguage("javascript",Z3);ns.registerLanguage("json",J3);ns.registerLanguage("yaml",yD);ns.registerLanguage("markdown",rD);ns.registerLanguage("bash",Y3);ns.registerLanguage("ini",W3);ns.registerLanguage("dockerfile",uJ);ns.registerLanguage("makefile",nD);const B0e=E.lazy(()=>Oc(()=>import("./CodeEditor-hLGWnCAj.js"),[])),La=()=>{};function F0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?$s.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(gV,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(br,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const U0e={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"},JC={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function eI(e){return e.replace(/&/g,"&").replace(//g,">")}function $0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(JC[n])return JC[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 U0e[s]??null}function H0e(e,t){try{const n=$0e(t);return n&&ns.getLanguage(n)?ns.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?ns.highlightAuto(e).value:eI(e)}catch{return eI(e)}}const z0e=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],V0e=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function K0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function Y0e(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 W0e(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function G0e({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[$s.createPortal(e,n.left),$s.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function J0({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:A,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:D,deployDisabled:F=!1}){var qn,Rt,Kt;const W=typeof l=="function",L=f.includes("更新"),U=D?V0e:z0e,[C,M]=E.useState(((Rt=(qn=e==null?void 0:e.files)==null?void 0:qn[0])==null?void 0:Rt.path)??null),[O,j]=E.useState(new Set),[T,z]=E.useState(!1),[G,P]=E.useState(""),[se,Q]=E.useState(!1),[ne,fe]=E.useState(!1),[Z,pe]=E.useState(!1),[J,be]=E.useState(!1),[ye,we]=E.useState(null),[ve,Te]=E.useState(null),[Re,Ke]=E.useState({}),[Oe,mt]=E.useState(null),[Xe,Ye]=E.useState(!1),[ce,Se]=E.useState([]),[st,ct]=E.useState(!1),[q,ee]=E.useState(!1),ge=E.useRef(!0),Pe=de=>o.jsxs("div",{className:"pp-network-region",onKeyDown:ke=>{ke.key==="Escape"&&ee(!1)},children:[de&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":q,disabled:se||L||!A,onClick:()=>ee(ke=>!ke),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(pv,{className:`pp-region-chevron${q?" is-open":""}`})]}),q&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>ee(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(ke=>{const Ie=ke.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":Ie,className:`pp-region-option${Ie?" is-selected":""}`,onClick:()=>{A==null||A(ke.value),ee(!1)},children:[o.jsx("span",{children:ke.label}),Ie&&o.jsx(Vs,{"aria-hidden":"true"})]},ke.value)})})]})]});E.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]),E.useEffect(()=>{if(!Z)return;const de=document.body.style.overflow;document.body.style.overflow="hidden";const ke=Ie=>{Ie.key==="Escape"&&pe(!1)};return window.addEventListener("keydown",ke),()=>{document.body.style.overflow=de,window.removeEventListener("keydown",ke)}},[Z]);const Ge=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:K0e(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const et=e.files.find(de=>de.path===C)??null,$t=(_==null?void 0:_.mode)??"public",bt=S0e(g?[...y,...qu]:y,b),Vt=bt.length+ce.length;function Wt(de){j(ke=>{const Ie=new Set(ke);return Ie.has(de)?Ie.delete(de):Ie.add(de),Ie})}function St(de,ke){l&&(l({...e,files:de}),ke!==void 0&&M(ke))}function Pt(de){et&&St(e.files.map(ke=>ke.path===et.path?{...ke,content:de}:ke))}function je(){const de=G.trim();if(z(!1),P(""),!!de){if(e.files.some(ke=>ke.path===de)){M(de);return}St([...e.files,{path:de,content:""}],de)}}function gt(){if(!et)return;const de=window.prompt("重命名文件",et.path),ke=de==null?void 0:de.trim();!ke||ke===et.path||e.files.some(Ie=>Ie.path===ke)||St(e.files.map(Ie=>Ie.path===et.path?{...Ie,path:ke}:Ie),ke)}function tt(){var ke;if(!et)return;const de=e.files.filter(Ie=>Ie.path!==et.path);St(de,((ke=de[0])==null?void 0:ke.path)??null)}function Ae(de,ke){Se(Ie=>Ie.map(Qe=>Qe.id===de?{...Qe,...ke}:Qe))}function Ht(de){Se(ke=>ke.filter(Ie=>Ie.id!==de))}function Bt(){Se(de=>[...de,W0e()])}function oe(de){k&&k(de==="public"?void 0:{..._??{mode:de},mode:de})}function ze(de){k==null||k({..._??{mode:"private"},...de})}function dt(){const de=new Map(ce.map(Ie=>({key:Ie.key.trim(),value:Ie.value})).filter(Ie=>Ie.key.length>0).map(Ie=>[Ie.key,Ie.value])),ke=g?[...y,...qu]:y;for(const Ie of X5(ke,b))de.set(Ie.key,Ie.value);return[...de].map(([Ie,Qe])=>({key:Ie,value:Qe}))}async function Fn(){if(!(!w||se||J)){we(null),be(!0);try{await w(!g)}catch(de){ge.current&&we(`更新飞书配置失败:${de instanceof Error?de.message:String(de)}`)}finally{ge.current&&be(!1)}}}async function cn(){var ke;if(!c||se||F)return;if($t!=="public"&&!((ke=_==null?void 0:_.vpcId)!=null&&ke.trim())){we("使用 VPC 网络时,请填写 VPC ID。");return}const de=qC(y,b);if(de){const Ie=y.find(Qe=>Qe.key===de.key);we(`请返回配置页填写 ${(Ie==null?void 0:Ie.comment)||(Ie==null?void 0:Ie.key)}(${Ie==null?void 0:Ie.key})。`);return}if(g){const Ie=qC(qu,b);if(Ie){const Qe=qu.find(ft=>ft.key===Ie.key);we(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}fe(!0)}async function Xt(){if(!c||se)return;fe(!1);const de=dt();ge.current&&(we(null),Te(null),Ke({}),mt(null),Q(!0));const ke=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Ie=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ft={id:ke,runtimeName:Ie,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ft),p==null||p(ft);let nt,ie=ft.phase??"prepare";const Ze=Je=>nt?{...nt,status:Je,updatedAt:Date.now()}:void 0,ot=Je=>{const lt=Ze(Je);return lt?{buildLog:lt}:{}},xe=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),ht=Je=>{if(ie!=="build")return;const lt=["","----- 构建失败 -----",Je].join(` -`);return nt=ZC(nt,{source:"code-pipeline",status:"error",text:lt,lineCount:lt.split(` -`).length,truncated:!1,updatedAt:Date.now()}),nt};try{const Je=await c(e,lt=>{var _t;lt.runtimeName&&(Ie=lt.runtimeName),ie=lt.phase,lt.buildLog?nt=ZC(nt,lt.buildLog):lt.phase==="build"&&!nt&&(nt=xe()),ge.current&&(Ke(Gt=>({...Gt,[lt.phase]:lt})),mt(lt.phase)),m==null||m({id:ke,runtimeName:Ie,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:lt.phase,label:((_t=U.find(Gt=>Gt.phase===lt.phase))==null?void 0:_t.label)??lt.phase,message:lt.message,pct:lt.pct,...nt?{buildLog:nt}:{}})},g?{taskId:ke,im:{feishu:{enabled:!0}},envs:de}:{taskId:ke,envs:de});ge.current&&(Te(Je),mt(null)),m==null||m({id:ke,runtimeName:Je.agentName||Ie,runtimeId:Je.runtimeId||h,region:Je.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...ot("complete")});try{await(d==null?void 0:d(Je))}catch(lt){if(!(lt instanceof Ya))throw lt;m==null||m({id:ke,runtimeName:Je.agentName||Ie,runtimeId:Je.runtimeId||h,region:Je.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:lt.message,...ot("complete")})}}catch(Je){const lt=Je instanceof Error?Je.message:String(Je);if(Je instanceof DOMException&&Je.name==="AbortError"){ge.current&&(we(null),mt(null)),m==null||m({id:ke,runtimeName:Ie,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...ot("complete")});return}ge.current&&we(lt);const _t=ht(lt),Gt=!!_t;m==null||m({id:ke,runtimeName:Ie,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:ie,label:"部署失败",message:Gt?"构建镜像失败,详见构建日志。":lt,..._t?{buildLog:_t}:ot("complete"),retry:cn})}finally{ge.current&&Q(!1)}}function Qt(){fe(!1)}async function un(){if(!(!ve||Xe)){Ye(!0),we(null);try{const{addConnection:de,addRuntimeConnection:ke,remoteAppId:Ie,loadConnections:Qe}=await Oc(async()=>{const{addConnection:ie,addRuntimeConnection:Ze,remoteAppId:ot,loadConnections:xe}=await Promise.resolve().then(()=>wT);return{addConnection:ie,addRuntimeConnection:Ze,remoteAppId:ot,loadConnections:xe}},void 0),{probeRuntimeApps:ft}=await Oc(async()=>{const{probeRuntimeApps:ie}=await Promise.resolve().then(()=>QV);return{probeRuntimeApps:ie}},void 0);let nt;if(ve.runtimeId){const ie=ve.region??N,Ze=await ft(ve.runtimeId,ie)??[];nt=ke(ve.runtimeId,ve.agentName,ie,Ze,Ze.length>0?{[Ze[0]]:ve.agentName}:void 0,ve.version)}else nt=await de(ve.agentName,ve.url,ve.apikey,"");if(nt.apps.length===0)we("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const ie={[nt.apps[0]]:ve.agentName},Ze={...nt,appLabels:{...nt.appLabels??{},...ie}},xe=Qe().map(Je=>Je.id===nt.id?Ze:Je);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(xe));const{registerConnections:ht}=await Oc(async()=>{const{registerConnections:Je}=await Promise.resolve().then(()=>wT);return{registerConnections:Je}},void 0);if(ht(xe),u){const Je=Ie(nt.id,nt.apps[0]);u(Je,ve.agentName)}else alert(`🎉 Agent "${ve.agentName}" 已添加到左上角下拉列表!`)}}catch(de){we(`添加 Agent 失败:${de instanceof Error?de.message:String(de)}`)}finally{Ye(!1)}}}function dn(){const de=I0e(e.files),ke=URL.createObjectURL(de),Ie=document.createElement("a");Ie.href=ke,Ie.download=`${e.name||"project"}.zip`,document.body.appendChild(Ie),Ie.click(),document.body.removeChild(Ie),URL.revokeObjectURL(ke)}function Gn(de,ke,Ie){return Y0e(de).map(Qe=>{const ft=Ie?`${Ie}/${Qe.name}`:Qe.name,nt=Qe.path!==void 0,ie={paddingLeft:8+ke*14};if(nt){const ot=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${ot?" pp-active":""}`,style:ie,onClick:()=>M(Qe.path),title:Qe.path,children:[o.jsx(Vz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ft)}const Ze=O.has(ft);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:ie,onClick:()=>Wt(ft),children:[o.jsx(Ds,{className:`pp-ic pp-chevron${Ze?"":" pp-open"}`}),o.jsx(SM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Ze&&Gn(Qe,ke+1,ft)]},ft)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${D?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(G0e,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(hv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!D&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Ag,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>pe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(kc,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx($z,{className:"pp-ic"}),"导出配置文件"]}),W&&l&&o.jsx(M0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:dn,children:[o.jsx(c0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),W&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{z(!0),P("")},children:o.jsx(Hz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[T&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:G,onChange:de=>P(de.target.value),onBlur:je,onKeyDown:de=>{de.key==="Enter"&&je(),de.key==="Escape"&&(z(!1),P(""))}}),e.files.length===0&&!T?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):Gn(Ge,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:et==null?void 0:et.path,children:(et==null?void 0:et.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:W&&et&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:gt,children:o.jsx(cV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:tt,children:o.jsx(pi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:et==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):W?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(B0e,{value:et.content,path:et.path,onChange:Pt})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:H0e(et.content,et.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[D,!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),Pe(!1)]}),!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void Fn(),disabled:g||se||J||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:T0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:J?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void Fn(),disabled:!g||se||J||!w,children:J?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:qu.map(de=>o.jsxs("label",{children:[o.jsxs("span",{children:[de.comment||de.key,de.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:de.key.includes("SECRET")?"password":"text",value:b[de.key]??"",placeholder:de.placeholder,tabIndex:g?0:-1,disabled:!g||se||!x,autoComplete:"off",onChange:ke=>x==null?void 0:x(de.key,ke.currentTarget.value)})]},de.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),D&&Pe(!0),L&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(de=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:de,checked:$t===de,onChange:()=>oe(de),disabled:se||L||!k}),o.jsx("span",{children:de==="public"?"公网":de==="private"?"VPC":"公网 + VPC"})]},de))}),$t!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:se||L,onChange:de=>ze({vpcId:de.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:se||L,onChange:de=>ze({subnetIds:de.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:se||L,onChange:de=>ze({enableSharedInternetAccess:de.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Vt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:st?"隐藏值":"显示值",onClick:()=>ct(de=>!de),children:st?o.jsx(Fz,{className:"pp-ic"}):o.jsx(yv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:Bt,disabled:se,children:[o.jsx(mr,{className:"pp-ic"}),"添加变量"]}),(bt.length>0||ce.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[bt.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[bt.length," 项"]})]}),bt.map(de=>{const ke=de.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:de.key,readOnly:!0,disabled:se,"aria-label":`${de.key} 环境变量名`}),o.jsx("input",{type:ke||st?"text":"password",value:de.value,placeholder:de.required?"必填,尚未填写":"可选,尚未填写",readOnly:ke,disabled:se||!ke&&!x,autoComplete:"off","aria-label":`${de.key} 环境变量值`,onChange:Ie=>x==null?void 0:x(de.key,Ie.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:ke?"自动":"同步"})]},de.key)})]}),ce.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[ce.length," 项"]})]}),ce.map(de=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:de.key,placeholder:"名称",disabled:se,autoComplete:"off",onChange:ke=>Ae(de.id,{key:ke.currentTarget.value})}),o.jsx("input",{type:st?"text":"password",value:de.value,placeholder:"值",disabled:se,autoComplete:"off",onChange:ke=>Ae(de.id,{value:ke.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:se,onClick:()=>Ht(de.id),children:o.jsx(br,{className:"pp-ic"})})]},de.id))]})]}),(se||ve||Object.keys(Re).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:U.map((de,ke)=>{const Ie=Oe?U.findIndex(ie=>ie.phase===Oe):-1,Qe=!!ye&&(Ie===-1?ke===0:ke===Ie);let ft;ve?ft="done":Qe?ft="failed":Ie===-1?ft=se?"active":"pending":kede.phase===Oe))==null?void 0:Kt.label)??Oe}阶段):`:""}${ye}`,onRetry:cn,retryLabel:L?"重试更新":"重试部署"}),ve&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:L?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[ve.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:ve.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:ve.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:ve.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:un,disabled:Xe,children:[Xe?o.jsx(zt,{className:"pp-ic spin"}):o.jsx(CM,{className:"pp-ic"}),Xe?"连接中…":"立即对话"]}),ve.consoleUrl&&o.jsxs("a",{href:ve.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(gv,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:cn,disabled:se||J||F||!!n,title:n,children:se?`${f}中…`:ye?`重试${f}`:f})})]})]}),Z&&r&&$s.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:de=>{de.target===de.currentTarget&&pe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>pe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(br,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Ag,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(F0e,{open:ne,isUpdate:L,onCancel:Qt,onConfirm:()=>void Xt()})]})}const tI="dogfooding",qb="dogfooding",Xb="dogfooding_b";let q0e=0;const Qb=()=>++q0e;function nI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function X0e(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function rI(e){const t=[],n=X0e(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 Mv(nk(a))}catch{}return null}function Q0e({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Qb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[A,S]=E.useState(!1),[R,I]=E.useState({}),D=E.useRef(null),F=E.useRef(null),W=E.useRef(null),L=E.useRef(null),U=E.useRef(null);E.useEffect(()=>{const Q=L.current;Q&&Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const Q=U.current;Q&&(Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,160)+"px")},[l]);const C=Q=>a(ne=>[...ne,{id:Qb(),role:"assistant",text:Q}]);async function M(){if(D.current)return D.current;const Q=await tg(tI,e);return D.current=Q,Q}async function O(Q,ne){if(ne.current)return ne.current;const fe=await tg(Q,e);return ne.current=fe,fe}async function j(Q,ne){if(!R[Q])try{const fe=await Rv(ne);I(Z=>({...Z,[Q]:fe.model||ne}))}catch{I(fe=>({...fe,[Q]:ne}))}}async function T(Q,ne,fe){const Z=await O(Q,ne);let pe=ci();for await(const be of Nf({appName:Q,userId:e,sessionId:Z,text:fe}))pe=Vc(pe,be);const J=nI(pe).trim();return{project:await rI(J),finalText:J}}const z=async(Q,ne,fe)=>p0(Q.name,Q.files,{region:"cn-beijing",projectName:"default"},{...fe,onStage:ne}),G=async()=>{const Q=l.trim();if(!(!Q||u)){if(a(ne=>[...ne,{id:Qb(),role:"user",text:Q}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),j("a",qb),j("b",Xb);const ne=T(qb,F,Q).then(({project:Z})=>(b(Z),Z)).catch(Z=>{const pe=Z instanceof Error?Z.message:String(Z);return h(pe),null}).finally(()=>N(!1)),fe=T(Xb,W,Q).then(({project:Z})=>(_(Z),Z)).catch(Z=>{const pe=Z instanceof Error?Z.message:String(Z);return h(pe),null}).finally(()=>S(!1));try{const[Z,pe]=await Promise.all([ne,fe]),J=[Z?`方案 A:${Z.name}`:null,pe?`方案 B:${pe.name}`:null].filter(Boolean);J.length?C(`已生成两个方案(${J.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await M();let fe=ci();for await(const J of Nf({appName:tI,userId:e,sessionId:ne,text:Q}))fe=Vc(fe,J);const Z=nI(fe).trim(),pe=await rI(Z);pe?(m(pe),C(`已生成项目:${pe.name}(${pe.files.length} 个文件),可在右侧预览和编辑。`)):C(Z||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const fe=ne instanceof Error?ne.message:String(ne);h(fe),C(`抱歉,调用智能构建助手失败:${fe}`)}finally{d(!1)}}},P=Q=>{const ne=Q==="a"?y:x;if(!ne)return;m(ne),w(!1),b(null),_(null),N(!1),S(!1);const fe=Q==="a"?"A":"B",Z=Q==="a"?R.a:R.b;C(`已采用方案 ${fe}(${Z??(Q==="a"?qb:Xb)}),可继续编辑。`)},se=Q=>{Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),G())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:L,children:[o.jsx(oi,{initial:!1,children:i.map(Q=>o.jsxs(en.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"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:Q.role==="assistant"?o.jsx(fh,{text:Q.text}):Q.text})]},Q.id))}),u&&o.jsxs(en.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(o0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:Q=>c(Q.target.value),onKeyDown:se,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(hV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:Q=>w(Q.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(sI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>P("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(sI,{side:"b",project:x,loading:A,model:R.b,onAdopt:()=>P("b")})]}):p?o.jsx(J0,{project:p,onChange:m,onDeploy:z,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(Yz,{className:"ic-preview-empty-glyph"}),o.jsx(al,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function sI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx(zt,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(J0,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const Z0e=/^[A-Za-z_][A-Za-z0-9_]*$/;function Lc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":Z0e.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function Z5(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 J0e({className:e,...t}){return o.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:[o.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"}),o.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 ad={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:J0e},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:Wz},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:mV},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:wv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:u0}},eye=[ad.llm,ad.sequential,ad.parallel,ad.loop,ad.a2a],J5=e=>e==="sequential"||e==="parallel"||e==="loop",ey=e=>e==="a2a";function zs(e){return e.trimEnd().replace(/[。.]+$/,"")}function Mg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function To(e,t){return e[t]|e[t+1]<<8}function Ul(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function tye(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 eB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Ul(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=To(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=Ul(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=To(e,w+26),x=To(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await tye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const nye="/skillhub/v1/skills";async function rye(e,t="public"){const n=e.trim(),r=`${nye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:mi(void 0,gu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function sye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await rye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(kf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx(zt,{className:"cw-i cw-spin"}):o.jsx(kf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Vs,{className:"cw-i cw-i-sm"}):o.jsx(mr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:zs(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const Lx=/(^|\/)skill\.md$/i;function iye(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 oye(...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 lye(e,t){return t.trim()||e}function tB(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 cye(e){const t=new Map,n=new Set;for(const r of e)if(Lx.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=Lx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function uye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>Lx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=iye(s.text),a=oye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:lye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function dye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await eB(t)).map(s=>({path:s.name,text:s.text}));return nB(tB(r),e.name)}async function fye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function pye(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 rB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await hye(e),path:n}];if(!e.isDirectory)return[];const r=await pye(e);return(await Promise.all(r.map(s=>rB(s,n)))).flat()}function mye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const A=[...x.errors];if(k.length>0&&A.push(`已跳过重复技能:${k.join("、")}`),r(A),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>rB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await dye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(k.map(({file:S,path:R})=>[S,R]));g(await fye(k.map(({file:S})=>S),A))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(Ev,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(Vs,{className:"cw-i cw-i-sm"}):o.jsx(mr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:zs(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function gye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Nj();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Sj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=WK(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(zt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${zs(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:GK(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(gv,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(zt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(Vs,{className:"cw-i cw-i-sm"}):o.jsx(mr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:zs(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(jz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function yye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:mi(void 0,gu)});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 bye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await yye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Eye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:mi(void 0,gu)});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 xye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Eye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const iI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function Zb(e){let t=0;for(let n=0;n>>0;return iI[t%iI.length]}function wye(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)),l=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:l,total:c-l||1}}function vye(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 aI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const _ye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function oI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:_ye(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function sB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=hj(t,n);else if(e)_=XM(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,A)=>N.start_time<=A.start_time?N:A).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>wye(i??[]),[i]),w=E.useMemo(()=>vye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(br,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(zt,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,A=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx(Ds,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:Zb(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:aI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${A}%`,background:Zb(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:Zb(y.name)}}),aI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:oI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),oI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const kye=E.lazy(()=>Oc(()=>import("./MarkdownPromptEditor-CU7OD4-3.js"),__vite__mapDeps([0,1]))),Mx="veadk.generatedAgentTestRuns";function rk(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Mx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function iB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Mx,JSON.stringify(t)):window.sessionStorage.removeItem(Mx)}catch{}}function Nye(e){iB([...rk(),e])}function od(e){iB(rk().filter(t=>t!==e))}function Sye(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 lI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:pV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:mo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Pz},{id:"tools",label:"工具",hint:"可调用的能力",icon:OM},{id:"skills",label:"技能",hint:"声明式技能",icon:al},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:nm},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:TM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:_M},{id:"review",label:"完成",hint:"预览并创建",icon:dV}];function Tye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function aB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function oB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Aye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},cI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},uI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},lB="REGISTRY_SPACE_ID",Cye=Tj.filter(e=>e.key!==lB);function cB(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())||gi.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||gi.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||gi.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function dI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(Vs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:zs(s.desc)})]})]},s.id)})})}function Jb({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:zs(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:zs(r.desc)})]},r.id)})})}function Iye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function $l({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:Iye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function e1(e){return e.name.trim()||"未命名智能体中心"}function t1(e){return e.name.trim()||e.id||"未命名知识库"}function Rye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||gi.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),bye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?e1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>Mg(g,[e1(R),R.id,R.projectName])),[g,i]),A=!!(e&&!b&&Mg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=D=>{const F=D.target;F instanceof Node&&y.current&&!y.current.contains(F)&&m(!1)},I=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(aB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[A&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=e1(R),D=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":D,className:`cw-a2a-space-option ${D?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!A&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx(zt,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(oB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(zt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Oye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),xye().then(A=>{N||r(A)}).catch(A=>{N||(r([]),l(A instanceof Error?A.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?t1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>Mg(h,[t1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&Mg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},A=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",A),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",A)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(aB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const A=t1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${A} (${N.id})`,onClick:()=>k(N.id),children:A},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx(zt,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(oB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(zt,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Lye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(oi,{initial:!1,children:e.map((i,a)=>o.jsxs(en.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(pi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(mr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function uB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Mye({s:e,onRemove:t}){let n=al,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Ev,r="本地"):e.source==="skillspace"&&(n=uB,r="AgentKit Skills 中心"),o.jsxs(en.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${zs(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(br,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const n1=[{id:"local",label:"本地文件",icon:Ev},{id:"skillspace",label:"AgentKit Skills 中心",icon:uB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:u0}];function jye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=n1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>r1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(mr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(oi,{initial:!1,children:e.map(c=>o.jsx(Mye,{s:c,onRemove:()=>l(r1(c))},r1(c)))})})]}),o.jsx(oi,{children:s&&o.jsx(en.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:o.jsxs(en.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(br,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${n1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),n1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(sye,{selected:e,onChange:t}),n==="local"&&o.jsx(mye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(gye,{selected:e,onChange:t})]})]})]})})})]})}function r1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function ld({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:zs(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(en.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Dye(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 Pp(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Sh(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Sh(i[r],s,n),{...e,subAgents:i}}function Pye(e,t){return Sh(e,t,n=>({...n,subAgents:[...n.subAgents,Pr()]}))}function Bye(e,t,n){return Sh(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Pr()),{...r,subAgents:s}})}function Fye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Sh(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const jx=e=>!ey(e.agentType),fI=3;function Uye(e,t,n=!1){var s;if(ey(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?"缺少描述":J5(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function dB(e,t,n=[]){const r=[],s=ey(e.agentType),i=Uye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),jx(e)&&e.subAgents.forEach((a,l)=>r.push(...dB(a,t,[...n,l]))),r}function fB(e){return 1+e.subAgents.reduce((t,n)=>t+fB(n),0)}function hB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=ol.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Tj}),Object.assign(n,cB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=PE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=BE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=FE.find(d=>d.id===(i.knowledgebaseBackend??Wc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=UE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=q5(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function pB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function $ye(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 mB(e){var r,s;const t=hB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...pB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(X5(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Hye(e){return JSON.stringify(mB(e))}function jg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function yc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function zye({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===jg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),A=yc(b),S=!!(_&&k&&N&&n.findIndex(O=>yc(O)===A)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==jg(r,b)),D=b.phase==="starting",F=b.phase==="ready"&&!I,W=D||b.phase==="sending",L=F&&b.phase!=="sending"&&b.messages.some(O=>O.role==="assistant"),U=W||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",M=D?"正在启动":I?"应用配置并重启":F||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||W,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||W,onClick:()=>d(b.id),children:o.jsx(pi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Lg,{message:b.error,className:"cw-debug-error-detail"}):D?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(zt,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:F?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((O,j)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${O.role}`,children:o.jsx("div",{className:"cw-debug-content",children:O.role==="user"?O.content:O.error?o.jsx(Lg,{message:O.error,className:"cw-debug-msg-error"}):O.blocks&&O.blocks.length>0?o.jsx(F_,{blocks:O.blocks,onAction:()=>{}}):O.content?O.content:j===b.messages.length-1&&b.phase==="sending"?o.jsx(q6,{}):null})},j))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:U,title:C||void 0,onClick:()=>l(b.id),children:[F||I||b.phase==="error"?o.jsx(RM,{className:"cw-i"}):o.jsx(Tye,{className:"cw-i cw-debug-run-icon"}),M]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:W||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:O=>p(b.id,"modelName",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:O=>p(b.id,"description",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:O=>p(b.id,"instruction",O.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:gB.map(O=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(O.id),disabled:!0}),o.jsx("span",{children:O.label})]},O.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(mr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{X6(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx(zt,{className:"cw-i cw-spin"}):o.jsx(wM,{className:"cw-i"})})]})})]})}const hI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],gB=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Vye({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=hI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:hI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function Kye({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var va,ar,Eo,_a,Tl,Al,ka,Yi,Na,Cl,H,re,le,Fe,Nt;const[h,p]=E.useState(()=>r??Pr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),A=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var Y;S!==A.current&&(A.current=S,(Y=I.current)==null||Y.call(I,h,R))},[h,R,S]);const[D,F]=E.useState("build"),[W,L]=E.useState(!1),[U,C]=E.useState(!1),[M,O]=E.useState(0),[j,T]=E.useState(null),[z,G]=E.useState(!1),[P,se]=E.useState((a==null?void 0:a.region)??l),Q=(s==null?void 0:s.generatedAgentTestRun)===!0,ne=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[fe,Z]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Pr()).modelName??"",description:(r??Pr()).description,instruction:(r??Pr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[pe,J]=E.useState("baseline"),be=E.useRef(1),ye=E.useRef(new Map),[we,ve]=E.useState(0),[Te,Re]=E.useState(""),[Ke,Oe]=E.useState(null),[mt,Xe]=E.useState("basic"),[Ye,ce]=E.useState(""),[Se,st]=E.useState(!1),[ct,q]=E.useState(!1),[ee,ge]=E.useState(!1),[Pe,Ge]=E.useState(!1),[et,$t]=E.useState([]),bt=E.useRef(null),Vt=E.useRef({});async function Wt(){const Y=new Set([...ye.current.values()].map(({run:Ue})=>Ue.runId)),ue=rk().filter(Ue=>!Y.has(Ue));ue.length&&await Promise.all(ue.map(async Ue=>{try{await zl(Ue),od(Ue)}catch($e){console.warn("清理遗留调试运行失败",$e)}}))}E.useEffect(()=>(Wt(),()=>{for(const{run:Y}of ye.current.values())zl(Y.runId).then(()=>od(Y.runId)).catch(ue=>console.warn("清理调试运行失败",ue));ye.current.clear()}),[]);const St=E.useRef(null);St.current||(St.current=({meta:Y,children:ue})=>o.jsxs("section",{ref:Ue=>{Vt.current[Y.id]=Ue},id:`cw-sec-${Y.id}`,"data-step-id":Y.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[Y.label,Y.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ue]}));const Pt=Dye(h,et)?et:[],je=Pp(h,Pt),gt=Pt.length===0,tt=`cw-model-advanced-${Pt.join("-")||"root"}`,Ae=`cw-a2a-registry-advanced-${Pt.join("-")||"root"}`,Ht=`cw-more-tool-types-${Pt.join("-")||"root"}`,Bt=`cw-advanced-config-${Pt.join("-")||"root"}`,oe=Y=>p(ue=>Sh(ue,Pt,Ue=>({...Ue,...Y}))),ze=(Y,ue)=>p(Ue=>{var $e;return{...Ue,deployment:{...Ue.deployment??{feishuEnabled:!1},envValues:{...(($e=Ue.deployment)==null?void 0:$e.envValues)??{},[Y]:ue}}}}),dt=Y=>oe({a2aRegistry:{...je.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...Y}}),Fn=(Y,ue)=>{if(!(Y in uI))return;const Ue=uI[Y];dt({[Ue]:ue}),ze(Y,ue)},cn=Y=>{if(!(gt&&Y==="a2a")){if(Y==="a2a"){oe({agentType:Y,a2aRegistry:{...je.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}oe({agentType:Y,a2aRegistry:je.a2aRegistry?{...je.a2aRegistry,enabled:!1}:void 0})}},Xt=(Y,ue)=>{p(Y),ue&&$t(ue)},Qt=async()=>{const Y=m.trim();if(!(!Y||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),ce("");try{const ue=await uj(Y);p(nk(ue.draft)),$t([]),T(null),C(!1),ce(""),x(!0)}catch(ue){k(ue instanceof Error?ue.message:"生成 Agent 配置失败")}finally{y(!1)}}},un=Y=>{const ue=Pp(h,Y);if(!jx(ue)||Y.length>=fI)return;const Ue=Pye(h,Y),$e=Pp(Ue,Y).subAgents.length-1;Xt(Ue,[...Y,$e])},dn=(Y,ue)=>{const Ue=Pp(h,Y);if(!jx(Ue)||Y.length>=fI)return;const $e=Math.max(0,Math.min(ue,Ue.subAgents.length)),At=Bye(h,Y,$e);Xt(At,[...Y,$e])},Gn=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Pr()),$t([]),C(!1),Ge(!1))},qn=Y=>{if(Y.length===0){Gn();return}Xt(Fye(h,Y),Y.slice(0,-1))},Rt=je.builtinTools??[],Kt=je.mcpTools??[],de=je.tracingExporters??[],ke=je.selectedSkills??[],Ie=[je.memory.shortTerm,je.memory.longTerm,je.tracing].filter(Boolean).length,Qe=Y=>oe({builtinTools:Rt.includes(Y)?Rt.filter(ue=>ue!==Y):[...Rt,Y]}),ft=Y=>{const ue=de.includes(Y)?de.filter(Ue=>Ue!==Y):[...de,Y];oe({tracingExporters:ue,tracing:ue.length>0?!0:je.tracing})},nt=J5(je.agentType),ie=ey(je.agentType),Ze=E.useMemo(()=>Z5(h),[h]),ot=ie?null:Lc(je.name)??(Ze.has(je.name)?"Agent 名称在当前结构中必须唯一":null),xe=ot!==null,ht=!ie&&je.description.trim().length===0,Je=je.instruction.trim().length===0,lt=ie&&!((va=je.a2aRegistry)!=null&&va.registrySpaceId.trim()),_t=Y=>U&&Y?`is-error cw-error-shake-${M%2}`:"",Gt=E.useMemo(()=>dB(h,Ze),[h,Ze]),bn=Gt.length===0,En=E.useMemo(()=>Hye(h),[h]),tn=fe.find(Y=>Y.id===pe)??fe[0],Nn=E.useMemo(()=>hB(h),[h]),Et=E.useMemo(()=>{var Y,ue,Ue,$e;return{type:!0,basic:ie?!lt:!xe&&(nt||!Je),model:!!((Y=je.modelName)!=null&&Y.trim()||(ue=je.modelProvider)!=null&&ue.trim()||(Ue=je.modelApiBase)!=null&&Ue.trim()),tools:Rt.length>0||Kt.length>0,skills:ke.length>0,knowledge:je.knowledgebase,advanced:je.memory.shortTerm||je.memory.longTerm||je.tracing,subagents:((($e=je.subAgents)==null?void 0:$e.length)??0)>0,review:bn}},[je,xe,Je,nt,ie,bn,Rt,Kt,ke]),On=nt||ie?["type","basic"]:["type","basic","model","tools","skills","knowledge",...gt?["advanced"]:[]],Mt=lI.filter(Y=>On.includes(Y.id)),Ln=On.join("|"),Hr=Pt.join("."),Mn=Mt.findIndex(Y=>Y.id===mt),fn=Y=>{var ue;(ue=Vt.current[Y])==null||ue.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(j)return;const Y=bt.current;if(!Y)return;const ue=Ln.split("|");let Ue=0;const $e=()=>{Ue=0;const Ft=ue[ue.length-1];let jn=ue[0];if(Y.scrollTop+Y.clientHeight>=Y.scrollHeight-2)jn=Ft;else{const jt=Y.getBoundingClientRect().top+24;for(const Xn of ue){const xt=Vt.current[Xn];if(!xt||xt.getBoundingClientRect().top>jt)break;jn=Xn}}jn&&Xe(jt=>jt===jn?jt:jn)},At=()=>{Ue||(Ue=window.requestAnimationFrame($e))};return $e(),Y.addEventListener("scroll",At,{passive:!0}),window.addEventListener("resize",At),()=>{Y.removeEventListener("scroll",At),window.removeEventListener("resize",At),Ue&&window.cancelAnimationFrame(Ue)}},[j,Ln,Hr]);const fr=()=>bn?!0:(C(!0),O(Y=>Y+1),Gt[0]&&($t(Gt[0].path),window.requestAnimationFrame(()=>fn("basic"))),!1),Cr=async()=>{Oe(null);const Y=[...ye.current.values()];ye.current.clear(),ve(0),Z(ue=>ue.map(Ue=>({...Ue,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(Y.map(async({run:ue})=>{try{await zl(ue.runId),od(ue.runId)}catch(Ue){console.warn("清理调试运行失败",Ue)}}))},Ys=async Y=>{const ue=ye.current.get(Y);if(ue){ye.current.delete(Y),ve(ye.current.size);try{await zl(ue.run.runId),od(ue.run.runId)}catch(Ue){console.warn("清理调试运行失败",Ue)}}},ss=Y=>{const ue=ye.current.get(Y),Ue=fe.find($e=>$e.id===Y);!ue||!Ue||Oe({runId:ue.run.runId,sessionId:ue.sessionId,variantName:Ue.name})},ir=async()=>D!=="validate"||we===0?!0:window.confirm("离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。")?(await Cr(),!0):!1,Ir=async Y=>{if(await ir()){if(ce(""),!fr()){F("build");return}G(!0);try{const ue=Y?fe.find(At=>At.id===Y):tn;ue&&J(ue.id);const Ue=ue?{...h,modelName:ue.modelName||h.modelName,description:ue.description,instruction:ue.instruction}:h,$e=await Mv(pB(Ue));Ue!==h&&p(Ue),T($e),F("publish")}catch(ue){ce(ue instanceof Error?ue.message:String(ue))}finally{G(!1)}}},_i=async Y=>{if(!Q||z||!fr())return;const ue=fe.find(Un=>Un.id===Y);if(!ue||ue.phase==="starting"||ue.phase==="sending")return;const Ue=ue.modelName.trim(),$e=ue.description.trim(),At=ue.instruction.trim(),Ft=yc(ue),jn=fe.findIndex(Un=>Un.id===Y),jt=fe.findIndex(Un=>yc(Un)===Ft);if(!Ue||!$e||!At||jt!==jn)return;const Xn=jg(En,ue);Z(Un=>Un.map(Yt=>Yt.id===Y?{...Yt,configOpen:!1,phase:"starting",messages:[],error:null}:Yt)),Re("");let xt=null;try{await Ys(Y),await Wt();const Un={...h,modelName:ue.modelName||h.modelName,description:ue.description,instruction:ue.instruction};xt=await dj(mB(Un)),Nye(xt.runId);const Yt=await fj(xt.runId,"test_user");ye.current.set(Y,{run:xt,sessionId:Yt}),ve(ye.current.size),Z(_s=>_s.map(Gs=>Gs.id===Y?{...Gs,phase:"ready",runtimeSnapshot:Xn}:Gs))}catch(Un){if(xt)try{await zl(xt.runId),od(xt.runId)}catch(Yt){console.warn("清理调试运行失败",Yt)}Z(Yt=>Yt.map(_s=>_s.id===Y?{..._s,phase:"error",runtimeSnapshot:"",error:Un instanceof Error?Un.message:String(Un)}:_s))}},xa=async()=>{const Y=Te.trim(),ue=fe.filter($e=>$e.phase==="ready"&&$e.runtimeSnapshot===jg(En,$e)&&ye.current.has($e.id));if(!Y||ue.length===0)return;Re("");const Ue=new Set(ue.map($e=>$e.id));Z($e=>$e.map(At=>Ue.has(At.id)?{...At,phase:"sending",messages:[...At.messages,{role:"user",content:Y},{role:"assistant",content:"",blocks:[]}]}:At)),await Promise.all(ue.map(async $e=>{const At=ye.current.get($e.id);if(At)try{let Ft=ci();for await(const jn of pj({runId:At.run.runId,userId:"test_user",sessionId:At.sessionId,text:Y})){const jt=jn.error||jn.errorMessage||jn.error_message;if(Z(Xn=>Xn.map(xt=>{if(xt.id!==$e.id)return xt;const Un=[...xt.messages],Yt={...Un[Un.length-1]};return jt?Yt.error=String(jt):(Ft=Vc(Ft,jn),Yt.content=Ft.blocks.filter(_s=>_s.kind==="text").map(_s=>_s.text).join(""),Yt.blocks=Ft.blocks),Un[Un.length-1]=Yt,{...xt,messages:Un}})),jt)break}}catch(Ft){Z(jn=>jn.map(jt=>{if(jt.id!==$e.id)return jt;const Xn=[...jt.messages],xt={...Xn[Xn.length-1]};return xt.error=Ft instanceof Error?Ft.message:String(Ft),Xn[Xn.length-1]=xt,{...jt,messages:Xn}}))}finally{Z(Ft=>Ft.map(jn=>jn.id===$e.id?{...jn,phase:"ready"}:jn))}}))},bo=()=>{Z(Y=>{if(Y.length>=3)return Y;const ue=be.current++,Ue=`variant-${ue}`;return[...Y,{id:Ue,name:`对照组 ${ue}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},zr=async Y=>{await Ys(Y),Z(ue=>ue.filter(Ue=>Ue.id!==Y)),pe===Y&&J("baseline")},Ki=(Y,ue)=>Z(Ue=>Ue.map($e=>$e.id===Y?{...$e,...ue}:$e)),wa=(Y,ue,Ue)=>{Ki(Y,{[ue]:Ue}),!(pe!==Y||Y==="baseline")&&J("baseline")},ki=Y=>{const ue=fe.find(Xn=>Xn.id===Y);if(!ue)return;const Ue=ue.modelName.trim(),$e=ue.description.trim(),At=ue.instruction.trim(),Ft=yc(ue),jn=fe.findIndex(Xn=>Xn.id===Y),jt=fe.findIndex(Xn=>yc(Xn)===Ft);if(!(!Ue||!$e||!At||jt!==jn)){if(Y==="baseline"){Ki(Y,{configOpen:!1});return}_i(Y)}},Nl=async(Y,ue,Ue)=>{var Ft;const $e=(Ft=h.deployment)==null?void 0:Ft.network,At=$e&&$e.mode&&$e.mode!=="public"?{mode:$e.mode,vpc_id:$e.vpcId,subnet_ids:$e.subnetIds,enable_shared_internet_access:$e.enableSharedInternetAccess}:void 0;return p0(Y.name,Y.files,{region:(a==null?void 0:a.region)??P,projectName:"default",network:At},{...Ue,onStage:ue,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},ws=()=>{fr()&&(Z(Y=>Y.map(ue=>ue.id==="baseline"&&!ye.current.has(ue.id)?{...ue,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:ue)),F("validate"))},Sl=async Y=>{if(Y==="publish"){j?F("publish"):Ir();return}if(Y==="validate"){ws();return}await ir()&&F(Y)},Ws=St.current,vs=Y=>lI.find(ue=>ue.id===Y);return o.jsxs("div",{className:"cw-root",children:[o.jsx(Vye,{mode:D,agentName:$ye(h),busy:z,onChange:Sl,onDiscard:f?()=>{R?L(!0):f()}:void 0}),Ye&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:Ye}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[D==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(oi,{initial:!1,mode:"wait",children:b?o.jsxs(en.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(en.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:Y=>{Y.preventDefault(),Qt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:Y=>g(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),Qt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Ag,{draft:h,direction:"vertical",selectedPath:Pt,onSelect:$t,onAdd:un,onInsert:dn,onDelete:qn}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:bt,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsx(Ws,{meta:vs("type"),children:o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:eye.map(Y=>{const ue=(je.agentType??"llm")===Y.id,Ue=gt&&Y.id==="a2a",$e=Ue?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":Y.id,className:`cw-agent-type-option ${ue?"is-on":""} ${Ue?"is-disabled":""}`,title:Ue?void 0:cI[Y.id],tabIndex:Ue?0:void 0,"aria-describedby":$e,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:ue,disabled:Ue,onChange:()=>cn(Y.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Aye[Y.id]}),o.jsx("small",{children:cI[Y.id]})]}),Ue&&o.jsx("span",{id:$e,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},Y.id)})})}),o.jsx(Ws,{meta:vs("basic"),children:o.jsxs("div",{className:"cw-form",children:[!ie&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[gt?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${_t(xe)}`,value:je.name,placeholder:"customer_service",onChange:Y=>oe({name:Y.target.value})}),U&&ot?o.jsx("span",{className:"cw-error-text",children:ot}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[gt?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${_t(ht)}`,value:je.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:Y=>oe({description:Y.target.value})}),U&&ht?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:gt?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),nt?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),je.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:je.maxIterations??3,onChange:Y=>oe({maxIterations:Math.max(1,Number(Y.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):ie?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(Rye,{value:((ar=je.a2aRegistry)==null?void 0:ar.registrySpaceId)??"",region:((Eo=je.a2aRegistry)==null?void 0:Eo.registryRegion)||gi.region,invalid:U&<,onChange:Y=>Fn(lB,Y)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ct,"aria-controls":Ae,onClick:()=>q(Y=>!Y),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${ct?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ct&&o.jsx(en.div,{id:Ae,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:o.jsx($l,{env:Cye,values:cB(je.a2aRegistry,{includeDefaults:!1}),onChange:Fn})})}),U&<&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(kye,{value:je.instruction,invalid:Je,onChange:Y=>oe({instruction:Y})})}),U&&Je?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!nt&&!ie&&o.jsxs(o.Fragment,{children:[o.jsx(Ws,{meta:vs("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:je.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:Y=>oe({modelName:Y.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Se,"aria-controls":tt,onClick:()=>st(Y=>!Y),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${Se?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:Se&&o.jsxs(en.div,{id:tt,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:je.modelProvider??"",placeholder:"openai",onChange:Y=>oe({modelProvider:Y.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:je.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:Y=>oe({modelApiBase:Y.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(Ws,{meta:vs("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(dI,{items:ol,selected:Rt,onToggle:Qe,scrollRows:6})}),o.jsx(oi,{initial:!1,children:Rt.includes("run_code")&&o.jsxs(en.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx($l,{env:((_a=ol.find(Y=>Y.id==="run_code"))==null?void 0:_a.env)??[],values:((Tl=h.deployment)==null?void 0:Tl.envValues)??{},onChange:ze})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ee,"aria-controls":Ht,onClick:()=>ge(Y=>!Y),children:[o.jsx("span",{children:"更多类型工具"}),Kt.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Kt.length]}),o.jsx(Ds,{className:`cw-more-options-chevron ${ee?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ee&&o.jsx(en.div,{id:Ht,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(Lye,{tools:Kt,onChange:Y=>oe({mcpTools:Y})})]})})})]})}),o.jsx(Ws,{meta:vs("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(jye,{selected:ke,onChange:Y=>oe({selectedSkills:Y})})})}),o.jsx(Ws,{meta:vs("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ld,{checked:je.knowledgebase,onChange:Y=>oe({knowledgebase:Y}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:nm}),je.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(Jb,{options:FE,value:je.knowledgebaseBackend,onChange:Y=>oe({knowledgebaseBackend:Y,knowledgebaseIndex:Y==="viking"?je.knowledgebaseIndex:""})}),(je.knowledgebaseBackend??Wc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(Oye,{value:je.knowledgebaseIndex??"",onChange:Y=>oe({knowledgebaseIndex:Y})})]}),o.jsx($l,{env:((Al=FE.find(Y=>Y.id===(je.knowledgebaseBackend??Wc)))==null?void 0:Al.env)??[],values:((ka=h.deployment)==null?void 0:ka.envValues)??{},onChange:ze})]})]})}),gt&&o.jsxs("section",{ref:Y=>{Vt.current.advanced=Y},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Pe,"aria-controls":Bt,onClick:()=>Ge(Y=>!Y),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx(Ds,{className:`cw-advanced-disclosure-chevron ${Pe?"is-open":""}`,"aria-hidden":!0}),Ie>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Ie]})]}),o.jsx(oi,{initial:!1,children:Pe&&o.jsxs(en.div,{id:Bt,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ld,{checked:je.memory.shortTerm,onChange:Y=>oe({memory:{...je.memory,shortTerm:Y}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:TM}),je.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(Jb,{options:PE,value:je.shortTermBackend,onChange:Y=>oe({shortTermBackend:Y})}),o.jsx($l,{env:((Yi=PE.find(Y=>Y.id===(je.shortTermBackend??"local")))==null?void 0:Yi.env)??[],values:((Na=h.deployment)==null?void 0:Na.envValues)??{},onChange:ze})]}),o.jsx(ld,{checked:je.memory.longTerm,onChange:Y=>oe({memory:{...je.memory,longTerm:Y}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:nm}),je.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(Jb,{options:BE,value:je.longTermBackend,onChange:Y=>oe({longTermBackend:Y})}),o.jsx($l,{env:((Cl=BE.find(Y=>Y.id===(je.longTermBackend??"local")))==null?void 0:Cl.env)??[],values:((H=h.deployment)==null?void 0:H.envValues)??{},onChange:ze}),o.jsx(ld,{checked:!!je.autoSaveSession,onChange:Y=>oe({autoSaveSession:Y}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:nm})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ld,{checked:je.tracing,onChange:Y=>oe({tracing:Y}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:yv}),je.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(dI,{items:UE,selected:de,onToggle:ft}),o.jsx($l,{env:UE.filter(Y=>de.includes(Y.id)).flatMap(Y=>Y.env),values:((re=h.deployment)==null?void 0:re.envValues)??{},onChange:ze})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(en.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Mn,0)/Math.max(Mt.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),Mt.map(Y=>{const ue=Y.id===mt,Ue=Et[Y.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${ue?"is-active":""} ${Ue?"is-done":""}`,onClick:()=>fn(Y.id),"aria-current":ue?"step":void 0,"aria-label":Y.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ue?o.jsx("span",{className:"cw-dot"}):Ue?o.jsx(Vs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:Y.label})]})},Y.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:ws,children:o.jsx("span",{children:"开始调试"})})]})]})]}),D==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(zye,{enabled:Q,disabledReason:ne,variants:fe,draftSnapshot:En,input:Te,onInput:Re,onSend:xa,onStartVariant:_i,onDeployVariant:Y=>void Ir(Y),onAddVariant:bo,onRemoveVariant:zr,onToggleConfig:Y=>{const ue=fe.find(Ue=>Ue.id===Y);ue&&Ki(Y,{configOpen:!ue.configOpen})},onCompleteConfig:ki,onConfigChange:wa,onOpenTrace:ss})})}),D==="publish"&&o.jsx("div",{className:"cw-preview-body",children:j?o.jsx(J0,{embedded:!0,project:j,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:fB(h),releaseConfiguration:tn?{modelName:tn.modelName||h.modelName||"默认模型",description:tn.description,instruction:tn.instruction,optimizations:tn.optimizations.flatMap(Y=>{const ue=gB.find(Ue=>Ue.id===Y);return ue?[ue.label]:[]})}:void 0,onChange:T,onDeploy:Nl,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((le=h.deployment)!=null&&le.feishuEnabled),onFeishuEnabledChange:Y=>{const ue={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:Y}};p(ue)},deploymentEnv:Nn.specs,deploymentEnvValues:{...(Fe=h.deployment)==null?void 0:Fe.envValues,...Nn.fixedValues},onDeploymentEnvChange:ze,network:(Nt=h.deployment)==null?void 0:Nt.network,onNetworkChange:Y=>p(ue=>({...ue,deployment:{...ue.deployment??{feishuEnabled:!1},network:Y}})),deployRegion:P,onDeployRegionChange:se,onExportYaml:()=>Sye(`${h.name||"agent"}.yaml`,x0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(zt,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),Ke&&o.jsx(sB,{testRunId:Ke.runId,sessionId:Ke.sessionId,title:`调用链路 · ${Ke.variantName}`,onClose:()=>Oe(null)}),W&&o.jsx("div",{className:"confirm-scrim",onClick:()=>L(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:Y=>Y.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>L(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{L(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:Y=>Y.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function Xi(e){return{...Pr(),...e}}const Yye=[{id:"support",icon:Xz,draft:Xi({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Lz,draft:Xi({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:Qz,draft:Xi({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:mv,draft:Xi({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:sV,draft:Xi({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:bV,draft:Xi({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Xi({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Xi({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Xi({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Wye(e){const t=[];return e.tools.length&&t.push({icon:OM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:Oz,label:"记忆"}),e.knowledgebase&&t.push({icon:Rz,label:"知识库"}),e.tracing&&t.push({icon:Cz,label:"观测"}),e.subAgents.length&&t.push({icon:IM,label:`子Agent ${e.subAgents.length}`}),t}function Gye({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(Xye,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(qye,{onPick:r})})}function qye({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:Yye.map((t,n)=>o.jsxs(en.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:zs(t.draft.description)})]},t.id))})]})}function Xye({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=Wye(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(hv,{className:"icon"})," 返回模板列表"]}),o.jsxs(en.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:zs(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:Qye(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:zs(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx(Ds,{className:"icon"})]})]})]})}function Qye(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const Zye=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:AM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:xM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:wv}];let Dx=0;function s1(){return Dx+=1,`node_${Dx}`}function i1(e,t,n){const r=Pr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function Jye({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Nr,{type:"target",position:Ve.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(il,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Nr,{type:"source",position:Ve.Right,className:"wfb-handle"})]})}const ebe={agentNode:Jye},pI={type:"smoothstep",markerEnd:{type:nu.ArrowClosed,width:16,height:16}};function tbe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Dx=0;const C=s1();return i1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=t6([u]),[p,m,g]=n6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>Z5({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Lc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Lc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&k===null&&d.every(C=>Lc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(M=>C4({...C,...pI},M)),[m]),R=E.useCallback(()=>{const C=s1(),M=d.length*28,O=i1(C,{x:80+M,y:120+M});f(j=>j.concat(O)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},D=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),j=s1(),T=i1(j,O);f(z=>z.concat(T)),y(j)},[f]),W=E.useCallback(C=>{w&&f(M=>M.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),L=E.useCallback(()=>{w&&(f(C=>C.filter(M=>M.id!==w)),m(C=>C.filter(M=>M.source!==w&&M.target!==w)),y(null))},[w,f,m]),U=E.useCallback(()=>{if(!A)return;const C=d.map(O=>O.data.agent),M={...Pr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(M)},[A,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:Zye.map(({type:C,label:M,desc:O,Icon:j})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(j,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:M}),o.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(qz,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(il,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(mr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:U,disabled:!A,type:"button",children:[o.jsx(al,{className:"icon"}),"创建工作流"]}),o.jsxs(e6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:ebe,defaultEdgeOptions:pI,onDrop:F,onDragOver:D,onNodeClick:(C,M)=>y(M.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(s6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(a6,{showInteractive:!1}),o.jsx(sfe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:L,title:"删除节点",children:o.jsx(pi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>W({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>W({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>W({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>W({tools:C.target.value.split(",").map(M=>M.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(il,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function nbe(e){return o.jsx(C_,{children:o.jsx(tbe,{...e})})}const mI=50*1024*1024,Px=800,rbe={name:"code_package",files:[]};function sbe(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 ibe(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 abe(e){const t=e.flatMap(a=>{const l=ibe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Px)throw new Error(`代码包文件数不能超过 ${Px} 个。`);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 obe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,A]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(F){const W=++l.current;if(x(""),!F.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(F.size>mI){x("代码包不能超过 50 MB。");return}g(!0);try{const L=await eB(new Uint8Array(await F.arrayBuffer()),{maxEntries:Px,maxUncompressedBytes:mI}),U=abe(L);if(W!==l.current)return;f(F.name),u({name:sbe(F.name),files:U})}catch(L){if(W!==l.current)return;f(""),u(null),x(L instanceof Error?L.message:String(L))}finally{W===l.current&&g(!1)}}function R(F){var L;const W=(L=F.currentTarget.files)==null?void 0:L[0];F.currentTarget.value="",W&&S(W)}function I(F){var L;F.preventDefault(),y(!1);const W=(L=F.dataTransfer.files)==null?void 0:L[0];W&&S(W)}async function D(F,W,L){const U=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return p0(F.name,F.files,{region:_,projectName:"default",network:U},{...L,onStage:W})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(J0,{project:c??rbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:D,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:A,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:F=>{F.preventDefault(),y(!0)},onDragOver:F=>F.preventDefault(),onDragLeave:F=>{F.currentTarget.contains(F.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var F;m||(F=a.current)==null||F.click()},onKeyDown:F=>{var W;!m&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),(W=a.current)==null||W.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:F=>{F.stopPropagation(),p(!0)},onKeyDown:F=>F.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(Q5,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const lbe=3*60*1e3,cbe=3e3,ube=10*60*1e3,Dg="veadk.studio.pending-update",gI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],dbe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function fbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function hbe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function pbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Dg);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(Dg),null}function a1(e,t){window.localStorage.setItem(Dg,JSON.stringify({targetVersion:e,startedAt:t}))}function Bp(){window.localStorage.removeItem(Dg)}function yI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function mbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function gbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function bI({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function ybe(){var W,L;const[e]=E.useState(pbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const U=M=>{var O;M.target instanceof Node&&!((O=y.current)!=null&&O.contains(M.target))&&h(!1)},C=M=>{M.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",U),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",U),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const U=await aj(b.current||void 0,x.current||void 0);return n(U),U},[]);if(E.useEffect(()=>{let U=!0;const C=()=>{_().catch(()=>{U&&n(O=>O)})};C();const M=window.setInterval(C,lbe);return()=>{U=!1,window.clearInterval(M)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const U=window.setInterval(()=>{_().then(C=>{const M=b.current;if(M&&hbe(C.currentVersion,M)||!M&&!C.available&&C.latestVersion){window.clearInterval(U),Bp(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval(U),Bp(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>ube&&(window.clearInterval(U),Bp(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},cbe);return()=>window.clearInterval(U)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),a1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const U=()=>{const M=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-M)/1e3)))};U();const C=window.setInterval(U,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],A=u||((W=N[0])==null?void 0:W.version)||t.latestVersion,S=N.find(U=>U.version===A),R=async()=>{b.current=A,x.current=Date.now(),a1(A,x.current),s("submitting"),c(""),m("idle");try{const U=await oj(A);b.current=U.version,a1(U.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(U){if(U instanceof TypeError){c("连接已切换,正在确认新版本状态");return}Bp(),s("error");const C=U instanceof Error?U.message:"Studio 更新失败";try{const M=await _();c(M.message||C)}catch{c(C)}}},I=(L=t.updateLogs)!=null&&L.length?t.updateLogs:(t.errorLog||t.progressMessage||l).split(` -`).filter(Boolean),D=async()=>{try{await navigator.clipboard.writeText(I.join(` -`)),m("copied")}catch{m("error")}},F=()=>{var U;h(!1),m("idle"),c(""),d(b.current||((U=N[0])==null?void 0:U.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var U;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((U=N[0])==null?void 0:U.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(yI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(ma,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(yI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:dbe[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(bI,{lines:I,phase:"error",copyState:p,onCopy:()=>void D()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||A})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":fbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:gI.map((U,C)=>{const M=gI.findIndex(T=>T.id===t.progressStage),O=r==="published"||Cvoid D()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(U=>!U),onKeyDown:U=>{(U.key==="ArrowDown"||U.key==="ArrowUp")&&(U.preventDefault(),h(!0))},children:[o.jsx("span",{children:A}),o.jsx(mbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(U=>{const C=U.version===A;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d(U.version),h(!1)},children:[o.jsx("span",{children:U.version}),C&&o.jsx(gbe,{})]},U.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:A})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map(U=>o.jsx("li",{children:U},U))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:F,children:"重新尝试"})]})]})})]})}const bbe="/web/skill-creator";class sk extends Error{constructor(n,r){super(n);Lk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function kl(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function wn(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function yB(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Th(e,t){return fetch(Fi(`${bbe}${e}`),{...t,headers:d0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function ik(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=kl(await e.json(),"错误响应");return wn(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ak(e,t){if(!e.ok)throw new sk(await ik(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Ebe(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 xbe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function wbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=kl(t,`文件 ${n+1}`),s=wn(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=yB(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function vbe(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 _be(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=kl(t,`活动 ${n+1}`),s=wn(r,"id"),i=wn(r,"kind"),a=wn(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=wn(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 l=wn(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function kbe(e,t){const n=kl(e,`候选方案 ${t+1}`),r=wn(n,"id","candidate_id","candidateId"),s=wn(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:wn(n,"modelLabel","model_label")??s,status:Ebe(n.status),stage:xbe(n.stage),name:wn(n,"name","skill_name","skillName"),description:wn(n,"description"),skillMd:wn(n,"skillMd","skill_md"),files:wbe(n.files),activities:_be(n.activities),validation:vbe(n.validation),durationMs:yB(n,"elapsedMs","elapsed_ms"),error:wn(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:wn(n,"skill_id","skillId"),version:wn(n,"version")}}function Bx(e,t=""){const n=kl(e,"Skill 创建任务"),r=wn(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(kbe):[],i=wn(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:wn(n,"prompt")??t,status:i,candidates:s}}async function Nbe(e,t){const n=await Th("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new sk(await ik(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Bx(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="",l;const c=u=>{if(!u.trim())return;const d=kl(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(wn(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Bx(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Sbe(e){const t=await Th(`/jobs/${encodeURIComponent(e)}`);return Bx(await ak(t,"读取 Skill 任务失败"))}async function Tbe(e){const t=await Th(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ak(t,"清理 Skill 任务失败")}async function Abe(e,t){var l;const n=await Th(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await ik(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 Cbe(e,t,n){const r=await Th(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=kl(await ak(r,"添加到 AgentKit 失败"),"发布结果"),i=wn(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:wn(s,"name"),version:wn(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:wn(s,"message")}}const Ibe=()=>{};function Rbe(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 Obe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map(Rbe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(F_,{blocks:t,onAction:Ibe})})}const EI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},xI=12e4;function Lbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Mbe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function jbe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Dbe({candidate:e}){var c,u;const[t,n]=E.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,xI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>xI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function Pbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),A=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",D=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(Lbe,{status:n.status})}),R?o.jsx(ma,{duration:2.2,spread:16,children:EI[n.stage]}):o.jsx("span",{children:EI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Obe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:A,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var F;return(F=S.current)==null?void 0:F.focus()})},children:[o.jsx(Mbe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var F;return(F=A.current)==null?void 0:F.focus()})},children:[o.jsx(jbe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(D==null?void 0:D.valid)===!1?"is-invalid":"is-valid",children:(D==null?void 0:D.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,D&&(D.errors.length>0||D.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...D.errors,...D.warnings].map((F,W)=>o.jsx("div",{children:F},`${F}-${W}`))]}):null,o.jsx(Dbe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Abe(t,n.id).catch(F=>{w(F instanceof Error?F.message:String(F))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:F=>{F.preventDefault();const W=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:W,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:F=>b(F.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:F=>_(F.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:F=>N(F.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const wI=new Set(["completed"]),Fp=1100,Bbe=3e4;function Fbe(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 Ube({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(wI.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Bbe,_=async()=>{try{const k=await Sbe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),wI.has(k.status)||(b=window.setTimeout(_,Fp)))}catch(k){if(!y){const N=k instanceof sk?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=U_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??Fbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await Cbe(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(Pbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const o1="/web/sandbox/sessions",$be=33e4,Hbe=6e5,zbe=15e3;function l1(e){const t=d0(e);return t.set("Accept","application/json"),t}async function c1(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 Vbe(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 u1={async startSession(e={}){const t=await fetch(Fi(o1),{method:"POST",headers:l1({"Content-Type":"application/json"}),signal:mi(e.signal,$be)});if(!t.ok)throw await c1(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(Fi(`${o1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:l1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:mi(t.signal,Hbe)});if(!n.ok)throw await c1(n,"沙箱对话失败,请稍后重试。");return Vbe(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Fi(`${o1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:l1(),signal:mi(t.signal,zbe)});if(!n.ok&&n.status!==404)throw await c1(n,"无法清理 AgentKit 沙箱会话。")}},Kbe=1e4;async function bB(e){const t=await fetch(Fi(e),{headers:d0({Accept:"application/json"}),signal:mi(void 0,Kbe)});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 Ybe(){return bB("/web/sandbox/capabilities")}async function Wbe(){return bB("/web/skill-creator/capabilities")}function Gbe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 qbe({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return $s.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(Gbe,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function Xbe({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function Qbe({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 Zbe({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function Jbe(e){return e.toLowerCase()==="github"?o.jsx(Gz,{className:"icon"}):o.jsx(eV,{className:"icon"})}function e1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),jM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=vV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(ma,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>kV(m.loginUrl),children:[Jbe(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Pd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function t1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?$s.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(o0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function n1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}_l("Button",n1e);function r1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}_l("Card",r1e);const s1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},i1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function EB(e){return s1e[e]??"flex-start"}function xB(e){return i1e[e]??"stretch"}function a1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:EB(e.justify),alignItems:xB(e.align)},children:n.map(r=>t.render(r))})}_l("Column",a1e);function o1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}_l("Divider",o1e);const l1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function c1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:l1e[t]??"•"})}_l("Icon",c1e);function u1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:EB(e.justify),alignItems:xB(e.align??"center")},children:n.map(r=>t.render(r))})}_l("Row",u1e);const d1e=new Set(["h1","h2","h3","h4","h5"]);function f1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=d1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}_l("Text",f1e);async function Up(e){const[t,n,r]=await Promise.allSettled([Ybe(),Wbe(),Iv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const h1e="创建 Agent",p1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Mo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},m1e=new Set,g1e=[];function Qi(){return{skills:[]}}function Po(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function d1(e){return`${Po(e)}.active`}function Fx(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function y1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Po(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function b1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Fx(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ux(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Ux(n,t);if(r)return r}}function wB(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(...wB(n)));return t}function vI(){const e=typeof localStorage<"u"?localStorage.getItem(Mo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function E1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 x1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function vB(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 w1e(e){if(!e)return"";const t=[];return e.ts&&t.push(vB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function _I(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const v1e="send_a2ui_json_to_client";function _1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===v1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?U6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function k1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function N1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function S1e(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 kI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(Vs,{className:"icon"}):o.jsx(l0,{className:"icon"})})}function T1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function A1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx(zt,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(kM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(o0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(NE,{className:"global-deploy-task-icon"}):o.jsx(Jz,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(pv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:T1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Lg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const NI=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],SI=()=>NI[Math.floor(Math.random()*NI.length)];function f1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function C1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function I1e(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 R1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[A,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[D,F]=E.useState({}),W=a?D[a]??[]:f,L=p?g:W,U=(B,V)=>F(te=>({...te,[B]:typeof V=="function"?V(te[B]??[]):V})),[C,M]=E.useState(""),[O,j]=E.useState("agent"),[T,z]=E.useState(null),[G,P]=E.useState({}),se=E.useRef(new Map),Q=G.ready===!0&&G.agentId===n,[ne,fe]=E.useState(null),[Z,pe]=E.useState(!1),J=E.useRef(0),[be,ye]=E.useState([]),[we,ve]=E.useState(Qi),[Te,Re]=E.useState(null),[Ke,Oe]=E.useState(0),[mt,Xe]=E.useState(!1),[Ye,ce]=E.useState(null),[Se,st]=E.useState(!1),[ct,q]=E.useState([]),[ee,ge]=E.useState(!1),Pe=E.useRef(new Set),[Ge,et]=E.useState(()=>new Set),[$t,bt]=E.useState(()=>new Set),Vt=E.useRef(new Map),Wt=E.useRef(new Map),St=(B,V)=>et(te=>{const me=new Set(te);return V?me.add(B):me.delete(B),me}),Pt=B=>{const V=Wt.current.get(B);V!==void 0&&window.clearTimeout(V),Wt.current.delete(B),bt(te=>new Set(te).add(B))},je=B=>{const V=Wt.current.get(B);V!==void 0&&window.clearTimeout(V);const te=window.setTimeout(()=>{Wt.current.delete(B),bt(me=>{const Ne=new Set(me);return Ne.delete(B),Ne})},2400);Wt.current.set(B,te)},gt=E.useRef(""),[tt,Ae]=E.useState(""),[Ht,Bt]=E.useState(""),oe=E.useRef(null);E.useEffect(()=>()=>{oe.current!==null&&window.clearTimeout(oe.current)},[]);const[ze,dt]=E.useState(()=>new Set),[Fn,cn]=E.useState(!1),[Xt,Qt]=E.useState(!1),un=E.useRef(null),dn=E.useCallback(()=>Qt(!1),[]),[Gn,qn]=E.useState(SI),[Rt,Kt]=E.useState(null),[de,ke]=E.useState(!1),[Ie,Qe]=E.useState(!1),[ft,nt]=E.useState(""),ie=E.useRef(!1),[Ze,ot]=E.useState(null),[xe,ht]=E.useState(""),[Je,lt]=E.useState(),[_t,Gt]=E.useState(null),[bn,En]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[tn,Nn]=E.useState("cloud"),[Et,Sn]=E.useState(Sf),[On,Mt]=E.useState(""),[Ln,Hr]=E.useState("chat"),[Mn,fn]=E.useState(!1),[fr,Cr]=E.useState(!1),[Ys,ss]=E.useState(!1),[ir,Ir]=E.useState({}),[_i,xa]=E.useState({}),[bo,zr]=E.useState({}),Ki=Ge.has(a),wa=$t.has(a),ki=Ki||u,Nl=!!a&&Se,ws=p?y:ki,Sl=ws||!p&&wa,Ws=ir[a]??"",vs=_i[a]??m1e,va=bo[a]??g1e,ar=Te==null?void 0:Te.graph,Eo=[Te==null?void 0:Te.name,ar==null?void 0:ar.name,ar==null?void 0:ar.id].filter(B=>!!B),_a=we.targetAgent&&ar?Ux(ar,we.targetAgent.name):ar,Tl=(_a==null?void 0:_a.skills)??(we.targetAgent?[]:(Te==null?void 0:Te.skills)??[]),Al=ar?wB(ar):[];function ka(B){f1(B);for(const V of B)V.status==="uploading"?Pe.current.add(V.id):V.uri&&sm(n,V.uri).catch(te=>Ae(String(te)))}function Yi(){J.current+=1;const B=ne;fe(null),pe(!1),B&&!B.id.startsWith("pending-")&&Tbe(B.id).catch(V=>{Ae(V instanceof Error?V.message:String(V))})}async function Na(B){try{await IE(n,xe,B),await CE(n,xe,B),i(V=>V.filter(te=>te.id!==B)),F(V=>{const{[B]:te,...me}=V;return me})}catch(V){Ae(String(V))}}function Cl(B){const V=be.find(Ne=>Ne.id===B);if(!V)return;const te=be.filter(Ne=>Ne.id!==B);f1([V]),V.status==="uploading"&&Pe.current.add(B),ye(te),te.length===0&&!C.trim()&&!!a&&L.length===0?(gt.current="",l(""),Na(a)):V.uri&&sm(n,V.uri).catch(Ne=>Ae(String(Ne)))}const H=(B,V)=>{var Ee,qe,He,it,Lt;const te=V.author&&V.author!=="user"?V.author:void 0;te&&(Ir(Be=>({...Be,[B]:te})),xa(Be=>({...Be,[B]:new Set(Be[B]??[]).add(te)})),zr(Be=>{var ut;return(ut=Be[B])!=null&&ut.length?Be:{...Be,[B]:[te]}}));const me=((Ee=V.actions)==null?void 0:Ee.transferToAgent)??((qe=V.actions)==null?void 0:qe.transfer_to_agent);me&&zr(Be=>{const ut=Be[B]??[];return ut[ut.length-1]===me?Be:{...Be,[B]:[...ut,me]}}),(((He=V.actions)==null?void 0:He.endOfAgent)??((it=V.actions)==null?void 0:it.end_of_agent)??((Lt=V.actions)==null?void 0:Lt.escalate))&&zr(Be=>{const ut=Be[B]??[];return ut.length<=1?Be:{...Be,[B]:ut.slice(0,-1)}})},[re,le]=E.useState(vI),[Fe,Nt]=E.useState([]),Y=E.useCallback(B=>{Nt(V=>{const te=V.findIndex(Ne=>Ne.id===B.id);if(te===-1)return[B,...V];const me=[...V];return me[te]={...me[te],...B},me})},[]),ue=E.useCallback(async B=>{try{await nj(B.id),Nt(V=>V.map(te=>te.id===B.id?{...te,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:te))}catch(V){const te=V instanceof Error?V.message:String(V);Nt(me=>me.map(Ne=>Ne.id===B.id?{...Ne,message:`取消失败:${te}`}:Ne))}},[]),[Ue,$e]=E.useState(!0),[At,Ft]=E.useState(!1),[jn,jt]=E.useState(!1),[Xn,xt]=E.useState(!1),[Un,Yt]=E.useState(null),[_s,Gs]=E.useState([]),[ok,Ah]=E.useState([]),[Vr,qs]=E.useState(""),ks=E.useRef(null),[Ch,Kr]=E.useState(!1),[Iu,hn]=E.useState(!1),[lk,ty]=E.useState(""),[_B,kB]=E.useState("good"),[NB,Ru]=E.useState("basic"),[SB,TB]=E.useState("good"),[Ih,Rh]=E.useState(""),[Xs,Rr]=E.useState(!1),ny=E.useRef(null),[xo,Il]=E.useState(()=>{const B=As();return yu(B),B}),[AB,ck]=E.useState(!1),[CB,uk]=E.useState(""),[dk,Oh]=E.useState(null),[IB,fk]=E.useState({}),[Rl,Ni]=E.useState(null),[Lh,ry]=E.useState("cn-beijing"),[hk,is]=E.useState(""),[sy,Yr]=E.useState(""),[rn,Qs]=E.useState(null),[RB,Mh]=E.useState(!1),iy=E.useRef(!1),jh=E.useRef(!1),OB=E.useCallback((B,V,te)=>{!B||!xe||Gs(me=>{const Ee=[{id:B,draft:V,updatedAt:Date.now(),deploymentTarget:te},...me.filter(qe=>qe.id!==B)];return localStorage.setItem(Po(xe),JSON.stringify(Ee)),Ee})},[xe]),ay=E.useCallback(B=>{!B||!xe||Gs(V=>{const te=V.filter(me=>me.id!==B);return localStorage.setItem(Po(xe),JSON.stringify(te)),te})},[xe]),LB=E.useCallback(B=>{if(!xe||B.length===0)return;const V=new Set(B.map(te=>te.id));Gs(te=>{const me=te.filter(Ne=>!V.has(Ne.id));return localStorage.setItem(Po(xe),JSON.stringify(me)),me}),V.has(Vr)&&(qs(""),Yt(null),Ni(null),ks.current=null,localStorage.removeItem(d1(xe)))},[Vr,xe]),pk=E.useCallback(B=>{if(!B||!xe)return;const V=ks.current;Gs(te=>{const me=te.filter(Ee=>Ee.id!==B),Ne=(V==null?void 0:V.id)===B?[V,...me]:me;return localStorage.setItem(Po(xe),JSON.stringify(Ne)),Ne})},[xe]);E.useEffect(()=>{if(!xe){Gs([]),Ah([]),qs(""),ks.current=null;return}const B=y1e(xe);Gs(B),Ah(b1e(xe));const V=localStorage.getItem(d1(xe))||"",te=B.find(me=>me.id===V);ks.current=te??null,re==="custom"&&te&&(qs(te.id),Yt(te.draft),Ni(te.deploymentTarget??null))},[xe]),E.useEffect(()=>{if(!xe)return;const B=d1(xe);re==="custom"&&Vr?localStorage.setItem(B,Vr):localStorage.removeItem(B)},[re,Vr,xe]);const MB=E.useCallback(B=>{if(!xe)return;const V=[...new Set(B.filter(Boolean))];Ah(V),localStorage.setItem(Fx(xe),JSON.stringify(V))},[xe]),jB=E.useCallback(async B=>{const V=B.filter(Ee=>!!Ee.runtimeId&&Ee.canDelete===!0);if(V.length===0)return;const te=new Set,me=new Set,Ne=[];for(const Ee of V)try{if(!Ee.region)throw new Error("Runtime 缺少地域信息,无法删除");await cj(Ee.runtimeId,Ee.region),ig(Ee.runtimeId),te.add(Ee.runtimeId),me.add(Ee.id)}catch(qe){const He=qe instanceof Error?qe.message:String(qe);Ne.push(`${Ee.label}: ${He}`)}if(te.size>0&&(Il(As()),Oh(Ee=>{if(!Ee)return Ee;const qe=new Set(Ee);for(const He of te)qe.delete(He);return qe}),fk(Ee=>Object.fromEntries(Object.entries(Ee).filter(([qe])=>!te.has(qe)))),Ah(Ee=>{const qe=Ee.filter(He=>!me.has(He));return xe&&localStorage.setItem(Fx(xe),JSON.stringify(qe)),qe}),Gs(Ee=>{const qe=Ee.filter(He=>{var it;return!((it=He.deploymentTarget)!=null&&it.runtimeId)||!te.has(He.deploymentTarget.runtimeId)});return xe&&localStorage.setItem(Po(xe),JSON.stringify(qe)),qe}),V.some(Ee=>Ee.id===n)&&(gt.current="",l(""),r(""))),Ne.length>0){const Ee=Ne.slice(0,3).join(";"),qe=Ne.length>3?`;另有 ${Ne.length-3} 个失败`:"";throw new Error(`${Ne.length} 个 Agent 删除失败:${Ee}${qe}`)}},[n,xe]),oy=E.useCallback(async()=>{ck(!0),uk("");try{const B=[];let V="";do{const te=await Nc({scope:"mine",region:"all",pageSize:100,nextToken:V});B.push(...te.runtimes),V=te.nextToken}while(V&&B.length<2e3);Oh(new Set(B.map(te=>te.runtimeId))),fk(Object.fromEntries(B.map(te=>[te.runtimeId,{canDelete:te.canDelete}])))}catch(B){uk(B instanceof Error?B.message:String(B))}finally{ck(!1)}},[]);function Dh(B){console.log("create agent draft:",B),le(null),ko()}function ly(B,V){console.log("Agent added, navigating to:",B,V),Il(As()),Oh(null),ay(Vr),qs(""),ks.current=null,Ni(null),is(""),Yr(B),Ru("basic"),le(null),hn(!0),r(B)}const mk=E.useCallback(B=>{le(null),xt(!1),Qs(null),hn(!0),Yr(""),Ru("basic"),is(B.id),Ae("")},[]),gk=E.useCallback(async B=>{if(!B.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const V=(Rl==null?void 0:Rl.region)??Lh,te=await sg(B.runtimeId,B.agentName,B.region??V,B.version);Il(As()),Oe(Ne=>Ne+1);const me=await Up(te);se.current.set(te,me),P(me),Oh(Ne=>{const Ee=new Set(Ne??[]);return Ee.add(B.runtimeId),Ee}),Ni(null),ay(Vr),qs(""),ks.current=null,Yr(te),Ru("basic"),le(null),hn(!0),r(te)},[Vr,Lh,ay,Rl]),Ou=E.useRef(null),cy=E.useRef(new Map),wo=E.useRef(!0),Sa=E.useRef(!1),vo=E.useRef(null),yk=E.useRef({key:"",turnCount:0}),uy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const B=Ou.current,V=yk.current,te=V.key!==uy,me=!te&&L.length>V.turnCount;if(yk.current={key:uy,turnCount:L.length},!B||L.length===0||!te&&!me)return;wo.current=!0,Sa.current=!1,vo.current!==null&&(window.clearTimeout(vo.current),vo.current=null);const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(te||Ne){B.scrollTop=B.scrollHeight;return}Sa.current=!0,B.scrollTo({top:B.scrollHeight,behavior:"smooth"}),vo.current=window.setTimeout(()=>{Sa.current=!1,vo.current=null},450)},[uy,L.length]),E.useLayoutEffect(()=>{const B=Ou.current;!B||!wo.current||Sa.current||(B.scrollTop=B.scrollHeight)},[ws,L]),E.useEffect(()=>{if(!Ih||Iu||L.length===0)return;const B=cy.current.get(Ih);if(!B)return;wo.current=!1,B.scrollIntoView({behavior:"smooth",block:"center"});const V=window.setTimeout(()=>{Rh("")},2600);return()=>window.clearTimeout(V)},[Ih,Iu,L]),E.useEffect(()=>()=>{vo.current!==null&&window.clearTimeout(vo.current)},[]);const DB=E.useCallback(()=>{const B=Ou.current;!B||Sa.current||(wo.current=B.scrollHeight-B.scrollTop-B.clientHeight<32)},[]),PB=E.useCallback(B=>{B.deltaY<0&&(Sa.current=!1,wo.current=!1)},[]),BB=E.useCallback(()=>{Sa.current=!1,wo.current=!1},[]),FB=E.useCallback(()=>{const B=Ou.current;!B||!wo.current||Sa.current||(B.scrollTop=B.scrollHeight)},[]),dy=E.useCallback(()=>{ot(null),SE().then(B=>{ht(B.userId),lt(B.info),Cr(!!B.local),Kt(B.status),B.status==="authenticated"&&(le(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),Rr(!0))}).catch(B=>{ot(B instanceof Error?B.message:String(B))})},[]);E.useEffect(()=>{dy()},[dy]),E.useEffect(()=>{const B=()=>{nt(""),ke(!0)};return window.addEventListener(TE,B),OV()&&B(),()=>window.removeEventListener(TE,B)},[]);const UB=E.useCallback(async()=>{if(ie.current)return;ie.current=!0;const B=NV();if(!B){ie.current=!1,nt("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),nt("");try{for(;;){await new Promise(V=>window.setTimeout(V,1e3));try{const V=await SE();if(V.status==="authenticated"){ht(V.userId),lt(V.info),Cr(!!V.local),Kt(V.status),ke(!1),LV(),B.close();return}}catch{}if(B.closed){nt("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{ie.current=!1,Qe(!1)}},[]);E.useEffect(()=>{fr&&xe&&dT(xe)},[fr,xe]),E.useEffect(()=>{if(Rt!=="authenticated"||!xe||!n){P({});return}const B=se.current.get(n);if(B){P(B);return}let V=!1;return P({}),Up(n).then(te=>{V||(se.current.set(n,te),P(te))}),()=>{V=!0}},[n,Rt,xe]),E.useEffect(()=>{if(Rt!=="authenticated"||!xe){Gt(null);return}let B=!1;return Gt(null),ij().then(V=>{B||Gt(V)}).catch(V=>{console.warn("[app] /web/access failed; using ordinary-user access:",V),B||Gt(sj)}),()=>{B=!0}},[Rt,xe]),E.useEffect(()=>{rj().then(B=>{En(B.features),Nn(B.agentsSource),Sn(B.branding),Mt(B.version),Hr(B.defaultView),fn(!0)})},[]),E.useEffect(()=>{!_t||!Mn||jh.current||Xs||(jh.current=!0,Ln==="addAgent"&&_t.capabilities.createAgents&&(le(null),Ft(!1),Kr(!1),hn(!1),jt(!1),xt(!0)))},[_t,Ln,Xs,Mn]),E.useEffect(()=>{_t&&(_t.capabilities.createAgents||(le(null),Yt(null),jt(!1),xt(!1),Nt([])),_t.capabilities.manageAgents||hn(!1))},[_t]),E.useEffect(()=>{Rt!=="authenticated"||tn!=="cloud"||!Mn||!Iu||rn||oy()},[rn,tn,Rt,Iu,oy,Mn]),E.useEffect(()=>{document.title=Et.title;let B=document.querySelector('link[rel~="icon"]');B||(B=document.createElement("link"),B.rel="icon",document.head.appendChild(B)),B.removeAttribute("type"),B.href=Et.logoUrl||jv},[Et]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(B=>B.ok?B.json():null).then(B=>{B&&$e(!!B.credentials)}).catch(B=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",B)})},[]);function $B(B){dT(B),iy.current=!0,jh.current=!1,Gt(null),le(null),Yt(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),ko(),Rr(!0),ht(B),lt({name:B}),Cr(!0),Kt("authenticated")}function HB(){jh.current=!1,Gt(null),fr?(_V(),ht(""),lt(void 0),Kt("unauthenticated")):TV()}E.useEffect(()=>{if(Rt==="authenticated"){if(tn==="cloud"){const B=localStorage.getItem(Mo.app),V=xo.flatMap(te=>te.apps.map(me=>ro(te.id,me)));r(te=>te&&V.includes(te)?te:B&&V.includes(B)?B:V[0]??"");return}FM().then(B=>{t(B);const V=localStorage.getItem(Mo.app),te=xo.flatMap(Ee=>Ee.apps.map(qe=>ro(Ee.id,qe))),me=V&&(B.includes(V)||te.includes(V)),Ne=["web_search_agent","web_demo"].find(Ee=>B.includes(Ee))??B.find(Ee=>!/^\d/.test(Ee))??B[0];r(me?V:Ne||"")}).catch(B=>Ae(String(B)))}},[Rt,tn,xo]),E.useEffect(()=>{n&&localStorage.setItem(Mo.app,n)},[n]),E.useEffect(()=>{let B=!1;if(ce(null),q([]),Xs||rn||!n||!xe||!a){st(!1);return}return st(!0),RE(n,xe,a).then(V=>{B||(ce(V),Iv(n).then(te=>{B||q(te)}).catch(()=>{B||q([])}))}).catch(()=>{B||ce(null)}).finally(()=>{B||st(!1)}),()=>{B=!0}},[rn,n,Xs,xe,a]),E.useEffect(()=>{let B=!1;if(Re(null),ve(Qi()),Rt!=="authenticated"||Xs||rn||!n){Xe(!1);return}return Xe(!0),Rv(n).then(V=>{B||Re(V)}).catch(()=>{B||Re(null)}).finally(()=>{B||Xe(!1)}),()=>{B=!0}},[rn,n,Ke,Rt,Xs]),E.useEffect(()=>{_t&&localStorage.setItem(Mo.view,_t.capabilities.createAgents?re??"chat":"chat")},[_t,re]),E.useEffect(()=>{localStorage.setItem(Mo.session,a),gt.current=a},[a]),E.useEffect(()=>()=>Vt.current.forEach(B=>B.abort()),[]),E.useEffect(()=>()=>Wt.current.forEach(B=>{window.clearTimeout(B)}),[]),E.useEffect(()=>()=>{var B,V;(B=R.current)==null||B.abort(),(V=I.current)==null||V.abort()},[]),E.useEffect(()=>{if(Xs||rn||p||!n||!xe)return;let B=!1;return(async()=>{const V=await Ph(n);if(!B){if(!iy.current){iy.current=!0;const te=localStorage.getItem(Mo.session)||"";if(vI()===null&&te&&V.some(me=>me.id===te)){Lu(te);return}}ko()}})(),()=>{B=!0}},[rn,n,Xs,p,xe]),E.useEffect(()=>{const B=ny.current;B&&B.app===n&&(ny.current=null,Lu(B.sid))},[n]);function zB(B,V){Kr(!1),B===n?Lu(V):(ny.current={app:B,sid:V},r(B))}async function Ph(B){try{const V=await Tv(B,xe),te=await Promise.all(V.map(me=>{var Ne;return(Ne=me.events)!=null&&Ne.length?Promise.resolve(me):ng(B,xe,me.id)}));return i(te),te}catch(V){return Ae(String(V)),[]}}function bk(){p||(Ae(""),S(""),N("confirm"),_(!0))}function VB(){var B;(B=R.current)==null||B.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&O==="temporary"&&j("agent")}async function KB(){var V;(V=R.current)==null||V.abort();const B=new AbortController;R.current=B,N("loading"),S("");try{const te=await u1.startSession({signal:B.signal});if(R.current!==B)return;gt.current="",l(""),h([]),M(""),ve(Qi()),j("temporary"),Yi(),pe(!1),ka(be),ye([]),w([]),m(te),le(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),Qs(null),Rr(!1),_(!1),N("confirm")}catch(te){if((te==null?void 0:te.name)==="AbortError"||R.current!==B)return;S(te instanceof Error?te.message:String(te)),N("error")}finally{R.current===B&&(R.current=null)}}function _o(){var V;(V=I.current)==null||V.abort(),I.current=null,b(!1),w([]),M(""),Ae(""),j("agent");const B=p;m(null),B&&u1.closeSession(B.id).catch(te=>Ae(String(te)))}async function YB(B){var Ne;const V=p;if(!V||y||!B.trim())return;Ae("");const te=new AbortController;(Ne=I.current)==null||Ne.abort(),I.current=te;const me=[{role:"user",blocks:[{kind:"text",text:B}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Ee=>[...Ee,...me]),b(!0);try{const Ee=await u1.sendMessage({sessionId:V.id,text:B},{signal:te.signal,onBlocks:qe=>{I.current===te&&w(He=>{const it=He.slice(),Lt=it[it.length-1];return(Lt==null?void 0:Lt.role)==="assistant"&&(it[it.length-1]={...Lt,blocks:qe}),it})}});if(I.current!==te)return;w(qe=>{const He=qe.slice(),it=He[He.length-1];return(it==null?void 0:it.role)==="assistant"&&(He[He.length-1]={...it,blocks:Ee.blocks,meta:{ts:Date.now()/1e3}}),He})}catch(Ee){if((Ee==null?void 0:Ee.name)==="AbortError"||I.current!==te)return;w(qe=>qe.slice(0,-2)),M(B),Ae(`内置智能体发送失败:${Ee instanceof Error?Ee.message:String(Ee)}`)}finally{I.current===te&&(I.current=null,b(!1))}}function ko(){_o(),Ae(""),Qt(!1),qn(SI()),j("agent"),z(null),Yi(),pe(!1);const B=a&&W.length===0&&be.length>0?a:"";gt.current="",l(""),ce(null),q([]),d(!1),h([]),ve(Qi()),ka(be),ye([]),B&&Na(B)}function WB(B){oe.current!==null&&window.clearTimeout(oe.current),Bt(B),oe.current=window.setTimeout(()=>{Bt(""),oe.current=null},3e3)}function GB(){if(le(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),Qs(null),!n&&!p){Rr(!0),WB("请先选择 agent");return}Rr(!1),ko()}async function qB(B){var V;try{(V=Vt.current.get(B))==null||V.abort(),await IE(n,xe,B),await CE(n,xe,B);const te=Wt.current.get(B);te!==void 0&&window.clearTimeout(te),Wt.current.delete(B),bt(me=>{if(!me.has(B))return me;const Ne=new Set(me);return Ne.delete(B),Ne}),F(me=>{const{[B]:Ne,...Ee}=me;return Ee}),B===a&&ko(),await Ph(n)}catch(te){Ae(String(te))}}async function Lu(B){if(p&&_o(),B!==a&&(gt.current=B,Ae(""),d(!1),h([]),j("agent"),z(null),Yi(),ve(Qi()),ce(null),q([]),l(B),D[B]===void 0)){ss(!0);try{const V=await ng(n,xe,B);U(B,oK(V.events??[],V.state))}catch(V){Ae(String(V))}finally{ss(!1)}}}async function XB(B){if(!B.sessionId||!B.messageId){Ae("这条案例缺少会话定位信息,无法跳转。");return}Kr(!1),le(null),jt(!1),xt(!1),Ft(!1),hn(!1),ty(n),kB(B.kind),Rh(B.messageId),await Lu(B.sessionId)}function QB(){const B=lk||n;Kr(!1),le(null),jt(!1),xt(!1),Ft(!1),is(""),Yr(B),Ru("evaluations"),TB(_B),hn(!0),ty(""),Rh("")}function ZB(B){const V=new Map,te=new Map;for(const me of B){if(!me.sessionId||!me.messageId)continue;const Ne=V.get(me.sessionId)??new Set;if(Ne.add(me.messageId),V.set(me.sessionId,Ne),me.runtimeId&&me.userId){const Ee=[me.runtimeId,n,me.userId,me.sessionId].join(":"),qe=te.get(Ee)??{runtimeId:me.runtimeId,appName:n,userId:me.userId,sessionId:me.sessionId,eventIds:new Set};qe.eventIds.add(me.messageId),te.set(Ee,qe)}}if(V.size!==0){F(me=>{const Ne={...me};for(const[Ee,qe]of V){const He=Ne[Ee];He&&(Ne[Ee]=He.map(it=>{var Lt;return(Lt=it.meta)!=null&&Lt.eventId&&qe.has(it.meta.eventId)?{...it,meta:{...it.meta,feedback:void 0}}:it}))}return Ne}),i(me=>me.map(Ne=>{const Ee=V.get(Ne.id);if(!Ee||!Ne.state)return Ne;const qe={...Ne.state};for(const He of Ee)delete qe[`veadk_feedback:${He}`];return{...Ne,state:qe}})),dt(me=>{const Ne=new Set(me);for(const Ee of V.values())for(const qe of Ee)Ne.delete(qe);return Ne});for(const me of te.values())DM({runtimeId:me.runtimeId,appName:me.appName,userId:me.userId,sessionId:me.sessionId,eventIds:[...me.eventIds]})}}async function Ek(B=!0){if(a)return a;c.current||(c.current=tg(n,xe));const V=c.current;try{const te=await V;B&&l(te);const me=Date.now()/1e3,Ne={id:te,lastUpdateTime:me,events:[]};return i(Ee=>[Ne,...Ee.filter(qe=>qe.id!==te)]),te}finally{c.current===V&&(c.current=null)}}async function xk(B){if(!n||!xe||!a||!Ye)return!1;ge(!0),Ae("");try{const V=await OE(n,xe,a,B,Ye.revision);return ce(V),!0}catch(V){return Ae(String(V)),!1}finally{ge(!1)}}async function wk(B){if(!(!n||!xe||!a||!Ye)){ge(!0),Ae("");try{const V=await ZM(n,xe,a,B,Ye.revision);ce(V)}catch(V){Ae(String(V))}finally{ge(!1)}}}async function JB(B){Ae("");let V;try{V=await Ek()}catch(me){Ae(String(me));return}const te=Array.from(B).map(me=>({file:me,attachment:{id:C1e(),mimeType:I1e(me),name:me.name,sizeBytes:me.size,status:"uploading"}}));ye(me=>[...me,...te.map(Ne=>Ne.attachment)]),await Promise.all(te.map(async({file:me,attachment:Ne})=>{try{const Ee=await WM(n,xe,V,me);if(Pe.current.delete(Ne.id)){Ee.uri&&await sm(n,Ee.uri);return}ye(qe=>qe.map(He=>He.id===Ne.id?Ee:He))}catch(Ee){if(Pe.current.delete(Ne.id))return;const qe=Ee instanceof Error?Ee.message:String(Ee);ye(He=>He.map(it=>it.id===Ne.id?{...it,status:"error",error:qe}:it)),Ae(qe)}}))}async function vk(B,V=[],te=Qi()){if(!B.trim()&&V.length===0||ki||Nl||!n||!xe)return;Ae("");const me=[];(te.skills.length>0||te.targetAgent)&&me.push({kind:"invocation",value:te}),V.length&&me.push({kind:"attachment",files:V.map(Be=>({id:Be.id,mimeType:Be.mimeType,data:Be.data,uri:Be.uri,name:Be.name,sizeBytes:Be.sizeBytes}))}),B.trim()&&me.push({kind:"text",text:B});const Ne=[{role:"user",blocks:me,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Ee=!a;Ee&&(h(Ne),d(!0));const qe=T;let He;try{He=await Ek(!Ee)}catch(Be){Ee&&(h([]),d(!1),M(B),ve(te)),Ae(String(Be));return}let it=Ye!==null;if(qe)try{let Be=await RE(n,xe,He);const ut=nge[qe].filter(Zt=>{var or;return(or=G.builtinTools)==null?void 0:or.includes(Zt)});for(const Zt of[...Q6[qe],...ut])Be.tools.some(or=>or.name===Zt)||(Be=await OE(n,xe,He,{kind:"tool",name:Zt},Be.revision));ce(Be),it=!0}catch(Be){Ee&&(h([]),d(!1),M(B),ve(te)),Ae(`任务能力挂载失败:${String(Be)}`);return}U(He,Be=>Ee?Ne:[...Be,...Ne]),Ee&&(gt.current=He,l(He),h([]),d(!1));const Lt=new AbortController;Vt.current.set(He,Lt),St(He,!0),Pt(He),gt.current=He,Ir(Be=>({...Be,[He]:""})),xa(Be=>({...Be,[He]:new Set})),zr(Be=>({...Be,[He]:[]}));try{let Be=ci(),ut="",Zt=0,or=Date.now()/1e3,Ta="",Aa="";for await(const Dn of Nf({appName:n,userId:xe,sessionId:He,text:B,attachments:V,invocation:te,signal:Lt.signal,sessionCapabilities:it})){if(Lt.signal.aborted)break;const Gi=Dn.error??Dn.errorMessage??Dn.error_message;if(typeof Gi=="string"&&Gi){gt.current===He&&Ae(Gi);break}H(He,Dn);const Qn=Dn.author&&Dn.author!=="user"?Dn.author:"";Qn&&Qn!==ut&&(ut=Qn,Be=ci()),Be=Vc(Be,Dn);const $n=Dn.usageMetadata??Dn.usage_metadata;$n!=null&&$n.totalTokenCount&&(Zt=$n.totalTokenCount),Dn.timestamp&&(or=Dn.timestamp),Dn.id&&(Ta=Dn.id);const Wr=Dn.invocationId??Dn.invocation_id;Wr&&(Aa=Wr);const Si=Be.blocks,as={author:ut||void 0,tokens:Zt||void 0,ts:or,eventId:Ta||void 0,invocationId:Aa||void 0};U(He,hy=>{var Bu;const os=hy.slice(),pn=os[os.length-1];return(pn==null?void 0:pn.role)==="assistant"&&(!((Bu=pn.meta)!=null&&Bu.author)||pn.meta.author===ut)?os[os.length-1]={...pn,blocks:Si,meta:as}:os.push({role:"assistant",blocks:Si,meta:as}),os})}Ph(n)}catch(Be){(Be==null?void 0:Be.name)!=="AbortError"&&!Lt.signal.aborted&>.current===He&&Ae(String(Be))}finally{Vt.current.get(He)===Lt&&Vt.current.delete(He),St(He,!1),je(He),Ir(Be=>({...Be,[He]:""})),zr(Be=>({...Be,[He]:[]}))}}function e8(B,V){var Ne,Ee;const te=((Ne=B==null?void 0:B.event)==null?void 0:Ne.name)??V.id,me=((Ee=B==null?void 0:B.event)==null?void 0:Ee.context)??{};vk(`[ui-action] ${te}: ${JSON.stringify(me)}`)}async function t8(B){var it,Lt,Be;if(!B.authUri)throw new Error("事件中没有授权地址。");if(!n||!xe||!a)throw new Error("会话尚未就绪。");const V=a,te=await N1e(B.authUri),me=S1e(B.authConfig,te),Ne=ut=>ut.map(Zt=>Zt.kind==="auth"&&!Zt.done?{...Zt,done:!0}:Zt);U(V,ut=>{const Zt=ut.slice(),or=Zt[Zt.length-1];return(or==null?void 0:or.role)==="assistant"&&(Zt[Zt.length-1]={...or,blocks:Ne(or.blocks)}),Zt});const Ee=L[L.length-1],qe=Ne(Ee&&Ee.role==="assistant"?Ee.blocks:[]),He=new AbortController;Vt.current.set(V,He),St(V,!0),Pt(V);try{let ut=ci(),Zt=((it=Ee==null?void 0:Ee.meta)==null?void 0:it.author)??"",or=qe,Ta=0,Aa=Date.now()/1e3,Dn=((Lt=Ee==null?void 0:Ee.meta)==null?void 0:Lt.eventId)??"",Gi=((Be=Ee==null?void 0:Ee.meta)==null?void 0:Be.invocationId)??"";for await(const Qn of Nf({appName:n,userId:xe,sessionId:a,text:"",functionResponses:[{id:B.callId,name:"adk_request_credential",response:me}],signal:He.signal,sessionCapabilities:Ye!==null})){if(He.signal.aborted)break;H(V,Qn);const $n=Qn.author&&Qn.author!=="user"?Qn.author:"";$n&&$n!==Zt&&(Zt=$n,or=[],ut=ci()),ut=Vc(ut,Qn);const Wr=Qn.usageMetadata??Qn.usage_metadata;Wr!=null&&Wr.totalTokenCount&&(Ta=Wr.totalTokenCount),Qn.timestamp&&(Aa=Qn.timestamp),Qn.id&&(Dn=Qn.id);const Si=Qn.invocationId??Qn.invocation_id;Si&&(Gi=Si);const as=[...or,...ut.blocks];U(V,hy=>{var Ak,Ck,Ik,Rk,Ok;const os=hy.slice(),pn=os[os.length-1],Bu={author:Zt||((Ak=pn==null?void 0:pn.meta)==null?void 0:Ak.author),tokens:Ta||((Ck=pn==null?void 0:pn.meta)==null?void 0:Ck.tokens),ts:Aa,eventId:Dn||((Ik=pn==null?void 0:pn.meta)==null?void 0:Ik.eventId),invocationId:Gi||((Rk=pn==null?void 0:pn.meta)==null?void 0:Rk.invocationId)};return(pn==null?void 0:pn.role)==="assistant"&&(!((Ok=pn.meta)!=null&&Ok.author)||pn.meta.author===Zt)?os[os.length-1]={...pn,blocks:as,meta:Bu}:os.push({role:"assistant",blocks:as,meta:Bu}),os})}Ph(n)}catch(ut){(ut==null?void 0:ut.name)!=="AbortError"&&!He.signal.aborted&>.current===V&&Ae(String(ut))}finally{Vt.current.get(V)===He&&Vt.current.delete(V),St(V,!1),je(V),Ir(ut=>({...ut,[V]:""})),zr(ut=>({...ut,[V]:[]}))}}if(Ze)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Ze}),o.jsx("button",{type:"button",onClick:dy,children:"重试"})]});if(Rt===null)return o.jsx("div",{className:"boot"});if(Rt==="unauthenticated")return o.jsx(e1e,{branding:Et,onUsername:$B});if(!_t)return o.jsx("div",{className:"boot"});const Zs=_t.capabilities.createAgents,_k=_t.capabilities.manageAgents,Ns=Zs?re:null,Mu=Zs&&Xn,ju=Zs&&jn,Du=Iu,kk=wj(e,xo),Pu=kk.filter(B=>B.runtimeId&&(dk===null||dk.has(B.runtimeId))).map(B=>{var V;return{...B,canDelete:B.runtimeId?((V=IB[B.runtimeId])==null?void 0:V.canDelete)===!0:!1}}),n8=(()=>{if(Pu.length===0)return Pu;const B=new Map(ok.map((V,te)=>[V,te]));return[...Pu].sort((V,te)=>{const me=B.get(V.id),Ne=B.get(te.id);return me!=null&&Ne!=null?me-Ne:me!=null?-1:Ne!=null?1:Pu.indexOf(V)-Pu.indexOf(te)})})(),Bh=B=>{var V;return((V=kk.find(te=>te.id===B))==null?void 0:V.label)??B},Or=xo.find(B=>B.runtimeId&&B.apps.some(V=>ro(B.id,V)===n)),Ol=Or&&Or.runtimeId&&Or.region?{runtimeId:Or.runtimeId,name:Or.name,region:Or.region}:void 0,r8=(Ol==null?void 0:Ol.runtimeId)??xo.reduce((B,V)=>V.runtimeId??B,""),Nk=async(B,V)=>{var qe,He;const te=(qe=B.meta)==null?void 0:qe.eventId,me=a;if(!te||!me||!Ol)return;const Ne=(He=B.meta)==null?void 0:He.feedback,Ee={...Ne,rating:V,syncStatus:"syncing",updatedAt:Date.now()/1e3};U(me,it=>it.map(Lt=>{var Be;return((Be=Lt.meta)==null?void 0:Be.eventId)===te?{...Lt,meta:{...Lt.meta,feedback:Ee}}:Lt})),dt(it=>new Set(it).add(te));try{const it=await $M({appName:n,userId:xe,sessionId:me,eventId:te,rating:V});U(me,Lt=>Lt.map(Be=>{var ut;return((ut=Be.meta)==null?void 0:ut.eventId)===te?{...Be,meta:{...Be.meta,feedback:it}}:Be})),i(Lt=>Lt.map(Be=>Be.id===me?{...Be,state:{...Be.state??{},[`veadk_feedback:${te}`]:it}}:Be))}catch(it){U(me,Lt=>Lt.map(Be=>{var ut;return((ut=Be.meta)==null?void 0:ut.eventId)===te?{...Be,meta:{...Be.meta,feedback:Ne}}:Be})),gt.current===me&&Ae(it instanceof Error?it.message:String(it))}finally{dt(it=>{const Lt=new Set(it);return Lt.delete(te),Lt})}},Fh=async B=>{Il(As());let V=se.current.get(B);V||(V=await Up(B),se.current.set(B,V)),P(V),B===n&&Oe(te=>te+1),gt.current="",l(""),Rr(!1),r(B)},s8=B=>{if(!Zs){Ae("当前账号没有添加 Agent 的权限。");return}Rr(!1),hn(!1),ry(B),Yt(null),le(null),xt(!0),Ae("")},Sk=async B=>{if(B.runtime)try{const V=await sg(B.runtime.runtimeId,B.name,B.runtime.region,B.runtime.currentVersion);Il(As()),Oe(me=>me+1);const te=await Up(V);se.current.set(V,te),P(te),Qs(null),Rr(!1),hn(!1),ko(),r(V)}catch(V){Ae(V instanceof Error?V.message:String(V))}},i8=B=>{B.runtime&&(Qs(B),is(""),Yr(""),Rr(!1),hn(!0),Ae(""))},Tk=()=>{p&&_o(),gt.current="",l(""),le(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),Qs(null),is(""),Yr(""),Rr(!0),Ae("")},a8=B=>{if(ty(""),Rh(""),rn){Sk(rn);return}is(""),Yr(""),hn(!1),Fh(B)},o8=B=>(is(""),Yr(B),Ru("basic"),Fh(B)),fy=rn!=null&&rn.runtime?xo.find(B=>{var V;return B.runtimeId===((V=rn.runtime)==null?void 0:V.runtimeId)}):void 0,Wi=rn!=null&&rn.runtime?{id:`detail:${rn.runtime.runtimeId}`,label:rn.name,app:rn.name,remote:!0,runtimeApp:fy==null?void 0:fy.apps[0],runtimeId:rn.runtime.runtimeId,region:rn.runtime.region,currentVersion:rn.runtime.currentVersion,canDelete:rn.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(TK,{branding:Et,access:_t,features:bn,sessions:s,currentSessionId:a,streamingSids:Ge,onNewChat:GB,onSearch:()=>{p&&_o(),le(null),Ft(!1),jt(!1),xt(!1),hn(!1),Qs(null),Rr(!1),Kr(!0),Ae("")},onQuickCreate:()=>{if(!Zs){Ae("当前账号没有添加 Agent 的权限。");return}p&&_o(),gt.current="",l(""),Ft(!1),jt(!1),Kr(!1),hn(!1),Qs(null),Rr(!1),le(null),Yt(null),ry("cn-beijing"),xt(!0),Ae("")},onSkillCenter:()=>{p&&_o(),le(null),jt(!1),xt(!1),Kr(!1),hn(!1),Qs(null),Rr(!1),Ft(!0),Ae("")},onAddAgent:()=>{if(!Zs){Ae("当前账号没有添加 Agent 的权限。");return}p&&_o(),gt.current="",le(null),Ft(!1),Kr(!1),hn(!1),Qs(null),Rr(!1),l(""),xt(!1),jt(!0),Ae("")},onMyAgents:Tk,onPickSession:B=>{le(null),Ft(!1),jt(!1),xt(!1),Kr(!1),hn(!1),Qs(null),Rr(!1),Ae(""),Lu(B)},onDeleteSession:qB,userInfo:Je,version:On,onLogout:HB}),(()=>{const B=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(Xbe,{onExit:ko}),o.jsx(oge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Bh(n):"Agent",value:C,onChange:M,onSubmit:()=>{if(!p&&O==="skill-create"){const Ne=C.trim();if(!Ne||Z)return;const Ee={id:`pending-${Date.now()}`,prompt:Ne,status:"provisioning",candidates:U_.map((He,it)=>({id:`pending-${it}`,model:He,modelLabel:He,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};pe(!0);const qe=++J.current;Ae(""),fe(Ee),M(""),Nbe(Ne,He=>{J.current===qe&&fe(He)}).then(He=>{J.current===qe&&fe(He)}).catch(He=>{J.current===qe&&(fe(null),M(Ne),Ae(He instanceof Error?He.message:String(He)))}).finally(()=>{J.current===qe&&pe(!1)});return}const V=C;if(M(""),p){YB(V);return}const te=be,me=we;ye([]),ve(Qi()),vk(V,te,me),f1(te)},disabled:p?!1:!xe||O==="temporary"||O==="agent"&&!n,busy:p?y:O==="skill-create"?Z:ki,showMeta:L.length>0&&!p,attachments:p?[]:be,skills:p?[]:Tl,agents:p?[]:Al,invocation:p?Qi():we,capabilitiesLoading:!p&&mt,allowAttachments:!p,onInvocationChange:ve,onAddFiles:JB,onRemoveAttachment:Cl,newChatMode:p?"agent":O,newChatTask:p?null:T,newChatLayout:!p&&L.length===0&&ne===null,showModeSelector:!1,temporaryEnabled:Q&&G.temporaryEnabled,skillCreateEnabled:Q&&G.skillCreateEnabled,harnessEnabled:Q&&G.harnessEnabled,builtinTools:Q?G.builtinTools:[],onModeChange:V=>{if(!(V==="temporary"&&!G.temporaryEnabled||V==="skill-create"&&!G.skillCreateEnabled)){if(V==="temporary"){z(null),j(V),bk();return}if(j(V),V!=="agent"&&z(null),Ae(""),V==="skill-create"){ve(Qi());const te=a&&W.length===0&&be.length>0?a:"";ka(be),ye([]),te&&(gt.current="",l(""),Na(te))}}},onTaskChange:z})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(HK,{appName:n,onAppChange:Du?o8:Fh,agentLabel:Bh,agentsSource:tn,localApps:e,currentRuntime:Ol,runtimeScope:_t.capabilities.runtimeScope,onBrowseAgents:Tk,title:p?"Codex 智能体":Xs?"智能体":Mu?"添加 Agent":ju?"添加 AgentKit 智能体":Du?rn?rn.name:sy?Bh(sy):"智能体详情":void 0,titleLeading:L.length>0&&!p&&O==="agent"&&!Mu&&!ju&&!At&&!Ch&&!Du&&!Xs&&Ns===null&&n?o.jsx("button",{ref:un,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":Xt,onClick:()=>Qt(!0),children:o.jsx(Kc,{})}):void 0,crumbs:At?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Ch||ju||Mu||!Ns?void 0:Ns==="menu"?[{label:h1e,onClick:()=>{le(null),Yt(null),xt(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Mh(!0)},{label:p1e[Ns]}],rightContent:o.jsxs(o.Fragment,{children:[_t.role==="admin"&&o.jsx(ybe,{}),o.jsx(A1e,{tasks:Zs?Fe:[],onCancel:ue})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[tt&&o.jsx("div",{className:"error",children:tt}),Ys&&o.jsxs("div",{className:"session-loading",children:[o.jsx(zt,{className:"icon spin"})," 加载会话…"]}),lk&&!Du&&!Mu&&!ju&&!Ch&&!At&&Ns===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:QB,children:[o.jsx(hv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),Xs?o.jsx(yme,{onCreateAgent:s8,onCreateCodexAgent:bk,onUseAgent:Sk,onViewAgentDetails:i8,connectedRuntimeId:r8}):Du?o.jsx(ime,{agents:Wi?[Wi]:n8,drafts:_s,agentOrder:ok,selectedAgentId:n,agentInfo:Te,agentInfoAgentId:n,loadingAgentInfo:mt,canCreate:Zs,canUpdate:Zs||_k,loadingAgents:AB,agentsError:CB,deploymentTasks:Fe,focusedDeploymentTaskId:hk,focusedAgentId:(Wi==null?void 0:Wi.id)??sy,focusedAgentSection:NB,focusedCaseKind:SB,detailOnly:!!Wi||!!hk,onRetryAgents:()=>void oy(),onAgentOrderChange:MB,onDeleteAgents:jB,onDeleteDrafts:LB,onSelectAgent:Fh,onTalkAgent:a8,onOpenFeedbackCase:V=>void XB(V),onFeedbackCasesDeleted:ZB,onCreateAgent:()=>{if(!Zs){Ae("当前账号没有添加 Agent 的权限。");return}hn(!1),xt(!0),le(null),Yt(null),Ni(null),ry("cn-beijing"),qs(""),ks.current=null,is(""),Yr(""),Ae("")},onUpdateAgent:V=>{if(!_k&&!Zs){Ae("当前账号没有管理 Agent 的权限。");return}if(!(Or!=null&&Or.runtimeId)){Ae("仅支持更新已部署的云端智能体。");return}if(!Or.region){Ae("Runtime 缺少地域信息,无法更新。");return}hn(!1),Yt(V);const te=`runtime-${Or.runtimeId}`;qs(te),ks.current=_s.find(me=>me.id===te)??null,is(""),Yr(""),Ni({runtimeId:Or.runtimeId,name:Or.name,region:Or.region,currentVersion:Or.currentVersion}),le("custom"),Ae("")},onEditDraft:V=>{hn(!1),Yt(V.draft),qs(V.id),ks.current=V,Ni(V.deploymentTarget??null),is(""),Yr(""),le("custom"),Ae("")}},(Wi==null?void 0:Wi.id)??"workspace"):Mu?o.jsx(Z6,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:E1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{xt(!1),Yt(null),le("menu")}},{key:"package",icon:Uz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{xt(!1),Yt(null),le("package")}}]}):Ch?o.jsx(xK,{userId:xe,appId:n,agentInfo:Te,capabilitiesLoading:mt,agentLabel:Bh,onOpenSession:zB}):ju?o.jsx(Hse,{onAdded:V=>{Il(As()),jt(!1),r(V)},onCancel:()=>jt(!1)}):At?o.jsx($se,{}):Ns!==null&&!Ue?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Ns==="menu"?o.jsx(_0e,{onSelect:V=>{Yt(null),Ni(null),is(""),Yr(""),qs(V==="custom"?`draft-${Date.now().toString(36)}`:""),ks.current=null,le(V)},onImport:V=>{Yt(V),Ni(null),is(""),Yr(""),qs(`draft-${Date.now().toString(36)}`),ks.current=null,le("custom")}}):Ns==="intelligent"?o.jsx(Q0e,{userId:xe,onBack:()=>le("menu"),onCreate:Dh,onAgentAdded:ly,onDeploymentTaskChange:Y}):Ns==="custom"?o.jsx(Kye,{initialDraft:Un??void 0,onBack:()=>le("menu"),onCreate:Dh,onAgentAdded:ly,features:bn,onDeploymentTaskChange:Y,deploymentTarget:Rl??void 0,initialDeployRegion:Lh,onDraftChange:(V,te)=>{Vr&&(te?OB(Vr,V,Rl??void 0):pk(Vr))},onDiscard:Vr?()=>{pk(Vr),qs(""),ks.current=null,Yt(null),Ni(null),is(""),Yr(n),le(null),xt(!1),hn(!0),Ae("")}:void 0,onDeploymentStarted:mk,onDeploymentComplete:gk},Vr||"custom"):Ns==="template"?o.jsx(Gye,{onBack:()=>le("menu"),onCreate:Dh}):Ns==="workflow"?o.jsx(nbe,{onBack:()=>le("menu"),onCreate:Dh}):Ns==="package"?o.jsx(obe,{onBack:()=>{le(null),xt(!0)},onAgentAdded:ly,onDeploymentTaskChange:Y,onDeploymentStarted:mk,onDeploymentComplete:gk,initialDeployRegion:Lh}):L.length===0&&ne?o.jsx(Ube,{initialJob:ne}):L.length===0&&!Q?o.jsxs("div",{className:"session-loading",children:[o.jsx(zt,{className:"icon spin"})," 正在检查 Agent 能力…"]}):L.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(ma,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":O==="skill-create"?"想创建一个什么 Skill?":Gn}),B]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Sl?" is-streaming":""}`,ref:Ou,onScroll:DB,onWheel:PB,onTouchMove:BB,children:L.map((V,te)=>{var Ta,Aa,Dn,Gi,Qn;const me=te===L.length-1;if(V.role==="user"){const $n=V.blocks.map(as=>as.kind==="text"?as.text:"").join(""),Wr=V.blocks.flatMap(as=>as.kind==="attachment"?as.files:[]),Si=V.blocks.find(as=>as.kind==="invocation");return o.jsxs(en.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Si==null?void 0:Si.kind)==="invocation"&&o.jsx(D_,{value:Si.value}),Wr.length>0&&o.jsx(B_,{appName:n,items:Wr}),$n&&o.jsx("div",{className:"bubble",children:o.jsx(fh,{text:$n})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ta=V.meta)==null?void 0:Ta.ts)&&o.jsx("span",{className:"meta-text",children:vB(V.meta.ts)}),o.jsx(kI,{text:$n})]})]},te)}const Ne=((Aa=V.meta)==null?void 0:Aa.author)??"",Ee=Ne&&ar?Ux(ar,Ne):void 0,qe=!!(Ne&&Eo.length>0&&!Eo.includes(Ne)),He=(Ee==null?void 0:Ee.name)||Ne,it=(Ee==null?void 0:Ee.description)||(qe?"正在执行主 Agent 移交的任务。":"");if(V.blocks.length>0&&V.blocks.every($n=>$n.kind==="agent-transfer"))return null;const Lt=V.blocks.length===0,Be=((Gi=(Dn=V.meta)==null?void 0:Dn.feedback)==null?void 0:Gi.rating)??null,ut=((Qn=V.meta)==null?void 0:Qn.eventId)??"",Zt=ze.has(ut),or=!!(Ol&&ut&&_I(V));return o.jsxs(en.div,{ref:$n=>{ut&&($n?cy.current.set(ut,$n):cy.current.delete(ut))},className:["turn turn--assistant",qe?"turn--subagent":"",Ih===ut?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[qe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(Dz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:He})]}),o.jsx("p",{className:"subagent-run-description",title:it,children:it})]}),Lt?me&&ws?o.jsx(q6,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(F_,{appName:n,blocks:V.blocks,streaming:me&&(ws||wa),onStreamFrame:me?FB:void 0,onAction:e8,onAuth:t8,onArtifactDownload:($n,Wr)=>VM(n,xe,a,$n,Wr),onArtifactPreview:($n,Wr)=>YM(n,xe,a,$n,Wr)}),!(me&&ws)&&!_1e(V)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(me&&ws)&&!k1e(V)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[or&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Be==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":Be==="good","aria-busy":Zt,title:Be==="good"?"取消点赞":"赞",disabled:Zt,onClick:()=>void Nk(V,Be==="good"?null:"good"),children:o.jsx(Qbe,{className:"icon",filled:Be==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Be==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":Be==="bad","aria-busy":Zt,title:Be==="bad"?"取消点踩":"踩",disabled:Zt,onClick:()=>void Nk(V,Be==="bad"?null:"bad"),children:o.jsx(Zbe,{className:"icon",filled:Be==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>cn(!0),children:o.jsx(x1e,{})}),o.jsx(kI,{text:_I(V)})]}),V.meta&&o.jsx("span",{className:"meta-text",children:w1e(V.meta)})]})]})]},te)})}),!p&&o.jsx(Lj,{appName:n,info:Te,loading:mt,activeAgent:Ws,seenAgents:vs,execPath:va,capabilities:Ye,capabilityLoading:Se,capabilityMutating:ee,builtinTools:ct,onAddCapability:xk,onRemoveCapability:V=>void wk(V)}),o.jsx("div",{className:"conversation-composer-slot",children:B})]})]})]})})(),Fn&&a&&o.jsx(sB,{appName:n,sessionId:a,onClose:()=>cn(!1)}),Xt&&L.length>0&&o.jsx(aY,{appName:n,info:Te,loading:mt,activeAgent:Ws,seenAgents:vs,execPath:va,capabilities:Ye,capabilityLoading:Se,capabilityMutating:ee,builtinTools:ct,onAddCapability:xk,onRemoveCapability:B=>void wk(B),onClose:dn,returnFocusRef:un}),o.jsx(qbe,{open:x,state:k,error:A,onCancel:VB,onConfirm:()=>void KB()}),Ht&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:Ht}),o.jsx(t1e,{open:de,checking:Ie,error:ft,onLogin:()=>void UB()}),RB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Mh(!1),children:o.jsxs("div",{className:"confirm-box",onClick:B=>B.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Mh(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{Yt(null),le("menu"),Mh(!1)},children:"确定返回"})]})]})})]})}const TI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(TI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(TI,String(t))}catch{}window.location.reload()}});(()=>{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})()||h1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(Y9,{reducedMotion:"user",children:o.jsx(Nz,{maskOpacity:.9,children:o.jsx(R1e,{})})})}));export{E as A,x0 as B,ms as C,D1e as D,Ud as E,ll as F,v3 as G,L1e as R,Tr as V,kt as a,qc as b,g2 as c,P1e as d,Hv as e,hq as f,Cf as g,Dt as h,IQ as i,PQ as j,mq as k,Kf as l,PZ as m,bQ as n,EQ as o,KZ as p,dZ as q,fZ as r,L3 as s,o as t,rt as u,nn as v,Ct as w,j1e as x,AQ as y,$s as z}; diff --git a/veadk/webui/assets/index-aX9VS-d9.css b/veadk/webui/assets/index-ClNM_Oc4.css similarity index 98% rename from veadk/webui/assets/index-aX9VS-d9.css rename to veadk/webui/assets/index-ClNM_Oc4.css index 1e4130f0..c6c03009 100644 --- a/veadk/webui/assets/index-aX9VS-d9.css +++ b/veadk/webui/assets/index-ClNM_Oc4.css @@ -7,4 +7,4 @@ 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:9px 56px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group.is-compact-empty .abc-group-head{border-bottom:0}.abc-group-head>span:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.app-toast{position:fixed;top:20px;left:50%;z-index:120;padding:9px 14px;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 8px 24px hsl(var(--foreground) / .18);font-size:13px;font-weight:400;transform:translate(-50%)} +*/.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:9px 56px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group.is-compact-empty .abc-group-head{border-bottom:0}.abc-group-head>span:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.studio-confirm-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:studio-confirm-fade-in .14s ease-out}.studio-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;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 24px 64px hsl(var(--foreground) / .16);animation:studio-confirm-rise-in .18s cubic-bezier(.2,.8,.2,1)}.studio-confirm-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))}.studio-confirm-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.studio-confirm-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:#f59f0a1f;color:#ba6708}.studio-confirm-title-icon svg,.studio-confirm-close svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-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;transition:background .16s ease,color .16s ease}.studio-confirm-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-confirm-close:focus-visible,.studio-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.studio-confirm-close:disabled{cursor:not-allowed;opacity:.48}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.studio-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.studio-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}.studio-confirm-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.studio-confirm-actions button:disabled{cursor:not-allowed;opacity:.6}.studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.studio-confirm-dialog--danger .studio-confirm-title-icon{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--destructive) / .9)}@keyframes studio-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes studio-confirm-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.studio-confirm-backdrop,.studio-confirm-dialog{animation:none}}.app-toast{position:fixed;top:20px;left:50%;z-index:120;padding:9px 14px;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 8px 24px hsl(var(--foreground) / .18);font-size:13px;font-weight:400;transform:translate(-50%)} diff --git a/veadk/webui/assets/index-Mps5FwwT.js b/veadk/webui/assets/index-Mps5FwwT.js new file mode 100644 index 00000000..c8cfd232 --- /dev/null +++ b/veadk/webui/assets/index-Mps5FwwT.js @@ -0,0 +1,736 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-CD1RMBf6.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +var d8=Object.defineProperty;var f8=(e,t,n)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Mk=(e,t,n)=>f8(e,typeof t!="symbol"?t+"":t,n);function h8(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 wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var II={exports:{}},Bg={},RI={exports:{}},Ct={};/** + * @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 Gf=Symbol.for("react.element"),p8=Symbol.for("react.portal"),m8=Symbol.for("react.fragment"),g8=Symbol.for("react.strict_mode"),y8=Symbol.for("react.profiler"),b8=Symbol.for("react.provider"),E8=Symbol.for("react.context"),x8=Symbol.for("react.forward_ref"),w8=Symbol.for("react.suspense"),v8=Symbol.for("react.memo"),_8=Symbol.for("react.lazy"),jk=Symbol.iterator;function k8(e){return e===null||typeof e!="object"?null:(e=jk&&e[jk]||e["@@iterator"],typeof e=="function"?e:null)}var OI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LI=Object.assign,MI={};function du(e,t,n){this.props=e,this.context=t,this.refs=MI,this.updater=n||OI}du.prototype.isReactComponent={};du.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")};du.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jI(){}jI.prototype=du.prototype;function $x(e,t,n){this.props=e,this.context=t,this.refs=MI,this.updater=n||OI}var Hx=$x.prototype=new jI;Hx.constructor=$x;LI(Hx,du.prototype);Hx.isPureReactComponent=!0;var Dk=Array.isArray,DI=Object.prototype.hasOwnProperty,zx={current:null},PI={key:!0,ref:!0,__self:!0,__source:!0};function BI(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)DI.call(t,r)&&!PI.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,G=L[z];if(0>>1;zs(Q,A))ses(de,Q)?(L[z]=de,L[se]=A,z=se):(L[z]=Q,L[re]=A,z=re);else if(ses(de,A))L[z]=de,L[se]=A,z=se;else break e}}return P}function s(L,P){var A=L.sortIndex-P.sortIndex;return A!==0?A:L.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(L){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=L)r(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function _(L){if(g=!1,x(L),!m)if(n(c)!==null)m=!0,C(k);else{var P=n(u);P!==null&&j(_,P.startTime-L)}}function k(L,P){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var A=h;try{for(x(P),f=n(c);f!==null&&(!(f.expirationTime>P)||L&&!D());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var G=z(f.expirationTime<=P);P=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),x(P)}else r(c);f=n(c)}if(f!==null)var B=!0;else{var re=n(u);re!==null&&j(_,re.startTime-P),B=!1}return B}finally{f=null,h=A,p=!1}}var N=!1,T=null,S=-1,R=5,I=-1;function D(){return!(e.unstable_now()-IL||125z?(L.sortIndex=A,t(u,L),n(c)===null&&L===n(u)&&(g?(y(S),S=-1):g=!0,j(_,A-z))):(L.sortIndex=G,t(c,L),m||p||(m=!0,C(k))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var P=h;return function(){var A=h;h=P;try{return L.apply(this,arguments)}finally{h=A}}}})(zI);HI.exports=zI;var j8=HI.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 D8=E,hs=j8;function Ie(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"),p1=Object.prototype.hasOwnProperty,P8=/^[: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]*$/,Bk={},Fk={};function B8(e){return p1.call(Fk,e)?!0:p1.call(Bk,e)?!1:P8.test(e)?Fk[e]=!0:(Bk[e]=!0,!1)}function F8(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 U8(e,t,n,r){if(t===null||typeof t>"u"||F8(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 $r(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 hr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hr[e]=new $r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hr[t]=new $r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hr[e]=new $r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hr[e]=new $r(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){hr[e]=new $r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hr[e]=new $r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hr[e]=new $r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hr[e]=new $r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hr[e]=new $r(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kx=/[\-:]([a-z])/g;function Yx(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(Kx,Yx);hr[t]=new $r(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(Kx,Yx);hr[t]=new $r(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(Kx,Yx);hr[t]=new $r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hr[e]=new $r(e,1,!1,e.toLowerCase(),null,!1,!1)});hr.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hr[e]=new $r(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wx(e,t,n,r){var s=hr.hasOwnProperty(t)?hr[t]:null;(s!==null?s.type!==0:r||!(2l||s[a]!==i[l]){var c=` +`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{yy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?dd(e):""}function $8(e){switch(e.tag){case 5:return dd(e.type);case 16:return dd("Lazy");case 13:return dd("Suspense");case 19:return dd("SuspenseList");case 0:case 2:case 15:return e=by(e.type,!1),e;case 11:return e=by(e.type.render,!1),e;case 1:return e=by(e.type,!0),e;default:return""}}function b1(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 Yl:return"Fragment";case Kl:return"Portal";case m1:return"Profiler";case Gx:return"StrictMode";case g1:return"Suspense";case y1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case YI:return(e.displayName||"Context")+".Consumer";case KI:return(e._context.displayName||"Context")+".Provider";case qx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xx:return t=e.displayName||null,t!==null?t:b1(e.type)||"Memo";case Pa:t=e._payload,e=e._init;try{return b1(e(t))}catch{}}return null}function H8(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 b1(t);case 8:return t===Gx?"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 ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function GI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z8(e){var t=GI(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 Vh(e){e._valueTracker||(e._valueTracker=z8(e))}function qI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=GI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vm(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 E1(e,t){var n=t.checked;return In({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $k(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ao(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 XI(e,t){t=t.checked,t!=null&&Wx(e,"checked",t,!1)}function x1(e,t){XI(e,t);var n=ao(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")?w1(e,t.type,n):t.hasOwnProperty("defaultValue")&&w1(e,t.type,ao(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hk(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 w1(e,t,n){(t!=="number"||vm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var fd=Array.isArray;function yc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Kh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sd={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},V8=["Webkit","ms","Moz","O"];Object.keys(Sd).forEach(function(e){V8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sd[t]=Sd[e]})});function eR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Sd.hasOwnProperty(e)&&Sd[e]?(""+t).trim():t+"px"}function tR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=eR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var K8=In({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 k1(e,t){if(t){if(K8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ie(62))}}function N1(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 S1=null;function Qx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var T1=null,bc=null,Ec=null;function Kk(e){if(e=Qf(e)){if(typeof T1!="function")throw Error(Ie(280));var t=e.stateNode;t&&(t=zg(t),T1(e.stateNode,e.type,t))}}function nR(e){bc?Ec?Ec.push(e):Ec=[e]:bc=e}function rR(){if(bc){var e=bc,t=Ec;if(Ec=bc=null,Kk(e),t)for(e=0;e>>=0,e===0?32:31-(nF(e)/rF|0)|0}var Yh=64,Wh=4194304;function hd(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 Sm(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 l=a&~s;l!==0?r=hd(l):(i&=a,i!==0&&(r=hd(i)))}else a=n&~s,a!==0?r=hd(a):i!==0&&(r=hd(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 qf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=n}function oF(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=Ad),eN=" ",tN=!1;function _R(e,t){switch(e){case"keyup":return jF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wl=!1;function PF(e,t){switch(e){case"compositionend":return kR(t);case"keypress":return t.which!==32?null:(tN=!0,eN);case"textInput":return e=t.data,e===eN&&tN?null:e;default:return null}}function BF(e,t){if(Wl)return e==="compositionend"||!iw&&_R(e,t)?(e=wR(),Kp=nw=Va=null,Wl=!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=iN(n)}}function AR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?AR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function CR(){for(var e=window,t=vm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vm(e.document)}return t}function aw(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 WF(e){var t=CR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&AR(n.ownerDocument.documentElement,n)){if(r!==null&&aw(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=aN(n,i);var a=aN(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,Gl=null,L1=null,Id=null,M1=!1;function oN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M1||Gl==null||Gl!==vm(r)||(r=Gl,"selectionStart"in r&&aw(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}),Id&&uf(Id,r)||(Id=r,r=Cm(L1,"onSelect"),0Ql||(e.current=U1[Ql],U1[Ql]=null,Ql--)}function cn(e,t){Ql++,U1[Ql]=e.current,e.current=t}var oo={},Nr=fo(oo),Qr=fo(!1),el=oo;function jc(e,t){var n=e.type.contextTypes;if(!n)return oo;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 Zr(e){return e=e.childContextTypes,e!=null}function Rm(){mn(Qr),mn(Nr)}function pN(e,t,n){if(Nr.current!==oo)throw Error(Ie(168));cn(Nr,t),cn(Qr,n)}function BR(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(Ie(108,H8(e)||"Unknown",s));return In({},n,r)}function Om(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,el=Nr.current,cn(Nr,e),cn(Qr,Qr.current),!0}function mN(e,t,n){var r=e.stateNode;if(!r)throw Error(Ie(169));n?(e=BR(e,t,el),r.__reactInternalMemoizedMergedChildContext=e,mn(Qr),mn(Nr),cn(Nr,e)):mn(Qr),cn(Qr,n)}var ea=null,Vg=!1,Oy=!1;function FR(e){ea===null?ea=[e]:ea.push(e)}function i9(e){Vg=!0,FR(e)}function ho(){if(!Oy&&ea!==null){Oy=!0;var e=0,t=qt;try{var n=ea;for(qt=1;e>=a,s-=a,na=1<<32-fi(t)+s|n<S?(R=T,T=null):R=T.sibling;var I=h(y,T,x[S],_);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(y,T),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,T=R}if(S===x.length)return n(y,T),En&&Ao(y,S),k;if(T===null){for(;SS?(R=T,T=null):R=T.sibling;var D=h(y,T,I.value,_);if(D===null){T===null&&(T=R);break}e&&T&&D.alternate===null&&t(y,T),b=i(D,b,S),N===null?k=D:N.sibling=D,N=D,T=R}if(I.done)return n(y,T),En&&Ao(y,S),k;if(T===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return En&&Ao(y,S),k}for(T=r(y,T);!I.done;S++,I=x.next())I=p(T,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&T.forEach(function(U){return t(y,U)}),En&&Ao(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Yl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case zh:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Yl){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pa&&bN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=Yu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Yl?(b=Wo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=Jp(x.type,x.key,x.props,null,y.mode,_),_.ref=Yu(y,b,x),_.return=y,y=_)}return a(y);case Kl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Uy(x,y.mode,_),b.return=y,y=b}return a(y);case Pa:return N=x._init,w(y,b,N(x._payload),_)}if(fd(x))return m(y,b,x,_);if($u(x))return g(y,b,x,_);ep(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=Fy(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var Pc=zR(!0),VR=zR(!1),jm=fo(null),Dm=null,ec=null,uw=null;function dw(){uw=ec=Dm=null}function fw(e){var t=jm.current;mn(jm),e._currentValue=t}function z1(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 wc(e,t){Dm=e,uw=ec=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qr=!0),e.firstContext=null)}function Fs(e){var t=e._currentValue;if(uw!==e)if(e={context:e,memoizedValue:t,next:null},ec===null){if(Dm===null)throw Error(Ie(308));ec=e,Dm.dependencies={lanes:0,firstContext:e}}else ec=ec.next=e;return t}var Fo=null;function hw(e){Fo===null?Fo=[e]:Fo.push(e)}function KR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,hw(t)):(n.next=s.next,s.next=n),t.interleaved=n,fa(e,r)}function fa(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 pw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YR(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 aa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,fa(e,n)}return s=r.interleaved,s===null?(t.next=t,hw(r)):(t.next=s.next,s.next=t),r.interleaved=t,fa(e,n)}function Wp(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,Jx(e,n)}}function EN(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 Pm(e,t,n,r){var s=e.updateQueue;Ba=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=In({},f,h);break e;case 2:Ba=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);rl|=a,e.lanes=a,e.memoizedState=f}}function xN(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=My.transition;My.transition={};try{e(!1),t()}finally{qt=n,My.transition=r}}function cO(){return Us().memoizedState}function c9(e,t,n){var r=to(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uO(e))dO(t,n);else if(n=KR(e,t,n,r),n!==null){var s=Br();hi(n,e,r,s),fO(n,t,r)}}function u9(e,t,n){var r=to(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uO(e))dO(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,yi(l,a)){var c=t.interleaved;c===null?(s.next=s,hw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=KR(e,t,s,r),n!==null&&(s=Br(),hi(n,e,r,s),fO(n,t,r))}}function uO(e){var t=e.alternate;return e===Cn||t!==null&&t===Cn}function dO(e,t){Rd=Fm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jx(e,n)}}var Um={readContext:Fs,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},d9={readContext:Fs,useCallback:function(e,t){return Ti().memoizedState=[e,t===void 0?null:t],e},useContext:Fs,useEffect:vN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qp(4194308,4,sO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return qp(4,2,e,t)},useMemo:function(e,t){var n=Ti();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ti();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=c9.bind(null,Cn,e),[r.memoizedState,e]},useRef:function(e){var t=Ti();return e={current:e},t.memoizedState=e},useState:wN,useDebugValue:vw,useDeferredValue:function(e){return Ti().memoizedState=e},useTransition:function(){var e=wN(!1),t=e[0];return e=l9.bind(null,e[1]),Ti().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Cn,s=Ti();if(En){if(n===void 0)throw Error(Ie(407));n=n()}else{if(n=t(),or===null)throw Error(Ie(349));nl&30||XR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,vN(ZR.bind(null,r,i,e),[e]),r.flags|=2048,bf(9,QR.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ti(),t=or.identifierPrefix;if(En){var n=ra,r=na;n=(r&~(1<<32-fi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gf++,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[Ri]=t,e[hf]=r,vO(e,t,!1,!1),t.stateNode=e;e:{switch(a=N1(n,r),n){case"dialog":pn("cancel",e),pn("close",e),s=r;break;case"iframe":case"object":case"embed":pn("load",e),s=r;break;case"video":case"audio":for(s=0;sUc&&(t.flags|=128,r=!0,Wu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Bm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!En)return Er(t),null}else 2*Fn()-i.renderingStartTime>Uc&&n!==1073741824&&(t.flags|=128,r=!0,Wu(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=Fn(),t.sibling=null,n=Tn.current,cn(Tn,r?n&1|2:n&1),t):(Er(t),null);case 22:case 23:return Aw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?os&1073741824&&(Er(t),t.subtreeFlags&6&&(t.flags|=8192)):Er(t),null;case 24:return null;case 25:return null}throw Error(Ie(156,t.tag))}function E9(e,t){switch(lw(t),t.tag){case 1:return Zr(t.type)&&Rm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bc(),mn(Qr),mn(Nr),yw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gw(t),null;case 13:if(mn(Tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ie(340));Dc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mn(Tn),null;case 4:return Bc(),null;case 10:return fw(t.type._context),null;case 22:case 23:return Aw(),null;case 24:return null;default:return null}}var np=!1,wr=!1,x9=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function tc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ln(e,t,r)}else n.current=null}function Z1(e,t,n){try{n()}catch(r){Ln(e,t,r)}}var LN=!1;function w9(e,t){if(j1=Tm,e=CR(),aw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(D1={focusedElem:e,selectionRange:n},Tm=!1,Ke=t;Ke!==null;)if(t=Ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ke=e;else for(;Ke!==null;){t=Ke;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:ri(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ie(163))}}catch(_){Ln(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ke=e;break}Ke=t.return}return m=LN,LN=!1,m}function Od(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&&Z1(t,n,i)}s=s.next}while(s!==r)}}function Wg(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 J1(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 NO(e){var t=e.alternate;t!==null&&(e.alternate=null,NO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ri],delete t[hf],delete t[F1],delete t[r9],delete t[s9])),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 SO(e){return e.tag===5||e.tag===3||e.tag===4}function MN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SO(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 eE(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=Im));else if(r!==4&&(e=e.child,e!==null))for(eE(e,t,n),e=e.sibling;e!==null;)eE(e,t,n),e=e.sibling}function tE(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(tE(e,t,n),e=e.sibling;e!==null;)tE(e,t,n),e=e.sibling}var cr=null,si=!1;function Ca(e,t,n){for(n=n.child;n!==null;)TO(e,t,n),n=n.sibling}function TO(e,t,n){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(Fg,n)}catch{}switch(n.tag){case 5:wr||tc(n,t);case 6:var r=cr,s=si;cr=null,Ca(e,t,n),cr=r,si=s,cr!==null&&(si?(e=cr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cr.removeChild(n.stateNode));break;case 18:cr!==null&&(si?(e=cr,n=n.stateNode,e.nodeType===8?Ry(e.parentNode,n):e.nodeType===1&&Ry(e,n),lf(e)):Ry(cr,n.stateNode));break;case 4:r=cr,s=si,cr=n.stateNode.containerInfo,si=!0,Ca(e,t,n),cr=r,si=s;break;case 0:case 11:case 14:case 15:if(!wr&&(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)&&Z1(n,t,a),s=s.next}while(s!==r)}Ca(e,t,n);break;case 1:if(!wr&&(tc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ln(n,t,l)}Ca(e,t,n);break;case 21:Ca(e,t,n);break;case 22:n.mode&1?(wr=(r=wr)||n.memoizedState!==null,Ca(e,t,n),wr=r):Ca(e,t,n);break;default:Ca(e,t,n)}}function jN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new x9),t.forEach(function(r){var s=I9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Js(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Fn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_9(r/1960))-r,10e?16:e,Ka===null)var r=!1;else{if(e=Ka,Ka=null,zm=0,Dt&6)throw Error(Ie(331));var s=Dt;for(Dt|=4,Ke=e.current;Ke!==null;){var i=Ke,a=i.child;if(Ke.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cFn()-Sw?Yo(e,0):Nw|=n),Jr(e,t)}function jO(e,t){t===0&&(e.mode&1?(t=Wh,Wh<<=1,!(Wh&130023424)&&(Wh=4194304)):t=1);var n=Br();e=fa(e,t),e!==null&&(qf(e,t,n),Jr(e,n))}function C9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jO(e,n)}function I9(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(Ie(314))}r!==null&&r.delete(t),jO(e,n)}var DO;DO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qr.current)qr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qr=!1,y9(e,t,n);qr=!!(e.flags&131072)}else qr=!1,En&&t.flags&1048576&&UR(t,Mm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xp(e,t),e=t.pendingProps;var s=jc(t,Nr.current);wc(t,n),s=Ew(null,t,r,e,s,n);var i=xw();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,Zr(r)?(i=!0,Om(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pw(t),s.updater=Yg,t.stateNode=s,s._reactInternals=t,K1(t,r,e,n),t=G1(null,t,r,!0,i,n)):(t.tag=0,En&&i&&ow(t),Mr(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=O9(r),e=ri(r,e),s){case 0:t=W1(null,t,r,e,n);break e;case 1:t=IN(null,t,r,e,n);break e;case 11:t=AN(null,t,r,e,n);break e;case 14:t=CN(null,t,r,ri(r.type,e),n);break e}throw Error(Ie(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),W1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),IN(e,t,r,s,n);case 3:e:{if(EO(t),e===null)throw Error(Ie(387));r=t.pendingProps,i=t.memoizedState,s=i.element,YR(e,t),Pm(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=Fc(Error(Ie(423)),t),t=RN(e,t,r,n,s);break e}else if(r!==s){s=Fc(Error(Ie(424)),t),t=RN(e,t,r,n,s);break e}else for(cs=Za(t.stateNode.containerInfo.firstChild),us=t,En=!0,ai=null,n=VR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dc(),r===s){t=ha(e,t,n);break e}Mr(e,t,r,n)}t=t.child}return t;case 5:return WR(t),e===null&&H1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,P1(r,s)?a=null:i!==null&&P1(r,i)&&(t.flags|=32),bO(e,t),Mr(e,t,a,n),t.child;case 6:return e===null&&H1(t),null;case 13:return xO(e,t,n);case 4:return mw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pc(t,null,r,n):Mr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),AN(e,t,r,s,n);case 7:return Mr(e,t,t.pendingProps,n),t.child;case 8:return Mr(e,t,t.pendingProps.children,n),t.child;case 12:return Mr(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,cn(jm,r._currentValue),r._currentValue=a,i!==null)if(yi(i.value,a)){if(i.children===s.children&&!Qr.current){t=ha(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=aa(-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),z1(i.return,n,t),l.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(Ie(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),z1(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}Mr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,wc(t,n),s=Fs(s),r=r(s),t.flags|=1,Mr(e,t,r,n),t.child;case 14:return r=t.type,s=ri(r,t.pendingProps),s=ri(r.type,s),CN(e,t,r,s,n);case 15:return gO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),Xp(e,t),t.tag=1,Zr(r)?(e=!0,Om(t)):e=!1,wc(t,n),hO(t,r,s),K1(t,r,s,n),G1(null,t,r,!0,e,n);case 19:return wO(e,t,n);case 22:return yO(e,t,n)}throw Error(Ie(156,t.tag))};function PO(e,t){return uR(e,t)}function R9(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 js(e,t,n,r){return new R9(e,t,n,r)}function Iw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function O9(e){if(typeof e=="function")return Iw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qx)return 11;if(e===Xx)return 14}return 2}function no(e,t){var n=e.alternate;return n===null?(n=js(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 Jp(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Iw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Yl:return Wo(n.children,s,i,t);case Gx:a=8,s|=8;break;case m1:return e=js(12,n,t,s|2),e.elementType=m1,e.lanes=i,e;case g1:return e=js(13,n,t,s),e.elementType=g1,e.lanes=i,e;case y1:return e=js(19,n,t,s),e.elementType=y1,e.lanes=i,e;case WI:return qg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case KI:a=10;break e;case YI:a=9;break e;case qx:a=11;break e;case Xx:a=14;break e;case Pa:a=16,r=null;break e}throw Error(Ie(130,e==null?e:typeof e,""))}return t=js(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Wo(e,t,n,r){return e=js(7,e,r,t),e.lanes=n,e}function qg(e,t,n,r){return e=js(22,e,r,t),e.elementType=WI,e.lanes=n,e.stateNode={isHidden:!1},e}function Fy(e,t,n){return e=js(6,e,null,t),e.lanes=n,e}function Uy(e,t,n){return t=js(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function L9(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=xy(0),this.expirationTimes=xy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Rw(e,t,n,r,s,i,a,l,c){return e=new L9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=js(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pw(i),e}function M9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($O)}catch(e){console.error(e)}}$O(),$I.exports=ys;var ps=$I.exports,zN=ps;h1.createRoot=zN.createRoot,h1.hydrateRoot=zN.hydrateRoot;const jw=E.createContext({});function e0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const t0=E.createContext(null),xf=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class F9 extends E.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 U9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(xf);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)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: ${l}px !important; + top: ${c}px !important; + left: ${u}px !important; + } + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(F9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const $9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=e0(H9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(U9,{isPresent:n,children:e})),o.jsx(t0.Provider,{value:d,children:e})};function H9(){return new Map}function HO(e=!0){const t=E.useContext(t0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const ip=e=>e.key||"";function VN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Dw=typeof window<"u",zO=Dw?E.useLayoutEffect:E.useEffect,oi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=HO(a),u=E.useMemo(()=>VN(e),[e]),d=a&&!l?[]:u.map(ip),f=E.useRef(!0),h=E.useRef(u),p=e0(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);zO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=ip(_),N=a&&!l?!1:u===w||d.includes(k),T=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx($9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:T,children:_},k)})})},ds=e=>e;let VO=ds;const z9={useManualTiming:!1};function V9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const ap=["read","resolveKeyframes","update","preRender","render","postRender"],K9=40;function KO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ap.reduce((y,b)=>(y[b]=V9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,K9),1),s.timestamp=y,s.isProcessing=!0,l.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:ap.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bKN[e].some(n=>!!t[n])};function Y9(e){for(const t in e)$c[t]={...$c[t],...e[t]}}const W9=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 Ym(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||W9.has(e)}let WO=e=>!Ym(e);function GO(e){e&&(WO=t=>t.startsWith("on")?!Ym(t):e(t))}try{GO(require("@emotion/is-prop-valid").default)}catch{}function G9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(WO(s)||n===!0&&Ym(s)||!t&&!Ym(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function q9({children:e,isValidProp:t,...n}){t&&GO(t),n={...E.useContext(xf),...n},n.isStatic=e0(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(xf.Provider,{value:r,children:e})}function X9(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 n0=E.createContext({});function wf(e){return typeof e=="string"||Array.isArray(e)}function r0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Pw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bw=["initial",...Pw];function s0(e){return r0(e.animate)||Bw.some(t=>wf(e[t]))}function qO(e){return!!(s0(e)||e.variants)}function Q9(e,t){if(s0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wf(n)?n:void 0,animate:wf(r)?r:void 0}}return e.inherit!==!1?t:{}}function Z9(e){const{initial:t,animate:n}=Q9(e,E.useContext(n0));return E.useMemo(()=>({initial:t,animate:n}),[YN(t),YN(n)])}function YN(e){return Array.isArray(e)?e.join(" "):e}const J9=Symbol.for("motionComponentSymbol");function rc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eU(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rc(n)&&(n.current=r))},[t])}const Fw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),tU="framerAppearId",XO="data-"+Fw(tU),{schedule:Uw}=KO(queueMicrotask,!1),QO=E.createContext({});function nU(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(n0),c=E.useContext(YO),u=E.useContext(t0),d=E.useContext(xf).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(QO);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&rU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[XO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return zO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Uw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function rU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ZO(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&rc(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function ZO(e){if(e)return e.options.allowProjection!==!1?e.projection:ZO(e.parent)}function sU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&Y9(e);function l(u,d){let f;const h={...E.useContext(xf),...u,layoutId:iU(u)},{isStatic:p}=h,m=Z9(u),g=r(u,p);if(!p&&Dw){aU();const w=oU(h);f=w.MeasureLayout,m.visualElement=nU(s,g,h,t,w.ProjectionNode)}return o.jsxs(n0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,eU(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[J9]=s,c}function iU({layoutId:e}){const t=E.useContext(jw).id;return t&&e!==void 0?t+"-"+e:e}function aU(e,t){E.useContext(YO).strict}function oU(e){const{drag:t,layout:n}=$c;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 lU=["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 $w(e){return typeof e!="string"||e.includes("-")?!1:!!(lU.indexOf(e)>-1||/[A-Z]/u.test(e))}function WN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Hw(e,t,n,r){if(typeof t=="function"){const[s,i]=WN(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]=WN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const aE=e=>Array.isArray(e),cU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),uU=e=>aE(e)?e[e.length-1]||0:e,vr=e=>!!(e&&e.getVelocity);function em(e){const t=vr(e)?e.get():e;return cU(t)?t.toValue():t}function dU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:fU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const JO=e=>(t,n)=>{const r=E.useContext(n0),s=E.useContext(t0),i=()=>dU(e,t,r,s);return n?i():e0(i)};function fU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=em(i[h]);let{initial:a,animate:l}=e;const c=s0(e),u=qO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!r0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),tL=eL("--"),hU=eL("var(--"),zw=e=>hU(e)?pU.test(e.split("/*")[0].trim()):!1,pU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,nL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,pa=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},vf={...mu,transform:e=>pa(0,1,e)},op={...mu,default:1},Jf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ma=Jf("deg"),ji=Jf("%"),ct=Jf("px"),mU=Jf("vh"),gU=Jf("vw"),GN={...ji,parse:e=>ji.parse(e)/100,transform:e=>ji.transform(e*100)},yU={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,backgroundPositionX:ct,backgroundPositionY:ct},bU={rotate:Ma,rotateX:Ma,rotateY:Ma,rotateZ:Ma,scale:op,scaleX:op,scaleY:op,scaleZ:op,skew:Ma,skewX:Ma,skewY:Ma,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:vf,originX:GN,originY:GN,originZ:ct},qN={...mu,transform:Math.round},Vw={...yU,...bU,zIndex:qN,size:ct,fillOpacity:vf,strokeOpacity:vf,numOctaves:qN},EU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xU=pu.length;function wU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),rL=()=>({...Ww(),attrs:{}}),Gw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function sL(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 iL=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 aL(e,t,n,r){sL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(iL.has(s)?s:Fw(s),t.attrs[s])}const Wm={};function SU(e){Object.assign(Wm,e)}function oL(e,{layout:t,layoutId:n}){return yl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Wm[e]||e==="opacity")}function qw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(vr(s[a])||t.style&&vr(t.style[a])||oL(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 lL(e,t,n){const r=qw(e,t,n);for(const s in e)if(vr(e[s])||vr(t[s])){const i=pu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function TU(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 QN=["x","y","width","height","cx","cy","r"],AU={useVisualState:JO({scrapeMotionValuesFromProps:lL,createRenderState:rL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(yl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{TU(n,r),gn.render(()=>{Yw(r,s,Gw(n.tagName),e.transformTemplate),aL(n,r)})})}})},CU={useVisualState:JO({scrapeMotionValuesFromProps:qw,createRenderState:Ww})};function cL(e,t,n){for(const r in t)!vr(t[r])&&!oL(r,n)&&(e[r]=t[r])}function IU({transformTemplate:e},t){return E.useMemo(()=>{const n=Ww();return Kw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RU(e,t){const n=e.style||{},r={};return cL(r,n,e),Object.assign(r,IU(e,t)),r}function OU(e,t){const n={},r=RU(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 LU(e,t,n,r){const s=E.useMemo(()=>{const i=rL();return Yw(i,t,Gw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};cL(i,e.style,e),s.style={...i,...s.style}}return s}function MU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=($w(n)?LU:OU)(r,i,a,n),u=G9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>vr(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function jU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...$w(r)?AU:CU,preloadedFeatures:e,useRender:MU(s),createVisualElement:t,Component:r};return sU(a)}}function uL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(tm===void 0&&Di.set(ur.isProcessing||z9.useManualTiming?ur.timestamp:performance.now()),tm),set:e=>{tm=e,queueMicrotask(DU)}};function Qw(e,t){e.indexOf(t)===-1&&e.push(t)}function Zw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Jw{constructor(){this.subscriptions=[]}add(t){return Qw(this.subscriptions,t),()=>Zw(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 BU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Di.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=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=PU(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 Jw);const r=this.events[t].add(n);return t==="change"?()=>{r(),gn.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=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ZN)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ZN);return fL(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 _f(e,t){return new BU(e,t)}function FU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_f(n))}function UU(e,t){const n=i0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=uU(i[a]);FU(e,a,l)}}function $U(e){return!!(vr(e)&&e.add)}function oE(e,t){const n=e.getValue("willChange");if($U(n))return n.add(t)}function hL(e){return e.props[XO]}function ev(e){let t;return()=>(t===void 0&&(t=e()),t)}const HU=ev(()=>window.ScrollTimeline!==void 0);class zU{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(HU()&&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 VU extends zU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const oa=e=>e*1e3,la=e=>e/1e3;function tv(e){return typeof e=="function"}function JN(e,t){e.timeline=t,e.onfinish=null}const nv=e=>Array.isArray(e)&&typeof e[0]=="number",KU={linearEasing:void 0};function YU(e,t){const n=ev(e);return()=>{var r;return(r=KU[t])!==null&&r!==void 0?r:n()}}const Gm=YU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},pL=(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})`,lE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:md([0,.65,.55,1]),circOut:md([.55,0,1,.45]),backIn:md([.31,.01,.66,-.59]),backOut:md([.33,1.53,.69,.99])};function gL(e,t){if(e)return typeof e=="function"&&Gm()?pL(e,t):nv(e)?md(e):Array.isArray(e)?e.map(n=>gL(n,t)||lE.easeOut):lE[e]}const yL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,WU=1e-7,GU=12;function qU(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=yL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>WU&&++lqU(i,0,1,e,n);return i=>i===0||i===1?i:yL(s(i),t,r)}const bL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,EL=e=>t=>1-e(1-t),xL=eh(.33,1.53,.69,.99),rv=EL(xL),wL=bL(rv),vL=e=>(e*=2)<1?.5*rv(e):.5*(2-Math.pow(2,-10*(e-1))),sv=e=>1-Math.sin(Math.acos(e)),_L=EL(sv),kL=bL(sv),NL=e=>/^0[^.\s]+$/u.test(e);function XU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||NL(e):!0}const jd=e=>Math.round(e*1e5)/1e5,iv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QU(e){return e==null}const ZU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,av=(e,t)=>n=>!!(typeof n=="string"&&ZU.test(n)&&n.startsWith(e)||t&&!QU(n)&&Object.prototype.hasOwnProperty.call(n,t)),SL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(iv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},JU=e=>pa(0,255,e),Hy={...mu,transform:e=>Math.round(JU(e))},$o={test:av("rgb","red"),parse:SL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hy.transform(e)+", "+Hy.transform(t)+", "+Hy.transform(n)+", "+jd(vf.transform(r))+")"};function e$(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 cE={test:av("#"),parse:e$,transform:$o.transform},sc={test:av("hsl","hue"),parse:SL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ji.transform(jd(t))+", "+ji.transform(jd(n))+", "+jd(vf.transform(r))+")"},xr={test:e=>$o.test(e)||cE.test(e)||sc.test(e),parse:e=>$o.test(e)?$o.parse(e):sc.test(e)?sc.parse(e):cE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$o.transform(e):sc.transform(e)},t$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(iv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(t$))===null||n===void 0?void 0:n.length)||0)>0}const TL="number",AL="color",r$="var",s$="var(",eS="${}",i$=/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 kf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(i$,c=>(xr.test(c)?(r.color.push(i),s.push(AL),n.push(xr.parse(c))):c.startsWith(s$)?(r.var.push(i),s.push(r$),n.push(c)):(r.number.push(i),s.push(TL),n.push(parseFloat(c))),++i,eS)).split(eS);return{values:n,split:l,indexes:r,types:s}}function CL(e){return kf(e).values}function IL(e){const{split:t,types:n}=kf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function o$(e){const t=CL(e);return IL(e)(t.map(a$))}const co={test:n$,parse:CL,createTransformer:IL,getAnimatableNone:o$},l$=new Set(["brightness","contrast","saturate","opacity"]);function c$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(iv)||[];if(!r)return e;const s=n.replace(r,"");let i=l$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const u$=/\b([a-z-]*)\(.*?\)/gu,uE={...co,getAnimatableNone:e=>{const t=e.match(u$);return t?t.map(c$).join(" "):e}},d$={...Vw,color:xr,backgroundColor:xr,outlineColor:xr,fill:xr,stroke:xr,borderColor:xr,borderTopColor:xr,borderRightColor:xr,borderBottomColor:xr,borderLeftColor:xr,filter:uE,WebkitFilter:uE},ov=e=>d$[e];function RL(e,t){let n=ov(e);return n!==uE&&(n=co),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const f$=new Set(["auto","none","0"]);function h$(e,t,n){let r=0,s;for(;re===mu||e===ct,nS=(e,t)=>parseFloat(e.split(", ")[t]),rS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return nS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?nS(i[1],e):0}},p$=new Set(["x","y","z"]),m$=pu.filter(e=>!p$.has(e));function g$(e){const t=[];return m$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zc={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:rS(4,13),y:rS(5,14)};zc.translateX=zc.x;zc.translateY=zc.y;const Go=new Set;let dE=!1,fE=!1;function OL(){if(fE){const e=Array.from(Go).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=g$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fE=!1,dE=!1,Go.forEach(e=>e.complete()),Go.clear()}function LL(){Go.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fE=!0)})}function y$(){LL(),OL()}class lv{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?(Go.add(this),dE||(dE=!0,gn.read(LL),gn.resolveKeyframes(OL))):(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),b$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function E$(e){const t=b$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function jL(e,t,n=1){const[r,s]=E$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return ML(a)?parseFloat(a):a}return zw(s)?jL(s,t,n+1):s}const DL=e=>t=>t.test(e),x$={test:e=>e==="auto",parse:e=>e},PL=[mu,ct,ji,Ma,gU,mU,x$],sS=e=>PL.find(DL(e));class BL extends lv{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 iS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(co.test(e)||e==="0")&&!e.startsWith("url("));function w$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function a0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(_$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const k$=40;class FL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Di.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>k$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&y$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Di.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!v$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(a0(t,this.options,n)),l&&l(),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 hE=2e4;function UL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=hE?1/0:t}const An=(e,t,n)=>e+(t-e)*n;function zy(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 N$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=zy(c,l,e+1/3),i=zy(c,l,e),a=zy(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function qm(e,t){return n=>n>0?t:e}const Vy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},S$=[cE,$o,sc],T$=e=>S$.find(t=>t.test(e));function aS(e){const t=T$(e);if(!t)return!1;let n=t.parse(e);return t===sc&&(n=N$(n)),n}const oS=(e,t)=>{const n=aS(e),r=aS(t);if(!n||!r)return qm(e,t);const s={...n};return i=>(s.red=Vy(n.red,r.red,i),s.green=Vy(n.green,r.green,i),s.blue=Vy(n.blue,r.blue,i),s.alpha=An(n.alpha,r.alpha,i),$o.transform(s))},A$=(e,t)=>n=>t(e(n)),th=(...e)=>e.reduce(A$),pE=new Set(["none","hidden"]);function C$(e,t){return pE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function I$(e,t){return n=>An(e,t,n)}function cv(e){return typeof e=="number"?I$:typeof e=="string"?zw(e)?qm:xr.test(e)?oS:L$:Array.isArray(e)?$L:typeof e=="object"?xr.test(e)?oS:R$:qm}function $L(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>cv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function O$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=co.createTransformer(t),r=kf(e),s=kf(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?pE.has(e)&&!s.values.length||pE.has(t)&&!r.values.length?C$(e,t):th($L(O$(r,s),s.values),n):qm(e,t)};function HL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?An(e,t,n):cv(e)(e,t)}const M$=5;function zL(e,t,n){const r=Math.max(t-M$,0);return fL(n-e(r),t-r)}const On={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ky=.001;function j$({duration:e=On.duration,bounce:t=On.bounce,velocity:n=On.velocity,mass:r=On.mass}){let s,i,a=1-t;a=pa(On.minDamping,On.maxDamping,a),e=pa(On.minDuration,On.maxDuration,la(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=mE(u,a),m=Math.exp(-f);return Ky-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),g=mE(Math.pow(u,2),a);return(-s(u)+Ky>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ky+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=P$(s,i,l);if(e=oa(e),isNaN(c))return{stiffness:On.stiffness,damping:On.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const D$=12;function P$(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function U$(e){let t={velocity:On.velocity,stiffness:On.stiffness,damping:On.damping,mass:On.mass,isResolvedFromDuration:!1,...e};if(!lS(e,F$)&&lS(e,B$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*pa(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:On.mass,stiffness:s,damping:i}}else{const n=j$(e);t={...t,...n,mass:On.mass},t.isResolvedFromDuration=!0}return t}function VL(e=On.visualDuration,t=On.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=U$({...n,velocity:-la(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=la(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?On.restSpeed.granular:On.restSpeed.default),s||(s=b?On.restDelta.granular:On.restDelta.default);let x;if(g<1){const k=mE(y,g);x=N=>{const T=Math.exp(-g*y*N);return a-T*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const T=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-T*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let T=0;g<1&&(T=k===0?oa(m):zL(x,k,N));const S=Math.abs(T)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(UL(_),hE),N=pL(T=>_.next(k*T).value,k,30);return k+"ms "+N}};return _}function cS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const T=S=>{p(h.value)&&(k=S,N=VL({keyframes:[h.value,m(h.value)],velocity:zL(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),T(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const $$=eh(.42,0,1,1),H$=eh(0,0,.58,1),KL=eh(.42,0,.58,1),z$=e=>Array.isArray(e)&&typeof e[0]!="number",V$={linear:ds,easeIn:$$,easeInOut:KL,easeOut:H$,circIn:sv,circInOut:kL,circOut:_L,backIn:rv,backInOut:wL,backOut:xL,anticipate:vL},uS=e=>{if(nv(e)){VO(e.length===4);const[t,n,r,s]=e;return eh(t,n,r,s)}else if(typeof e=="string")return V$[e];return e};function K$(e,t,n){const r=[],s=n||HL,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 l=K$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(pa(e[0],e[i-1],d)):u}function W$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Hc(0,t,r);e.push(An(n,1,s))}}function G$(e){const t=[0];return W$(t,e.length-1),t}function q$(e,t){return e.map(n=>n*t)}function X$(e,t){return e.map(()=>t||KL).splice(0,e.length-1)}function Xm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=z$(r)?r.map(uS):uS(r),i={done:!1,value:t[0]},a=q$(n&&n.length===t.length?n:G$(t),e),l=Y$(a,t,{ease:Array.isArray(s)?s:X$(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const Q$=e=>{const t=({timestamp:n})=>e(n);return{start:()=>gn.update(t,!0),stop:()=>lo(t),now:()=>ur.isProcessing?ur.timestamp:Di.now()}},Z$={decay:cS,inertia:cS,tween:Xm,keyframes:Xm,spring:VL},J$=e=>e/100;class uv extends FL{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)||lv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=tv(n)?n:Z$[n]||Xm;let c,u;l!==Xm&&typeof t[0]!="number"&&(c=th(J$,HL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=UL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=pa(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return T&&s!==void 0&&(k.value=a0(c,this.options,s)),w&&w(k.value),T&&this.finish(),k}get duration(){const{resolved:t}=this;return t?la(t.calculatedDuration):0}get time(){return la(this.currentTime)}set time(t){t=oa(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=la(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Q$,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 e7=new Set(["opacity","clipPath","filter","transform"]);function t7(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=gL(l,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 n7=ev(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qm=10,r7=2e4;function s7(e){return tv(e.type)||e.type==="spring"||!mL(e.ease)}function i7(e,t){const n=new uv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Gm()&&a7(i)&&(i=YL[i]),s7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=i7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=t7(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(JN(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(a0(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 la(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return la(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=oa(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 ds;const{animation:r}=n;JN(r,t)}return ds}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:l}=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 uv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=oa(this.time);u.setWithVelocity(m.sample(g-Qm).value,m.sample(g).value,Qm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return n7()&&r&&e7.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const o7={type:"spring",stiffness:500,damping:25,restSpeed:10},l7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),c7={type:"keyframes",duration:.8},u7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d7=(e,{keyframes:t})=>t.length>2?c7:yl.has(e)?e.startsWith("scale")?l7(t[1]):o7:u7;function f7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dv=(e,t,n,r={},s,i)=>a=>{const l=Xw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-oa(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};f7(l)||(d={...d,...d7(e,d)}),d.duration&&(d.duration=oa(d.duration)),d.repeatDelay&&(d.repeatDelay=oa(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=a0(d.keyframes,l);if(h!==void 0)return gn.update(()=>{d.onUpdate(h),d.onComplete()}),new VU([])}return!i&&dS.supports(d)?new dS(d):new uv(d)};function h7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function WL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&h7(d,f))continue;const m={delay:n,...Xw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=hL(e);if(y){const b=window.MotionHandoffAnimation(y,f,gn);b!==null&&(m.startTime=b,g=!0)}}oE(e,f),h.start(dv(f,h,p,e.shouldReduceMotion&&dL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{gn.update(()=>{l&&UU(e,l)})}),u}function gE(e,t,n={}){var r;const s=i0(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(WL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return p7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function p7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(m7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(gE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function m7(e,t){return e.sortNodePosition(t)}function g7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>gE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=gE(e,t,n);else{const s=typeof t=="function"?i0(e,t,n.custom):t;r=Promise.all(WL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const y7=Bw.length;function GL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?GL(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})=>g7(e,n,r)))}function w7(e){let t=x7(e),n=fS(),r=!0;const s=c=>(u,d)=>{var f;const h=i0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=GL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(x)?x:[x];let D=I.reduce(s(y),{});k===!1&&(D={});const{prevResolvedValues:U={}}=b,W={...U,...D},M=j=>{S=!0,h.has(j)&&(R=!0,h.delete(j)),b.needsAnimating[j]=!0;const L=e.getValue(j);L&&(L.liveStyle=!1)};for(const j in W){const L=D[j],P=U[j];if(p.hasOwnProperty(j))continue;let A=!1;aE(L)&&aE(P)?A=!uL(L,P):A=L!==P,A?L!=null?M(j):h.add(j):L!==void 0&&h.has(j)?M(j):b.protectedKeys[j]=!0}b.prevProp=x,b.prevResolvedValues=D,b.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&T)||R)&&f.push(...I.map(j=>({animation:j,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fS(),r=!0}}}function v7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!uL(t,e):!1}function No(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fS(){return{animate:No(!0),whileInView:No(),whileHover:No(),whileTap:No(),whileDrag:No(),whileFocus:No(),exit:No()}}class po{constructor(t){this.isMounted=!1,this.node=t}update(){}}class _7 extends po{constructor(t){super(t),t.animationState||(t.animationState=w7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();r0(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 k7=0;class N7 extends po{constructor(){super(...arguments),this.id=k7++}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 S7={animation:{Feature:_7},exit:{Feature:N7}},ni={x:!1,y:!1};function qL(){return ni.x||ni.y}function T7(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}const fv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Nf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function nh(e){return{point:{x:e.pageX,y:e.pageY}}}const A7=e=>t=>fv(t)&&e(t,nh(t));function Dd(e,t,n,r){return Nf(e,t,A7(n),r)}const hS=(e,t)=>Math.abs(e-t);function C7(e,t){const n=hS(e.x,t.x),r=hS(e.y,t.y);return Math.sqrt(n**2+r**2)}class XL{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=Wy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=C7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=ur;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Yy(h,this.transformPagePoint),gn.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Wy(f.type==="pointercancel"?this.lastMoveEventInfo:Yy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!fv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=nh(t),l=Yy(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ur;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Wy(l,this.history)),this.removeListeners=th(Dd(this.contextWindow,"pointermove",this.handlePointerMove),Dd(this.contextWindow,"pointerup",this.handlePointerUp),Dd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lo(this.updatePoint)}}function Yy(e,t){return t?{point:t(e.point)}:e}function pS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wy({point:e},t){return{point:e,delta:pS(e,QL(t)),offset:pS(e,I7(t)),velocity:R7(t,.1)}}function I7(e){return e[0]}function QL(e){return e[e.length-1]}function R7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=QL(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>oa(t)));)n--;if(!r)return{x:0,y:0};const i=la(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 ZL=1e-4,O7=1-ZL,L7=1+ZL,JL=.01,M7=0-JL,j7=0+JL;function ms(e){return e.max-e.min}function D7(e,t,n){return Math.abs(e-t)<=n}function mS(e,t,n,r=.5){e.origin=r,e.originPoint=An(t.min,t.max,e.origin),e.scale=ms(n)/ms(t),e.translate=An(n.min,n.max,e.origin)-e.originPoint,(e.scale>=O7&&e.scale<=L7||isNaN(e.scale))&&(e.scale=1),(e.translate>=M7&&e.translate<=j7||isNaN(e.translate))&&(e.translate=0)}function Pd(e,t,n,r){mS(e.x,t.x,n.x,r?r.originX:void 0),mS(e.y,t.y,n.y,r?r.originY:void 0)}function gS(e,t,n){e.min=n.min+t.min,e.max=e.min+ms(t)}function P7(e,t,n){gS(e.x,t.x,n.x),gS(e.y,t.y,n.y)}function yS(e,t,n){e.min=t.min-n.min,e.max=e.min+ms(t)}function Bd(e,t,n){yS(e.x,t.x,n.x),yS(e.y,t.y,n.y)}function B7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?An(n,e,r.max):Math.min(e,n)),e}function bS(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 F7(e,{top:t,left:n,bottom:r,right:s}){return{x:bS(e.x,n,s),y:bS(e.y,t,r)}}function ES(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Hc(t.min,t.max-r,e.min):r>s&&(n=Hc(e.min,e.max-s,t.min)),pa(0,1,n)}function H7(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 yE=.35;function z7(e=yE){return e===!1?e=0:e===!0&&(e=yE),{x:xS(e,"left","right"),y:xS(e,"top","bottom")}}function xS(e,t,n){return{min:wS(e,t),max:wS(e,n)}}function wS(e,t){return typeof e=="number"?e:e[t]||0}const vS=()=>({translate:0,scale:1,origin:0,originPoint:0}),ic=()=>({x:vS(),y:vS()}),_S=()=>({min:0,max:0}),Bn=()=>({x:_S(),y:_S()});function Ts(e){return[e("x"),e("y")]}function eM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function V7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function K7(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 Gy(e){return e===void 0||e===1}function bE({scale:e,scaleX:t,scaleY:n}){return!Gy(e)||!Gy(t)||!Gy(n)}function Io(e){return bE(e)||tM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tM(e){return kS(e.x)||kS(e.y)}function kS(e){return e&&e!=="0%"}function Zm(e,t,n){const r=e-n,s=t*r;return n+s}function NS(e,t,n,r,s){return s!==void 0&&(e=Zm(e,s,r)),Zm(e,n,r)+t}function EE(e,t=0,n=1,r,s){e.min=NS(e.min,t,n,r,s),e.max=NS(e.max,t,n,r,s)}function nM(e,{x:t,y:n}){EE(e.x,t.translate,t.scale,t.originPoint),EE(e.y,n.translate,n.scale,n.originPoint)}const SS=.999999999999,TS=1.0000000000001;function Y7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lSS&&(t.x=1),t.ySS&&(t.y=1)}function ac(e,t){e.min=e.min+t,e.max=e.max+t}function AS(e,t,n,r,s=.5){const i=An(e.min,e.max,s);EE(e,t,n,i,r)}function oc(e,t){AS(e.x,t.x,t.scaleX,t.scale,t.originX),AS(e.y,t.y,t.scaleY,t.scale,t.originY)}function rM(e,t){return eM(K7(e.getBoundingClientRect(),t))}function W7(e,t,n){const r=rM(e,n),{scroll:s}=t;return s&&(ac(r.x,s.offset.x),ac(r.y,s.offset.y)),r}const sM=({current:e})=>e?e.ownerDocument.defaultView:null,G7=new WeakMap;class q7{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=Bn(),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(nh(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=T7(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),Ts(w=>{let y=this.getAxisMotionValue(w).get()||0;if(ji.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=ms(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&gn.postRender(()=>m(d,f)),oE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=X7(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ts(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 XL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:sM(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&&gn.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||!lp(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=B7(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&&rc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=F7(s.layoutBox,n):this.constraints=!1,this.elastic=z7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ts(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=H7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rc(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=W7(r,s.root,this.visualElement.getTransformPagePoint());let a=U7(s.layout.layoutBox,i);if(n){const l=n(V7(a));this.hasMutatedConstraints=!!l,l&&(a=eM(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ts(d=>{if(!lp(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oE(this.visualElement,t),r.start(dv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ts(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ts(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){Ts(n=>{const{drag:r}=this.getProps();if(!lp(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-An(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ts(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=$7({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(),Ts(a=>{if(!lp(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(An(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;G7.set(this.visualElement,this);const t=this.visualElement.current,n=Dd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();rc(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()),gn.read(r);const a=Nf(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ts(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=yE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function lp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function X7(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Q7 extends po{constructor(t){super(t),this.removeGroupControls=ds,this.removeListeners=ds,this.controls=new q7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ds}unmount(){this.removeGroupControls(),this.removeListeners()}}const CS=e=>(t,n)=>{e&&gn.postRender(()=>e(t,n))};class Z7 extends po{constructor(){super(...arguments),this.removePointerDownListener=ds}onPointerDown(t){this.session=new XL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:CS(t),onStart:CS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&gn.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Dd(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 nm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function IS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=IS(e,t.target.x),r=IS(e,t.target.y);return`${n}% ${r}%`}},J7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=co.parse(e);if(s.length>5)return r;const i=co.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=An(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class eH extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;SU(tH),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()})),nm.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()||gn.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Uw.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 iM(e){const[t,n]=HO(),r=E.useContext(jw);return o.jsx(eH,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(QO),isPresent:t,safeToRemove:n})}const tH={borderRadius:{...qu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qu,borderTopRightRadius:qu,borderBottomLeftRadius:qu,borderBottomRightRadius:qu,boxShadow:J7};function nH(e,t,n){const r=vr(e)?e:_f(e);return r.start(dv("",r,t,n)),r.animation}function rH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const sH=(e,t)=>e.depth-t.depth;class iH{constructor(){this.children=[],this.isDirty=!1}add(t){Qw(this.children,t),this.isDirty=!0}remove(t){Zw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sH),this.isDirty=!1,this.children.forEach(t)}}function aH(e,t){const n=Di.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(lo(r),e(i-t))};return gn.read(r,!0),()=>lo(r)}const aM=["TopLeft","TopRight","BottomLeft","BottomRight"],oH=aM.length,RS=e=>typeof e=="string"?parseFloat(e):e,OS=e=>typeof e=="number"||ct.test(e);function lH(e,t,n,r,s,i){s?(e.opacity=An(0,n.opacity!==void 0?n.opacity:1,cH(r)),e.opacityExit=An(t.opacity!==void 0?t.opacity:1,0,uH(r))):i&&(e.opacity=An(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Hc(e,t,r))}function MS(e,t){e.min=t.min,e.max=t.max}function Ss(e,t){MS(e.x,t.x),MS(e.y,t.y)}function jS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function DS(e,t,n,r,s){return e-=t,e=Zm(e,1/n,r),s!==void 0&&(e=Zm(e,1/s,r)),e}function dH(e,t=0,n=1,r=.5,s,i=e,a=e){if(ji.test(t)&&(t=parseFloat(t),t=An(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=An(i.min,i.max,r);e===i&&(l-=t),e.min=DS(e.min,t,n,l,s),e.max=DS(e.max,t,n,l,s)}function PS(e,t,[n,r,s],i,a){dH(e,t[n],t[r],t[s],t.scale,i,a)}const fH=["x","scaleX","originX"],hH=["y","scaleY","originY"];function BS(e,t,n,r){PS(e.x,t,fH,n?n.x:void 0,r?r.x:void 0),PS(e.y,t,hH,n?n.y:void 0,r?r.y:void 0)}function FS(e){return e.translate===0&&e.scale===1}function lM(e){return FS(e.x)&&FS(e.y)}function US(e,t){return e.min===t.min&&e.max===t.max}function pH(e,t){return US(e.x,t.x)&&US(e.y,t.y)}function $S(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function cM(e,t){return $S(e.x,t.x)&&$S(e.y,t.y)}function HS(e){return ms(e.x)/ms(e.y)}function zS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class mH{constructor(){this.members=[]}add(t){Qw(this.members,t),t.scheduleRender()}remove(t){if(Zw(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 gH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Ro={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},gd=typeof window<"u"&&window.MotionDebug!==void 0,qy=["","X","Y","Z"],yH={visibility:"hidden"},VS=1e3;let bH=0;function Xy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",gn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uM(r)}function dM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=bH++,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,gd&&(Ro.totalNodes=Ro.resolvedTargetDeltas=Ro.recalculatedProjection=0),this.nodes.forEach(wH),this.nodes.forEach(SH),this.nodes.forEach(TH),this.nodes.forEach(vH),gd&&window.MotionDebug.record(Ro)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=aH(h,250),nm.hasAnimatedSinceResize&&(nm.hasAnimatedSinceResize=!1,this.nodes.forEach(YS))})}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 g=this.options.transition||d.getDefaultTransition()||OH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!cM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Xw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||YS(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,lo(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(AH),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&&uM(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;WS(f.x,a.x,k),WS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bd(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),IH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&pH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Bn()),Ss(x,this.relativeTarget)),g&&(this.animationValues=d,lH(d,u,this.latestValues,k,b,y)),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&&(lo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gn.update(()=>{nm.hasAnimatedSinceResize=!0,this.currentAnimation=nH(0,VS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(VS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&fM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Bn();const f=ms(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=ms(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Ss(l,c),oc(l,d),Pd(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new mH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Xy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(KS),this.root.sharedNodes.clear()}}}function EH(e){e.updateLayout()}function xH(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"?Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ms(h);h.min=r[f].min,h.max=h.min+p}):fM(i,n.layoutBox,r)&&Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ms(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=ic();Pd(l,r,n.layoutBox);const c=ic();a?Pd(c,e.applyTransform(s,!0),n.measuredBox):Pd(c,r,n.layoutBox);const u=!lM(l);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=Bn();Bd(m,n.layoutBox,h.layoutBox);const g=Bn();Bd(g,r,p.layoutBox),cM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function wH(e){gd&&Ro.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 vH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _H(e){e.clearSnapshot()}function KS(e){e.clearMeasurements()}function kH(e){e.isLayoutDirty=!1}function NH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function YS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function SH(e){e.resolveTargetDelta()}function TH(e){e.calcProjection()}function AH(e){e.resetSkewAndRotation()}function CH(e){e.removeLeadSnapshot()}function WS(e,t,n){e.translate=An(t.translate,0,n),e.scale=An(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function GS(e,t,n,r){e.min=An(t.min,n.min,r),e.max=An(t.max,n.max,r)}function IH(e,t,n,r){GS(e.x,t.x,n.x,r),GS(e.y,t.y,n.y,r)}function RH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const OH={duration:.45,ease:[.4,0,.1,1]},qS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),XS=qS("applewebkit/")&&!qS("chrome/")?Math.round:ds;function QS(e){e.min=XS(e.min),e.max=XS(e.max)}function LH(e){QS(e.x),QS(e.y)}function fM(e,t,n){return e==="position"||e==="preserve-aspect"&&!D7(HS(t),HS(n),.2)}function MH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const jH=dM({attachResizeListener:(e,t)=>Nf(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qy={current:void 0},hM=dM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qy.current){const e=new jH({});e.mount(window),e.setOptions({layoutScroll:!0}),Qy.current=e}return Qy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),DH={pan:{Feature:Z7},drag:{Feature:Q7,ProjectionNode:hM,MeasureLayout:iM}};function PH(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 pM(e,t){const n=PH(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ZS(e){return t=>{t.pointerType==="touch"||qL()||e(t)}}function BH(e,t,n={}){const[r,s,i]=pM(e,n),a=ZS(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=ZS(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function JS(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&&gn.postRender(()=>i(t,nh(t)))}class FH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=BH(t,n=>(JS(this.node,n,"Start"),r=>JS(this.node,r,"End"))))}unmount(){}}class UH extends po{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=th(Nf(this.node.current,"focus",()=>this.onFocus()),Nf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const mM=(e,t)=>t?e===t?!0:mM(e,t.parentElement):!1,$H=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HH(e){return $H.has(e.tagName)||e.tabIndex!==-1}const yd=new WeakSet;function eT(e){return t=>{t.key==="Enter"&&e(t)}}function Zy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=eT(()=>{if(yd.has(n))return;Zy(n,"down");const s=eT(()=>{Zy(n,"up")}),i=()=>Zy(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 tT(e){return fv(e)&&!qL()}function VH(e,t,n={}){const[r,s,i]=pM(e,n),a=l=>{const c=l.currentTarget;if(!tT(l)||yd.has(c))return;yd.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!tT(p)||!yd.has(c))&&(yd.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||mM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!HH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>zH(u,s),s)}),i}function nT(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&&gn.postRender(()=>i(t,nh(t)))}class KH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=VH(t,n=>(nT(this.node,n,"Start"),(r,{success:s})=>nT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xE=new WeakMap,Jy=new WeakMap,YH=e=>{const t=xE.get(e.target);t&&t(e)},WH=e=>{e.forEach(YH)};function GH({root:e,...t}){const n=e||document;Jy.has(n)||Jy.set(n,{});const r=Jy.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(WH,{root:e,...t})),r[s]}function qH(e,t,n){const r=GH(t);return xE.set(e,n),r.observe(e),()=>{xE.delete(e),r.unobserve(e)}}const XH={some:0,all:1};class QH extends po{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:XH[s]},l=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 qH(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ZH(t,n))&&this.startObserver()}unmount(){}}function ZH({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const JH={inView:{Feature:QH},tap:{Feature:KH},focus:{Feature:UH},hover:{Feature:FH}},ez={layout:{ProjectionNode:hM,MeasureLayout:iM}},wE={current:null},gM={current:!1};function tz(){if(gM.current=!0,!!Dw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wE.current=e.matches;e.addListener(t),t()}else wE.current=!1}const nz=[...PL,xr,co],rz=e=>nz.find(DL(e)),rT=new WeakMap;function sz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(vr(s))e.addValue(r,s);else if(vr(i))e.addValue(r,_f(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,_f(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lv,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=Di.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),gM.current||tz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rT.delete(this.current),this.projection&&this.projection.unmount(),lo(this.notifyUpdate),lo(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=yl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&gn.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 $c){const n=$c[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):Bn()}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=_f(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"&&(ML(s)||NL(s))?s=parseFloat(s):!rz(s)&&co.test(n)&&(s=RL(t,n)),this.setBaseTarget(t,vr(s)?s.get():s)),vr(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=Hw(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&&!vr(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 Jw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class yM extends iz{constructor(){super(...arguments),this.KeyframeResolver=BL}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;vr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function az(e){return window.getComputedStyle(e)}class oz extends yM{constructor(){super(...arguments),this.type="html",this.renderInstance=sL}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}else{const r=az(t),s=(tL(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rM(t,n)}build(t,n,r){Kw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return qw(t,n,r)}}class lz extends yM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}return n=iL.has(n)?n:Fw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return lL(t,n,r)}build(t,n,r){Yw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){aL(t,n,r,s)}mount(t){this.isSVGTag=Gw(t.tagName),super.mount(t)}}const cz=(e,t)=>$w(e)?new lz(t):new oz(t,{allowProjection:e!==E.Fragment}),uz=jU({...S7,...JH,...DH,...ez},cz),Zt=X9(uz);function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Ul(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var dz=["container"];function fz(e){var t=e.container,n=t===void 0?document.body:t,r=o0(e,dz);return ps.createPortal(kt.createElement("div",er({},r)),n)}function hz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 pz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 mz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function gz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function aT(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 Fa=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function eb(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Fa(e,i,n,innerWidth)[0],f=Fa(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function kE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function tb(e,t,n){var r=kE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function up(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var bz={T:0,L:0,W:0,H:0,FIT:void 0},EM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},Ez=["className"];function xz(e){var t=e.className,n=t===void 0?"":t,r=o0(e,Ez);return kt.createElement("div",er({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var wz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function vz(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=o0(e,wz),u=EM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",er({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(xz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var _z={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 kz(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,T=e.expose,S=Jm(_z),R=S[0],I=S[1],D=E.useRef(0),U=EM(),W=R.naturalWidth,M=W===void 0?i:W,$=R.naturalHeight,C=$===void 0?l:$,j=R.width,L=j===void 0?i:j,P=R.height,A=P===void 0?l:P,z=R.loaded,G=z===void 0?!n:z,B=R.broken,re=R.x,Q=R.y,se=R.touched,de=R.stopRaf,te=R.maskTouched,pe=R.rotate,ne=R.scale,ye=R.CX,ge=R.CY,be=R.lastX,xe=R.lastY,ke=R.lastCX,Ae=R.lastCY,He=R.lastScale,Ce=R.touchTime,gt=R.touchLength,Ge=R.pause,ze=R.reach,le=qo({onScale:function(ce){return Ee(cp(ce))},onRotate:function(ce){pe!==ce&&(T({rotate:ce}),I(er({rotate:ce},tb(M,C,ce))))}});function Ee(ce,Ve,at){ne!==ce&&(T({scale:ce}),I(er({scale:ce},eb(re,Q,L,A,ne,ce,Ve,at),ce<=1&&{x:0,y:0})))}var ut=up(function(ce,Ve,at){if(at===void 0&&(at=0),(se||te)&&N){var rn=kE(pe,L,A),sn=rn[0],fn=rn[1];if(at===0&&D.current===0){var Wt=Math.abs(ce-ye)<=20,Jt=Math.abs(Ve-ge)<=20;if(Wt&&Jt)return void I({lastCX:ce,lastCY:Ve});D.current=Wt?Ve>ge?3:2:1}var Mn,Vn=ce-ke,Kn=Ve-Ae;if(at===0){var vt=Fa(Vn+be,ne,sn,innerWidth)[0],an=Fa(Kn+xe,ne,fn,innerHeight);Mn=function(Se,ve,Qe,ot){return ve&&Se===1||ot==="x"?"x":Qe&&Se>1||ot==="y"?"y":void 0}(D.current,vt,an[0],ze),Mn!==void 0&&x(Mn,ce,Ve,ne)}if(Mn==="x"||te)return void I({reach:"x"});var ue=cp(ne+(at-gt)/100/2*ne,M/L,.2);T({scale:ue}),I(er({touchLength:at,reach:Mn,scale:ue},eb(re,Q,L,A,ne,ue,ce,Ve,Vn,Kn)))}},{maxWait:8});function ft(ce){return!de&&!se&&(U.current&&I(er({},ce,{pause:u})),U.current)}var X,ee,me,Le,Ye,Ze,Pt,bt,Bt=(Ye=function(ce){return ft({x:ce})},Ze=function(ce){return ft({y:ce})},Pt=function(ce){return U.current&&(T({scale:ce}),I({scale:ce})),!se&&U.current},bt=qo({X:function(ce){return Ye(ce)},Y:function(ce){return Ze(ce)},S:function(ce){return Pt(ce)}}),function(ce,Ve,at,rn,sn,fn,Wt,Jt,Mn,Vn,Kn){var vt=kE(Vn,sn,fn),an=vt[0],ue=vt[1],Se=Fa(ce,Jt,an,innerWidth),ve=Se[0],Qe=Se[1],ot=Fa(Ve,Jt,ue,innerHeight),et=ot[0],lt=ot[1],Vt=Date.now()-Kn;if(Vt>=200||Jt!==Wt||Math.abs(Mn-Wt)>1){var Kt=eb(ce,Ve,sn,fn,Wt,Jt),J=Kt.x,rt=Kt.y,Ue=ve?Qe:J!==ce?J:null,qe=et?lt:rt!==Ve?rt:null;return Ue!==null&&jo(ce,Ue,bt.X),qe!==null&&jo(Ve,qe,bt.Y),void(Jt!==Wt&&jo(Wt,Jt,bt.S))}var Xe=(ce-at)/Vt,Rt=(Ve-rn)/Vt,Yn=Math.sqrt(Math.pow(Xe,2)+Math.pow(Rt,2)),Wn=!1,en=!1;(function(vn,Yt){var _n,kn=vn,Mt=0,Nn=0,mr=function(lr){_n||(_n=lr);var gr=lr-_n,Ar=Math.sign(vn),Ks=-.001*Ar,Hr=Math.sign(-kn)*Math.pow(kn,2)*2e-4,ns=kn*gr+(Ks+Hr)*Math.pow(gr,2)/2;Mt+=ns,_n=lr,Ar*(kn+=(Ks+Hr)*gr)<=0?jn():Yt(Mt)?Lt():jn()};function Lt(){Nn=requestAnimationFrame(mr)}function jn(){cancelAnimationFrame(Nn)}Lt()})(Yn,function(vn){var Yt=ce+vn*(Xe/Yn),_n=Ve+vn*(Rt/Yn),kn=Fa(Yt,Wt,an,innerWidth),Mt=kn[0],Nn=kn[1],mr=Fa(_n,Wt,ue,innerHeight),Lt=mr[0],jn=mr[1];if(Mt&&!Wn&&(Wn=!0,ve?jo(Yt,Nn,bt.X):oT(Nn,Yt+(Yt-Nn),bt.X)),Lt&&!en&&(en=!0,et?jo(_n,jn,bt.Y):oT(jn,_n+(_n-jn),bt.Y)),Wn&&en)return!1;var lr=Wn||bt.X(Nn),gr=en||bt.Y(jn);return lr&&gr})}),zt=(X=y,ee=function(ce,Ve){ze||Ee(ne!==1?1:Math.max(2,M/L),ce,Ve)},me=E.useRef(0),Le=up(function(){me.current=0,X.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ce=[].slice.call(arguments);me.current+=1,Le.apply(void 0,ce),me.current>=2&&(Le.cancel(),me.current=0,ee.apply(void 0,ce))});function Nt(ce,Ve){if(D.current=0,(se||te)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var at=cp(ne,M/L);if(Bt(re,Q,be,xe,L,A,ne,at,He,pe,Ce),_(ce,Ve),ye===ce&&ge===Ve){if(se)return void zt(ce,Ve);te&&b(ce,Ve)}}}function Ut(ce,Ve,at){at===void 0&&(at=0),I({touched:!0,CX:ce,CY:Ve,lastCX:ce,lastCY:Ve,lastX:re,lastY:Q,lastScale:ne,touchLength:at,touchTime:Date.now()})}function Be(ce){I({maskTouched:!0,CX:ce.clientX,CY:ce.clientY,lastX:re,lastY:Q})}Ul(Zi?void 0:"mousemove",function(ce){ce.preventDefault(),ut(ce.clientX,ce.clientY)}),Ul(Zi?void 0:"mouseup",function(ce){Nt(ce.clientX,ce.clientY)}),Ul(Zi?"touchmove":void 0,function(ce){ce.preventDefault();var Ve=aT(ce);ut.apply(void 0,Ve)},{passive:!1}),Ul(Zi?"touchend":void 0,function(ce){var Ve=ce.changedTouches[0];Nt(Ve.clientX,Ve.clientY)},{passive:!1}),Ul("resize",up(function(){G&&!se&&(I(tb(M,C,pe)),k())},{maxWait:8})),_E(function(){N&&T(er({scale:ne,rotate:pe},le))},[N]);var pt=function(ce,Ve,at,rn,sn,fn,Wt,Jt,Mn,Vn){var Kn=function(J,rt,Ue,qe,Xe){var Rt=E.useRef(!1),Yn=Jm({lead:!0,scale:Ue}),Wn=Yn[0],en=Wn.lead,vn=Wn.scale,Yt=Yn[1],_n=up(function(kn){try{return Xe(!0),Yt({lead:!1,scale:kn}),Promise.resolve()}catch(Mt){return Promise.reject(Mt)}},{wait:qe});return _E(function(){Rt.current?(Xe(!1),Yt({lead:!0}),_n(Ue)):Rt.current=!0},[Ue]),en?[J*vn,rt*vn,Ue/vn]:[J*Ue,rt*Ue,1]}(fn,Wt,Jt,Mn,Vn),vt=Kn[0],an=Kn[1],ue=Kn[2],Se=function(J,rt,Ue,qe,Xe){var Rt=E.useState(bz),Yn=Rt[0],Wn=Rt[1],en=E.useState(0),vn=en[0],Yt=en[1],_n=E.useRef(),kn=qo({OK:function(){return J&&Yt(4)}});function Mt(Nn){Xe(!1),Yt(Nn)}return E.useEffect(function(){if(_n.current||(_n.current=Date.now()),Ue){if(function(Nn,mr){var Lt=Nn&&Nn.current;if(Lt&&Lt.nodeType===1){var jn=Lt.getBoundingClientRect();mr({T:jn.top,L:jn.left,W:jn.width,H:jn.height,FIT:Lt.tagName==="IMG"?getComputedStyle(Lt).objectFit:void 0})}}(rt,Wn),J)return Date.now()-_n.current<250?(Yt(1),requestAnimationFrame(function(){Yt(2),requestAnimationFrame(function(){return Mt(3)})}),void setTimeout(kn.OK,qe)):void Yt(4);Mt(5)}},[J,Ue]),[vn,Yn]}(ce,Ve,at,Mn,Vn),ve=Se[0],Qe=Se[1],ot=Qe.W,et=Qe.FIT,lt=innerWidth/2,Vt=innerHeight/2,Kt=ve<3||ve>4;return[Kt?ot?Qe.L:lt:rn+(lt-fn*Jt/2),Kt?ot?Qe.T:Vt:sn+(Vt-Wt*Jt/2),vt,Kt&&et?vt*(Qe.H/ot):an,ve===0?ue:Kt?ot/(fn*Jt)||.01:ue,Kt?et?1:0:1,ve,et]}(u,c,G,re,Q,L,A,ne,d,function(ce){return I({pause:ce})}),Je=pt[4],Re=pt[6],It="transform "+d+"ms "+f,St={className:p,onMouseDown:Zi?void 0:function(ce){ce.stopPropagation(),ce.button===0&&Ut(ce.clientX,ce.clientY,0)},onTouchStart:Zi?function(ce){ce.stopPropagation(),Ut.apply(void 0,aT(ce))}:void 0,onWheel:function(ce){if(!ze){var Ve=cp(ne-ce.deltaY/100/2,M/L);I({stopRaf:!0}),Ee(Ve,ce.clientX,ce.clientY)}},style:{width:pt[2]+"px",height:pt[3]+"px",opacity:pt[5],objectFit:Re===4?void 0:pt[7],transform:pe?"rotate("+pe+"deg)":void 0,transition:Re>2?It+", opacity "+d+"ms ease, height "+(Re<4?d/2:Re>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Zi&&N?Be:void 0,onTouchStart:Zi&&N?function(ce){return Be(ce.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Je+", 0, 0, "+Je+", "+pt[0]+", "+pt[1]+")",transition:se||Ge?void 0:It,willChange:N?"transform":void 0}},n?kt.createElement(vz,er({src:n,loaded:G,broken:B},St,{onPhotoLoad:function(ce){I(er({},ce,ce.loaded&&tb(ce.naturalWidth||0,ce.naturalHeight||0,pe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:St,scale:Je,rotate:pe})))}var lT={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 Nz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,T=e.index,S=T===void 0?0:T,R=e.onIndexChange,I=e.visible,D=e.onClose,U=e.afterClose,W=e.portalContainer,M=Jm(lT),$=M[0],C=M[1],j=E.useState(0),L=j[0],P=j[1],A=$.x,z=$.touched,G=$.pause,B=$.lastCX,re=$.lastCY,Q=$.bg,se=Q===void 0?u:Q,de=$.lastBg,te=$.overlay,pe=$.minimal,ne=$.scale,ye=$.rotate,ge=$.onScale,be=$.onRotate,xe=e.hasOwnProperty("index"),ke=xe?S:L,Ae=xe?R:P,He=E.useRef(ke),Ce=N.length,gt=N[ke],Ge=typeof n=="boolean"?n:Ce>n,ze=function(Je,Re){var It=E.useReducer(function(at){return!at},!1)[1],St=E.useRef(0),ce=function(at){var rn=E.useRef(at);function sn(fn){rn.current=fn}return E.useMemo(function(){(function(fn){Je?(fn(Je),St.current=1):St.current=2})(sn)},[at]),[rn.current,sn]}(Je),Ve=ce[1];return[ce[0],St.current,function(){It(),St.current===2&&(Ve(!1),Re&&Re()),St.current=0}]}(I,U),le=ze[0],Ee=ze[1],ut=ze[2];_E(function(){if(le)return C({pause:!0,x:ke*-(innerWidth+Ol)}),void(He.current=ke);C(lT)},[le]);var ft=qo({close:function(Je){be&&be(0),C({overlay:!0,lastBg:se}),D(Je)},changeIndex:function(Je,Re){Re===void 0&&(Re=!1);var It=Ge?He.current+(Je-ke):Je,St=Ce-1,ce=vE(It,0,St),Ve=Ge?It:ce,at=innerWidth+Ol;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-at*Ve,pause:Re}),He.current=Ve,Ae&&Ae(Ge?Je<0?St:Je>St?0:Je:ce)}}),X=ft.close,ee=ft.changeIndex;function me(Je){return Je?X():C({overlay:!te})}function Le(){C({x:-(innerWidth+Ol)*ke,lastCX:void 0,lastCY:void 0,pause:!0}),He.current=ke}function Ye(Je,Re,It,St){Je==="x"?function(ce){if(B!==void 0){var Ve=ce-B,at=Ve;!Ge&&(ke===0&&Ve>0||ke===Ce-1&&Ve<0)&&(at=Ve/2),C({touched:!0,lastCX:B,x:-(innerWidth+Ol)*He.current+at,pause:!1})}else C({touched:!0,lastCX:ce,x:A,pause:!1})}(Re):Je==="y"&&function(ce,Ve){if(re!==void 0){var at=u===null?null:vE(u,.01,u-Math.abs(ce-re)/100/4);C({touched:!0,lastCY:re,bg:Ve===1?at:u,minimal:Ve===1})}else C({touched:!0,lastCY:ce,bg:se,minimal:!0})}(It,St)}function Ze(Je,Re){var It=Je-(B??Je),St=Re-(re??Re),ce=!1;if(It<-40)ee(ke+1);else if(It>40)ee(ke-1);else{var Ve=-(innerWidth+Ol)*He.current;Math.abs(St)>100&&pe&&f&&(ce=!0,X()),C({touched:!1,x:Ve,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ce||te})}}Ul("keydown",function(Je){if(I)switch(Je.key){case"ArrowLeft":ee(ke-1,!0);break;case"ArrowRight":ee(ke+1,!0);break;case"Escape":X()}});var Pt=function(Je,Re,It){return E.useMemo(function(){var St=Je.length;return It?Je.concat(Je).concat(Je).slice(St+Re-1,St+Re+2):Je.slice(Math.max(Re-1,0),Math.min(Re+2,St+1))},[Je,Re,It])}(N,ke,Ge);if(!le)return null;var bt=te&&!Ee,Bt=I?se:de,zt=ge&&be&&{images:N,index:ke,visible:I,onClose:X,onIndexChange:ee,overlayVisible:bt,overlay:gt&>.overlay,scale:ne,rotate:ye,onScale:ge,onRotate:be},Nt=r?r(Ee):400,Ut=s?s(Ee):iT,Be=r?r(3):600,pt=s?s(3):iT;return kt.createElement(fz,{className:"PhotoView-Portal"+(bt?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Je){return Je.stopPropagation()},container:W},I&&kt.createElement(gz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ee===1?" PhotoView-Slider__fadeIn":Ee===2?" PhotoView-Slider__fadeOut":""),style:{background:Bt?"rgba(0, 0, 0, "+Bt+")":void 0,transitionTimingFunction:Ut,transitionDuration:(z?0:Nt)+"ms",animationDuration:Nt+"ms"},onAnimationEnd:ut}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},ke+1," / ",Ce),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&zt&&g(zt),kt.createElement(hz,{className:"PhotoView-Slider__toolbarIcon",onClick:X}))),Pt.map(function(Je,Re){var It=Ge||ke!==0?He.current-1+Re:ke+Re;return kt.createElement(kz,{key:Ge?Je.key+"/"+Je.src+"/"+It:Je.key,item:Je,speed:Nt,easing:Ut,visible:I,onReachMove:Ye,onReachUp:Ze,onPhotoTap:function(){return me(i)},onMaskTap:function(){return me(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Ol)*It+"px",transform:"translate3d("+A+"px, 0px, 0)",transition:z||G?void 0:"transform "+Be+"ms "+pt},loadingElement:_,brokenElement:k,onPhotoResize:Le,isActive:He.current===It,expose:C})}),!Zi&&p&&kt.createElement(kt.Fragment,null,(Ge||ke!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ee(ke-1,!0)}},kt.createElement(pz,null)),(Ge||ke+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=qo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return er({},a,h)},[a,h]);return kt.createElement(bM.Provider,{value:m},t,kt.createElement(Nz,er({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var xM=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(bM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=qo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,er({},g,{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 Cz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wM=(...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 Iz={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 Rz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...Iz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wM("lucide",s),...l},[...a.map(([u,d])=>E.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 De=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(Rz,{ref:i,iconNode:t,className:wM(`lucide-${Cz(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 Oz=De("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 Lz=De("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** + * @license lucide-react v0.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 hv=De("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 vM=De("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 Fd=De("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 _M=De("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 kM=De("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 Mz=De("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 il=De("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 NM=De("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 jz=De("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 Dz=De("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 zs=De("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 pv=De("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 Pz=De("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 Ds=De("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 l0=De("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 SM=De("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 NE=De("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 Bz=De("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 mv=De("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 c0=De("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 Fz=De("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 Uz=De("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 rm=De("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 u0=De("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 $z=De("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 gv=De("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 Hz=De("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 yv=De("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 zz=De("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 cT=De("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 Vz=De("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 Kz=De("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 bv=De("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 Yz=De("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 TM=De("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 Wz=De("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 Gz=De("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 qz=De("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 Ev=De("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 AM=De("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 Xz=De("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 Qz=De("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 d0=De("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 Zz=De("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 Jz=De("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 xv=De("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 mo=De("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 eV=De("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 CM=De("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 tV=De("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 IM=De("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 nV=De("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 Ft=De("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 rV=De("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 sV=De("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 _c=De("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 iV=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.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 RM=De("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 aV=De("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 oV=De("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 lV=De("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 cV=De("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + * @license lucide-react v0.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 OM=De("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 uV=De("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 dV=De("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 fV=De("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 hV=De("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 dr=De("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 LM=De("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 wv=De("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 pV=De("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 mV=De("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 Sf=De("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 gV=De("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 yV=De("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 uT=De("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 al=De("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 bV=De("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 Fi=De("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 EV=De("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 xV=De("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 wV=De("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 vV=De("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 _V=De("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 MM=De("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 pr=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dT="veadk_auth_qs";let Xu=null;function kV(){if(Xu!==null)return Xu;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(dT,t),Xu=t):Xu=sessionStorage.getItem(dT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Xu}function Pi(e){const t=kV();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 gu=3e4,rh=12e4,jM=1e4;function pi(e,t=gu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const eg="veadk_local_user",tg="veadk_local_user_tab",NV=/^[A-Za-z0-9]{1,16}$/;function DM(){try{const e=sessionStorage.getItem(tg);if(e)return e;const t=localStorage.getItem(eg);return t&&sessionStorage.setItem(tg,t),t}catch{try{return localStorage.getItem(eg)}catch{return null}}}function fT(e){try{sessionStorage.setItem(tg,e)}catch{}try{localStorage.setItem(eg,e)}catch{}}function SV(){try{sessionStorage.removeItem(tg)}catch{}try{localStorage.removeItem(eg)}catch{}}function f0(e){const t=new Headers(e),n=DM();return n&&t.set("X-VeADK-Local-User",n),t}async function PM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:pi(void 0,jM)})}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 TV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function AV(){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 CV(){const[e,t]=await Promise.all([SE(),PM()]);return e.status==="unauthenticated"&&t.length>0}function IV(){window.location.assign("/oauth2/logout")}async function SE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:pi(void 0,jM)})}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=DM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function RV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function OV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const TE="veadk:authentication-required";let Ud=null,bd=null;function LV(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 MV(e){Ud||(Ud=new Promise(n=>{bd=n}),window.dispatchEvent(new Event(TE)));const t=Ud;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 jV(){return Ud!==null}function DV(){bd==null||bd(),bd=null,Ud=null}async function h0(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 PV=/\brun_sse\s*failed\s*:\s*404\b/i,BV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,hT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function dp(e){const t=String(e);return BV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!PV.test(t)||t.includes(hT)?t:`${t} + +${hT}`}async function*vv(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 l=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const c=l.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 FV=255,UV=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function $V(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let r=0,s="";for(const i of t){if(!UV.test(i))continue;const a=n.encode(i).byteLength;if(r+a>FV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const _v="veadk.messageFeedback.v1";function kv(e,t,n,r){return[e,t,n,r].join(":")}function Nv(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(_v)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function HV(e,t,n){if(typeof window>"u")return;const r=Nv();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(_v,JSON.stringify(r))}function BM(e){if(typeof window>"u")return;const t=kv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Nv(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(_v,JSON.stringify(n))}}const sm="",Sv=new Map;function FM(e,t){Sv.set(e,t)}function UM(){Sv.clear()}function Qn(e){const t=Sv.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 mt(e,t={},n={},r=gu){const s={...t,headers:f0(t.headers)},i=()=>{const c={...s,signal:pi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Pi(`${sm}/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(Pi(`${sm}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Pi(`${sm}${e}`),c)},a=async c=>{if(LV(c))return!0;if(c.status!==401)return!1;try{return await CV()}catch{return!1}};let l=await i();for(;await a(l);)await MV(t.signal),l=await i();return l}function zV(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 dn(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return zV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function $M(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class sh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Ya extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const VV="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",KV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",YV=3e4,AE=new Map;function HM(e,t){return`${t}:${e}`}async function WV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function p0(e,t,n){const r=await mt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await WV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new sh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new Ya(VV);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new Ya(KV);if(n!=null&&n.runtimeId&&r.status===404)throw new Ya("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Ya("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await dn(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&AE.set(HM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+YV}),i}async function ng(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,l=await dn(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Tv(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function rg(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(`/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 l=kv(s.runtimeId,r,t,n);a.state={...Nv()[l]??{},...a.state??{}}}return a}async function zM(e){const{app:t,ep:n}=Qn(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},rh);if(!r.ok)throw new Error(await dn(r,"提交反馈失败"));const s=await r.json(),i=kv(n.runtimeId,t,e.userId,e.sessionId);return HV(i,e.eventId,s),s}async function VM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await mt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await dn(n,"读取评测集失败"));return n.json()}async function KM(e){const t=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},rh);if(!t.ok)throw new Error(await dn(t,"删除评测案例失败"));return t.json()}async function CE(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}function GV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function WM(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await mt(c,{},a,rh);if(!u.ok)throw new Error(await dn(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=GV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function GM(e,t,n,r,s){const{blob:i}=await WM(e,t,n,r,s);return URL.createObjectURL(i)}async function qV(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await dn(t,"media capabilities failed"));return t.json()}async function qM(e,t,n,r){const{app:s}=Qn(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 mt("/web/media",{method:"POST",body:i},{},rh);if(!a.ok)throw new Error(await dn(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function IE(e,t,n){const{app:r}=Qn(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await mt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await dn(i,"media cleanup failed"))}function XM(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 im(e,t){const n=XM(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await mt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await dn(r,"media cleanup failed"))}function QM(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=XM(t);if(!n)return t;const r=`${n}/content`;return Pi(`${sm}${r}`)}async function ZM(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Av(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 Cv(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function RE(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(Cv(r,t,n),{},s);if(!i.ok)throw new Error(await dn(i,"读取会话能力失败"));return Av(await i.json())}async function Iv(e){const{ep:t}=Qn(e),n=await mt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await dn(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function XV(e){const{ep:t}=Qn(e),n=await mt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await dn(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function QV(e,t,n){const{ep:r}=Qn(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await mt(i,{},r);if(!a.ok)throw new Error(await dn(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function JM(e,t,n=1,r=20){const{ep:s}=Qn(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await mt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await dn(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function OE(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=await mt(Cv(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(!l.ok)throw new Error(await dn(l,"添加会话能力失败"));return Av(await l.json())}async function ej(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=`${Cv(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await mt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await dn(c,"移除会话能力失败"));return Av(await c.json())}async function tj(e,t,n=!0){const r=await mt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await mt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Rv(e){const{app:t,ep:n}=Qn(e);return tj(t,n,!1)}async function Ov(e,t,n){const r={runtimeId:e,region:t},s=HM(e,t),i=AE.get(s);i&&i.expiresAt<=Date.now()&&AE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await p0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return tj(a,r)}async function nj(e,t,n,r){const{app:s,ep:i}=Qn(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await mt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await dn(l,"Agent 检索失败"));return l.json()}async function rj(e,t){const{app:n}=Qn(e),r=await mt(`/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*Tf({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=Qn(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,veadkInvocation:h}}}const m=await mt(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:l},d,0);if(!m.ok)throw new Error(dp(`run_sse failed: ${m.status}`));for await(const g of vv(m)){const w=g;typeof w.error=="string"&&(w.error=dp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=dp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=dp(w.error_message)),yield w}}const $d=new Map;async function m0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&$d.set(s,i);const a=()=>{s&&$d.get(s)===i&&$d.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await mt("/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:$V((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of vv(l)){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 sj(e){var n;const t=await mt("/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=$d.get(e))==null||n.abort(),$d.delete(e)}async function ZV(e="cn-beijing"){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Af={title:"VeADK Studio",logoUrl:""},nb={studio:!1,version:"",branding:Af,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function ij(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return nb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Af.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:Af.title,logoUrl:s?Pi(s):""},features:{...nb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return nb}}const aj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function oj(){var n,r,s;const e=await mt("/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 lj(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 mt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function cj(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},rh);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 kc(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 mt(`/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 uj(e,t){try{return await p0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof sh||n instanceof Ya)throw n;return null}}async function dj(e,t){const n=await mt("/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 Lv(e,t){const n=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await dn(n,"加载 Runtime 详情失败"));return n.json()}async function Mv(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await dn(t,"生成项目失败"));return t.json()}const JV=19e4;async function fj(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},JV);if(!t.ok)throw new Error(await dn(t,"生成 Agent 配置失败"));return h0(t,"生成 Agent 配置失败")}async function hj(e){const t=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await dn(t,"创建调试运行失败"));return h0(t,"创建调试运行失败")}async function pj(e,t){const n=await mt(`/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 dn(n,"创建调试会话失败"));return(await h0(n,"创建调试会话失败")).id}async function mj(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await dn(n,"加载调试调用链路失败"));const r=await h0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*gj({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await mt(`/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 dn(a,"调试运行失败"));for await(const l of vv(a))yield l}async function $l(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await dn(t,"清理调试运行失败"))}const eK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Af,DEFAULT_STUDIO_ACCESS:aj,RuntimeAccessDeniedError:sh,RuntimeProbeError:Ya,addSessionCapability:OE,cancelAgentkitDeployment:sj,clearMessageFeedbackCache:BM,clearRemoteApps:UM,componentSearch:nj,createGeneratedAgentTestRun:hj,createGeneratedAgentTestSession:pj,createSession:ng,deleteAgentFeedbackCases:KM,deleteGeneratedAgentTestRun:$l,deleteMedia:im,deleteRuntime:dj,deleteSession:CE,deleteSessionMedia:IE,deployAgentkitProject:m0,downloadArtifact:YM,fetchRemoteApps:p0,generateAgentDraftFromRequirement:fj,generateAgentProject:Mv,getAgentFeedbackCases:VM,getAgentInfo:Rv,getGeneratedAgentTestTrace:mj,getMediaCapabilities:qV,getMyRuntimes:ZV,getRuntimeAgentInfo:Ov,getRuntimeDetail:Lv,getRuntimes:kc,getSession:rg,getSessionCapabilities:RE,getSessionTrace:ZM,getStudioAccess:oj,getStudioUpdateStatus:lj,getUiConfig:ij,listApps:$M,listSessionBuiltinTools:Iv,listSessionSkillSpaces:XV,listSessionSkillsInSpace:QV,listSessions:Tv,mediaContentUrl:QM,previewArtifact:GM,probeRuntimeApps:uj,registerRemoteApp:FM,removeSessionCapability:ej,runGeneratedAgentTestSSE:gj,runSSE:Tf,searchSessionPublicSkills:JM,startStudioUpdate:cj,submitMessageFeedback:zM,uploadMedia:qM,webSearch:rj},Symbol.toStringTag,{value:"Module"})),tK="send_a2ui_json_to_client",nK="validated_a2ui_json",LE="adk_request_credential",pT="transfer_to_agent";function rK(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 ci(){return{blocks:[],liveStart:0}}const mT=e=>e.functionCall??e.function_call,ME=e=>e.functionResponse??e.function_response;function sK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function iK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function yj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:iK(l.data),name:l.displayName??l.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 jE(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 aK=new Set(["llm","sequential","parallel","loop","a2a"]);function oK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&aK.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 lK(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 cK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function gT(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 fp(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Vc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>mT(p)||ME(p));if(t.partial&&!i){for(const p of s){const m=jE(p);typeof m=="string"&&m&&gT(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=mT(p),g=ME(p),w=yj([p]),y=jE(p);if(typeof y=="string"&&y)gT(n,p.thought?"thinking":"text",y);else if(w.length)fp(n),lK(n,w);else if(m)if(fp(n),m.name===pT){const b=sK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===LE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:rK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(fp(n),g.name===pT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===LE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===tK){const b=((d=g.response)==null?void 0:d[nK])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&cK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),fp(n),r=n.length,{blocks:n,liveStart:r}}function uK(e,t={}){var s,i;const n=[];let r=ci();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=ME(p))==null?void 0:m.name)===LE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(jE).filter(p=>!!p).join(""),d=yj(c),f=oK(c);if(!u&&!d.length&&!f){r=ci();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=ci()}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=ci()),r=Vc(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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function dK(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 fK=50,yT=48;function hK(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 pK(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 mK(e,t,n){const r=Math.max(0,t-yT),s=Math.min(e.length,t+n+yT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await rg(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of hK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:pK(l),snippet:mK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,fK)}async function yK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await rj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function bK(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await nj(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function EK(e,t,n){return e==="session"?{results:await gK(n.userId,n.appId,t)}:e==="web"?yK(n.appId,t):bK(e,n.appId,n.userId,t)}function bj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function xK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function wK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(bj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function vK(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 sg(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 bT(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 _K({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var $,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=vK(t,n,r),T=N.find(j=>j.id===a),S=a==="knowledge"?($=n==null?void 0:n.components)==null?void 0:$.find(j=>j.source==="knowledgebase"||j.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(j=>j.source==="long_term_memory"||j.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function j(L){var P;(P=k.current)!=null&&P.contains(L.target)||x(!1)}return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[b]);async function R(j,L){var G;const P=j.trim();if(!P||!((G=N.find(B=>B.id===L))!=null&&G.ready))return;const A=++_.current;g(!0),y(!0);let z;try{z=await EK(L,P,{userId:e,appId:t})}catch(B){const re=B instanceof Error?B.message:String(B);z={results:[],note:`搜索失败:${re}`}}A===_.current&&(f(z.results),p(z.note),g(!1))}function I(j){_.current+=1,u(j),f([]),p(void 0),y(!1),g(!1)}function D(j){_.current+=1,l(j),x(!1),f([]),p(void 0),y(!1),g(!1)}const U=!!(T!=null&&T.ready),W=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?sg(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(j=>!j),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),M&&o.jsx("small",{children:M}),o.jsx(xK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(j=>{var A,z;const L=j.id==="knowledge"?(A=n==null?void 0:n.components)==null?void 0:A.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):j.id==="memory"?(z=n==null?void 0:n.components)==null?void 0:z.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,P=L?[L.name,L.backend?sg(L.backend):""].filter(Boolean).join(" · "):j.ready?j.description:j.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===j.id,disabled:!j.ready,onClick:()=>D(j.id),children:[o.jsx("span",{children:j.label}),P&&o.jsx("small",{children:P})]},j.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:j=>I(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),R(c,a))},placeholder:W,disabled:!U,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx(Ft,{className:"icon spin"}):o.jsx(bj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:U?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((j,L)=>o.jsx(kK,{result:j,agentLabel:s,onOpen:i},L)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function kK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(RM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${bT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(d0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(gv,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(ET,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${sg(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(ET,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${sg(e.sourceType)}`:"",e.ts?` · ${bT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function ET({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 jv="/assets/volcengine-DM14a-L-.svg",xT="(max-width: 860px)";function NK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function SK(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 TK={admin:"管理员",developer:"开发者",user:"普通用户"};function wT({role:e}){const t=TK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function AK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),ps.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(pr,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function CK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=RV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=SK(d||f||h),m=OV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} +${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(wT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(wT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(mo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(sV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(AK,{version:n,onClose:()=>l(!1)}):null]})}function IK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(xT).matches),[k,N]=E.useState(_.current),T=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(xT),I=D=>{D.matches?N(U=>U||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(dV,{className:"icon"}):o.jsx(uV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(dr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(NK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(wK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(dr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[T.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),T.map(R=>{const I=dK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(D=>D===R.id?null:R.id),children:o.jsx($z,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(Fi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(CK,{access:s,userInfo:m,version:g,onLogout:w})]})}const Ej="veadk_agentkit_connections";function As(){try{const e=localStorage.getItem(Ej);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function g0(e){try{localStorage.setItem(Ej,JSON.stringify(e))}catch{}}function ro(e,t){return`agentkit:${e}:${t}`}function xj(e){try{return new URL(e).host}catch{return e}}function yu(e){UM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)FM(ro(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function wj(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=As(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,g0(l),yu(l),a}async function ig(e,t,n,r){let s;try{s=await uj(e,n)}catch(l){throw l instanceof sh&&ag(e),l}if(!s||s.length===0)throw ag(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=wj(e,t,n,s,i,r);return ro(a.id,s[0])}async function vj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await p0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||xj(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...As().filter(c=>c.base!==s),a];return g0(l),yu(l),a}function RK(e){const t=As().filter(n=>n.id!==e);return g0(t),yu(t),t}function ag(e){const t=As().filter(n=>n.runtimeId!==e);return g0(t),yu(t),t}function _j(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:ro(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:xj(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const vT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:vj,addRuntimeConnection:wj,buildAgentEntries:_j,connectRuntime:ig,loadConnections:As,registerConnections:yu,remoteAppId:ro,removeConnection:RK,removeRuntimeConnection:ag},Symbol.toStringTag,{value:"Module"}));function Kc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 DE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function OK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function kj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const _T=15,LK=1e4,MK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function jK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function Nj(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 rb(e,t=LK){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 DK({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,T]=E.useState(!1),[S,R]=E.useState(""),[I,D]=E.useState(""),[U,W]=E.useState(null),[M,$]=E.useState(new Set),[C,j]=E.useState(),[L,P]=E.useState("agent"),A=E.useRef(!1);function z(ne){j(ye=>(ye==null?void 0:ye.runtimeId)===ne.runtimeId?void 0:{runtimeId:ne.runtimeId,name:ne.name,region:ne.region})}const G=E.useCallback(async ne=>{if(d[ne]){g(ne);return}const ye=h[ne];if(ye!==void 0){T(!0),R("");try{const ge=await rb(kc({nextToken:ye,pageSize:_T,region:_,scope:"all"}));f(be=>{const xe=[...be];return xe[ne]=ge.runtimes,xe}),p(be=>{const xe=[...be];return ge.nextToken&&(xe[ne+1]=ge.nextToken),xe}),g(ne)}catch(ge){R(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[h,d,_]),B=E.useCallback(async()=>{T(!0),R("");try{const ne=[];let ye="";do{const ge=await rb(kc({scope:"mine",nextToken:ye,pageSize:100,region:_}));ne.push(...ge.runtimes),ye=ge.nextToken}while(ye&&ne.length<2e3);x(ne)}catch(ne){R(ne instanceof Error?ne.message:String(ne))}finally{T(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),A.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!A.current&&(A.current=!0,G(0))},[e,s,w,G]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&B()},[w,b,s,B]),E.useEffect(()=>{e&&(j(void 0),P("agent"))},[e]);function re(){$(new Set),w?(x(null),B()):(f([]),p([""]),g(0),A.current=!0,T(!0),R(""),rb(kc({nextToken:"",pageSize:_T,region:_,scope:"all"})).then(ne=>{f([ne.runtimes]),p(ne.nextToken?["",ne.nextToken]:[""])}).catch(ne=>R(ne instanceof Error?ne.message:String(ne))).finally(()=>T(!1)))}function Q(ne){ne!==_&&(k(ne),f([]),p([""]),g(0),x(null),$(new Set),A.current=!1)}const se=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function de(ne){W(ne.runtimeId),ig(ne.runtimeId,ne.name,ne.region).then(async ye=>{await u(ye),t()}).catch(ye=>{if(ye instanceof sh){R(ye.message);return}if(ye instanceof Ya){ye.unsupported&&$(ge=>new Set(ge).add(ne.runtimeId)),R(ye.message);return}$(ge=>new Set(ge).add(ne.runtimeId))}).finally(()=>W(null))}if(!e)return null;const pe=(w?b??[]:d[m]??[]).filter(ne=>I?ne.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Kc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:re,title:"刷新",disabled:N,children:o.jsx(LM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(pr,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(ne=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${ne===a?"active":""}`,onClick:()=>{u(ne),t()},children:[o.jsx(Kc,{}),o.jsx("span",{className:"agentsel-item-name",children:ne})]})},ne))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(Sf,{className:"icon"}),o.jsx("input",{value:I,onChange:ne=>D(ne.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:MK.map(ne=>o.jsx("button",{type:"button",className:_===ne.value?"active":"","aria-pressed":_===ne.value,onClick:()=>Q(ne.value),children:ne.label},ne.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:ne=>y(ne.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[pe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:pe.map(ne=>{const ye=M.has(ne.runtimeId),ge=U===ne.runtimeId,be=(l==null?void 0:l.runtimeId)===ne.runtimeId,xe=(C==null?void 0:C.runtimeId)===ne.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${be?"active":""} ${xe?"is-previewed":""}`,title:ne.runtimeId,children:[o.jsx(kj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:ne.name,children:ne.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${ye?"bad":zK(ne.status)}`,children:ye?"不支持":Sj(ne.status)}),ne.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||be,onClick:()=>de(ne),children:ge?"连接中…":be?"已连接":ye?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${xe?"active":""}`,"aria-label":`查看 ${ne.name} 信息`,"aria-pressed":xe,title:"查看信息",onClick:()=>z(ne),children:o.jsx(mo,{className:"icon"})}):null]})]})},ne.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void G(m-1),"aria-label":"上一页",children:o.jsx(Pz,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!se||N,onClick:()=>void G(m+1),"aria-label":"下一页",children:o.jsx(Ds,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(UK,{runtime:C,tab:L,onTabChange:P})]})]})}const PK={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function BK(e){return PK[e.toLowerCase()]??e}function FK(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 UK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx($K,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(HK,{runtime:e})})]})}function $K({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),Ov(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(Nj(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx(Ft,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Kc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(kT,{icon:o.jsx(OM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(kT,{icon:o.jsx(DE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(OK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(NM,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[BK(d.kind),d.backend?` · ${FK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function kT({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function HK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Lv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(Nj(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",Sj(t.status)]),t.region&&u.push(["区域",jK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(kj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx(Ft,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function zK(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 VK={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function Sj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return VK[t]??(e||"-")}function KK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx(Ds,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(YK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function YK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Lz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(pv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx(DK,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function ih(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 Tj(){return(await ih("/web/skill-spaces?region=all")).items||[]}async function WK(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),ih(`/web/skill-spaces?${t.toString()}`)}async function Aj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function GK(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),ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function qK(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 ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function XK(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 QK(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const ZK="https://ark.cn-beijing.volces.com/api/v3/",am=[{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:ZK}],Yc=[],Qu=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],mi={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Cj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:mi.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:mi.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:mi.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],ol=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Yc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Yc},{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"}]}],PE=[{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}]}],BE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:am,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},...am],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},...am],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Yc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Wc="viking",FE=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Yc},{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},...am],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Yc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],UE=[{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:[...Yc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],JK={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function $E(e){const t=ol.find(n=>n.id===e||n.toolNames.includes(e));return JK[e]??(t==null?void 0:t.label)??e}function NT(e){const t=ol.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function eY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function tY(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ST(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ij({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),ps.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(eY,{})})]}),i]})]}),document.body)}function om({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(tY,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function nY({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${$E(m)} ${m} ${NT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Ij,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(DE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(om,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(DE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:$E(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:NT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function rY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,T]=E.useState([]),[S,R]=E.useState(""),[I,D]=E.useState(""),[U,W]=E.useState(!0),[M,$]=E.useState(!1),[C,j]=E.useState(""),[L,P]=E.useState(""),A=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let Q=!0;const se=window.setTimeout(()=>{g(!0),y(""),JM(e,c.trim()).then(de=>{Q&&(f(de.items),p(de.totalCount))}).catch(de=>{Q&&(f([]),p(0),y(de instanceof Error?de.message:"搜索 Skill Hub 失败"))}).finally(()=>{Q&&g(!1)})},250);return()=>{Q=!1,window.clearTimeout(se)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let Q=!0;return W(!0),j(""),Tj().then(se=>{Q&&(x(se),k(se[0]??null))}).catch(se=>{Q&&j(se instanceof Error?se.message:"读取 Skill Space 失败")}).finally(()=>{Q&&W(!1)}),()=>{Q=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){T([]);return}let Q=!0;return $(!0),j(""),Aj(_.id,_.region).then(se=>{Q&&T(se)}).catch(se=>{Q&&j(se instanceof Error?se.message:"读取技能失败")}).finally(()=>{Q&&$(!1)}),()=>{Q=!1}},[_,a]);const z=E.useMemo(()=>{const Q=S.trim().toLowerCase();return Q?b.filter(se=>`${se.name} ${se.id} ${se.description}`.toLowerCase().includes(Q)):b},[S,b]),G=E.useMemo(()=>{const Q=I.trim().toLowerCase();return Q?N.filter(se=>`${se.skillName} ${se.skillDescription}`.toLowerCase().includes(Q)):N},[I,N]),B=async Q=>{if(!_)return;P(Q.skillId);const se=await s({kind:"skill",name:Q.skillName,skillSourceId:_.id,description:Q.skillDescription,version:Q.version});P(""),se&&i()},re=async Q=>{P(Q.slug);const se=await s({kind:"skill",name:Q.name,skillSourceId:`findskill:${Q.slug}`,description:Q.description,version:Q.version||Q.updatedAt});P(""),se&&i()};return o.jsx(Ij,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(om,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(Q=>{const se=A.has(Q.name),de=L===Q.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.name}),o.jsx("span",{children:Q.description||"暂无描述"}),o.jsxs("small",{children:[Q.sourceRepo||Q.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.downloadCount.toLocaleString()," 次下载",Q.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:se||r||!!L,onClick:()=>void re(Q),children:se?"已添加":de?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(ST,{}),"添加"]})})]},Q.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(om,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:U?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):z.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):z.map(Q=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===Q.id?" is-active":""}`,onClick:()=>{k(Q),D("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:Q.name||Q.id}),o.jsx("small",{children:Q.description||Q.id}),o.jsxs("em",{children:[Q.skillCount??0," 个技能"]})]})},`${Q.projectName??"default"}:${Q.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(om,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:D})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?M?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):G.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):G.map(Q=>{const se=A.has(Q.skillName),de=L===Q.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.skillName}),o.jsx("span",{children:Q.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",Q.version||"—"]})]}),o.jsx("button",{type:"button",disabled:se||r||!!L,onClick:()=>void B(Q),children:se?"已添加":de?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(ST,{}),"添加"]})})]},`${Q.skillId}:${Q.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function ma({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const sY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Rj(e){return 1+e.children.reduce((t,n)=>t+Rj(n),0)}function Gc(e){return e.id||e.name}function iY(e,t){const n=Gc(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 Oj(e,t=!0){return{...e,id:Gc(e),name:iY(e,t),children:e.children.map(n=>Oj(n,!1))}}function Lj(e,t){t.set(Gc(e),e.name||Gc(e)),e.children.forEach(n=>Lj(n,t))}function aY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function oY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Mj({node:e,activeAgent:t,seen:n,path:r}){const s=Gc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Kc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:sY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Mj,{node:c,activeAgent:t,seen:n,path:r},Gc(c)))})]})}function sb({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function jj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(ma,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=Oj(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:[]}),w=(l==null?void 0:l.tools)??aY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??oY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Lj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(sb,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:$E(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(sb,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(sb,{title:"拓扑",count:Rj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Mj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(nY,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(rY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function lY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function cY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(lY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(jj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function $1e(){}function TT(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 Dj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uY=/[$_\p{ID_Start}]/u,dY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,fY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,hY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pj={};function H1e(e){return e?uY.test(String.fromCodePoint(e)):!1}function z1e(e,t){const r=(t||Pj).jsx?fY:dY;return e?r.test(String.fromCodePoint(e)):!1}function AT(e,t){return(Pj.jsx?pY:hY).test(e)}const mY=/[ \t\n\f\r]/g;function gY(e){return typeof e=="object"?e.type==="text"?CT(e.value):!1:CT(e)}function CT(e){return e.replace(mY,"")===""}let ah=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function Bj(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ah(n,r,t)}function Cf(e){return e.toLowerCase()}class ts{constructor(t,n){this.attribute=n,this.property=t}}ts.prototype.attribute="";ts.prototype.booleanish=!1;ts.prototype.boolean=!1;ts.prototype.commaOrSpaceSeparated=!1;ts.prototype.commaSeparated=!1;ts.prototype.defined=!1;ts.prototype.mustUseProperty=!1;ts.prototype.number=!1;ts.prototype.overloadedBoolean=!1;ts.prototype.property="";ts.prototype.spaceSeparated=!1;ts.prototype.space=void 0;let yY=0;const xt=bl(),qn=bl(),HE=bl(),Oe=bl(),ln=bl(),Nc=bl(),as=bl();function bl(){return 2**++yY}const zE=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:qn,commaOrSpaceSeparated:as,commaSeparated:Nc,number:Oe,overloadedBoolean:HE,spaceSeparated:ln},Symbol.toStringTag,{value:"Module"})),ib=Object.keys(zE);class Dv extends ts{constructor(t,n,r,s){let i=-1;if(super(t,n),IT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&vY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(RT,kY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!RT.test(i)){let a=i.replace(wY,_Y);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Dv}return new s(r,t)}function _Y(e){return"-"+e.toLowerCase()}function kY(e){return e.charAt(1).toUpperCase()}const oh=Bj([Fj,bY,Hj,zj,Vj],"html"),go=Bj([Fj,EY,Hj,zj,Vj],"svg");function OT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Kj(e){return e.join(" ").trim()}var Pv={},LT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NY=/\n/g,SY=/^\s*/,TY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,AY=/^:\s*/,CY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,IY=/^[;\s]*/,RY=/^\s+|\s+$/g,OY=` +`,MT="/",jT="*",Do="",LY="comment",MY="declaration";function jY(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 g=m.match(NY);g&&(n+=g.length);var w=m.lastIndexOf(OY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(SY)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(MT!=e.charAt(0)||jT!=e.charAt(1))){for(var g=2;Do!=e.charAt(g)&&(jT!=e.charAt(g)||MT!=e.charAt(g+1));)++g;if(g+=2,Do===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:LY,comment:w})}}function h(){var m=i(),g=c(TY);if(g){if(f(),!c(AY))return l("property missing ':'");var w=c(CY),y=m({type:MY,property:DT(g[0].replace(LT,Do)),value:w?DT(w[0].replace(LT,Do)):Do});return c(IY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function DT(e){return e?e.replace(RY,Do):Do}var DY=jY,PY=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pv,"__esModule",{value:!0});Pv.default=FY;const BY=PY(DY);function FY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,BY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var b0={};Object.defineProperty(b0,"__esModule",{value:!0});b0.camelCase=void 0;var UY=/^--[a-zA-Z0-9_-]+$/,$Y=/-([a-z])/g,HY=/^[^-]+$/,zY=/^-(webkit|moz|ms|o|khtml)-/,VY=/^-(ms)-/,KY=function(e){return!e||HY.test(e)||UY.test(e)},YY=function(e,t){return t.toUpperCase()},PT=function(e,t){return"".concat(t,"-")},WY=function(e,t){return t===void 0&&(t={}),KY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(VY,PT):e=e.replace(zY,PT),e.replace($Y,YY))};b0.camelCase=WY;var GY=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qY=GY(Pv),XY=b0;function VE(e,t){var n={};return!e||typeof e!="string"||(0,qY.default)(e,function(r,s){r&&s&&(n[(0,XY.camelCase)(r,t)]=s)}),n}VE.default=VE;var QY=VE;const ZY=Wf(QY),E0=Yj("end"),$i=Yj("start");function Yj(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 JY(e){const t=$i(e),n=E0(e);if(t&&n)return{start:t,end:n}}function Hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?BT(e.position):"start"in e||"end"in e?BT(e):"line"in e||"column"in e?KE(e):""}function KE(e){return FT(e&&e.line)+":"+FT(e&&e.column)}function BT(e){return KE(e&&e.start)+"-"+KE(e&&e.end)}function FT(e){return e&&typeof e=="number"?e:1}class Sr 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Hd(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}}Sr.prototype.file="";Sr.prototype.name="";Sr.prototype.reason="";Sr.prototype.message="";Sr.prototype.stack="";Sr.prototype.column=void 0;Sr.prototype.line=void 0;Sr.prototype.ancestors=void 0;Sr.prototype.cause=void 0;Sr.prototype.fatal=void 0;Sr.prototype.place=void 0;Sr.prototype.ruleId=void 0;Sr.prototype.source=void 0;const Bv={}.hasOwnProperty,eW=new Map,tW=/[A-Z]/g,nW=new Set(["table","tbody","thead","tfoot","tr"]),rW=new Set(["td","th"]),Wj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sW(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=fW(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=dW(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"?go:oh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Gj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Gj(e,t,n){if(t.type==="element")return iW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lW(e,t,n);if(t.type==="mdxjsEsm")return oW(e,t);if(t.type==="root")return cW(e,t,n);if(t.type==="text")return uW(e,t)}function iW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=Xj(e,t.tagName,!1),a=hW(e,t);let l=Uv(e,t);return nW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!gY(c):!0})),qj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function aW(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)}If(e,t.position)}function oW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);If(e,t.position)}function lW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Xj(e,t.name,!0),a=pW(e,t),l=Uv(e,t);return qj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function cW(e,t,n){const r={};return Fv(r,Uv(e,t)),e.create(t,e.Fragment,r,n)}function uW(e,t){return t.value}function qj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function fW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=$i(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function hW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Bv.call(t.properties,s)){const i=mW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&rW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else If(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else If(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Uv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:eW;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?(fs(e,e.length,0,t),e):t}const HT={}.hasOwnProperty;function Zj(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 gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dr=yo(/[A-Za-z]/),_r=yo(/[\dA-Za-z]/),kW=yo(/[#-'*+\--9=?A-Z^-~]/);function og(e){return e!==null&&(e<32||e===127)}const YE=yo(/\d/),NW=yo(/[\dA-Fa-f]/),SW=yo(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const x0=yo(new RegExp("\\p{P}|\\p{S}","u")),ll=yo(/\s/);function yo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),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 jt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return At(c)?(e.enter(n),l(c)):t(c)}function l(c){return At(c)&&i++a))return;const T=t.events.length;let S=T,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=T;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function RW(e,t,n){return jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qc(e){if(e===null||nn(e)||ll(e))return 1;if(x0(e))return 2}function w0(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};VT(f,-c),VT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rs(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rs(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Rs(u,w0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rs(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Rs(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,fs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&At(N)?jt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||st(N)?e.check(KT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||st(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,T,S){let R=0;return I;function I($){return N.enter("lineEnding"),N.consume($),N.exit("lineEnding"),D}function D($){return N.enter("codeFencedFence"),At($)?jt(N,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):U($)}function U($){return $===l?(N.enter("codeFencedFenceSequence"),W($)):S($)}function W($){return $===l?(R++,N.consume($),W):R>=a?(N.exit("codeFencedFenceSequence"),At($)?jt(N,M,"whitespace")($):M($)):S($)}function M($){return $===null||st($)?(N.exit("codeFencedFence"),T($)):S($)}}}function zW(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 ob={name:"codeIndented",tokenize:KW},VW={partial:!0,tokenize:YW};function KW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),jt(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):st(u)?e.attempt(VW,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||st(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function YW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):st(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):jt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):st(a)?s(a):n(a)}}const WW={name:"codeText",previous:qW,resolve:GW,tokenize:XW};function GW(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&&Zu(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),Zu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Zu(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,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||og(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||st(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||nn(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):st(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||st(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!At(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function a3(e,t,n,r,s,i){let a;return l;function l(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):st(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),jt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||st(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 zd(e,t){let n;return r;function r(s){return st(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):At(s)?jt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const sG={name:"definition",tokenize:aG},iG={partial:!0,tokenize:oG};function aG(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,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=gi(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 nn(p)?zd(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(iG,f,f)(p)}function f(p){return At(p)?jt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||st(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function oG(e,t,n){return r;function r(l){return nn(l)?zd(e,s)(l):n(l)}function s(l){return a3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return At(l)?jt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||st(l)?t(l):n(l)}}const lG={name:"hardBreakEscape",tokenize:cG};function cG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return st(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const uG={name:"headingAtx",resolve:dG,tokenize:fG};function dG(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"},fs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function fG(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||nn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||st(d)?(e.exit("atxHeading"),t(d)):At(d)?jt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||nn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const hG=["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"],WT=["pre","script","style","textarea"],pG={concrete:!0,name:"htmlFlow",resolveTo:yG,tokenize:bG},mG={partial:!0,tokenize:xG},gG={partial:!0,tokenize:EG};function yG(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 bG(e,t,n){const r=this;let s,i,a,l,c;return u;function u(B){return d(B)}function d(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),f}function f(B){return B===33?(e.consume(B),h):B===47?(e.consume(B),i=!0,g):B===63?(e.consume(B),s=3,r.interrupt?t:A):Dr(B)?(e.consume(B),a=String.fromCharCode(B),w):n(B)}function h(B){return B===45?(e.consume(B),s=2,p):B===91?(e.consume(B),s=5,l=0,m):Dr(B)?(e.consume(B),s=4,r.interrupt?t:A):n(B)}function p(B){return B===45?(e.consume(B),r.interrupt?t:A):n(B)}function m(B){const re="CDATA[";return B===re.charCodeAt(l++)?(e.consume(B),l===re.length?r.interrupt?t:U:m):n(B)}function g(B){return Dr(B)?(e.consume(B),a=String.fromCharCode(B),w):n(B)}function w(B){if(B===null||B===47||B===62||nn(B)){const re=B===47,Q=a.toLowerCase();return!re&&!i&&WT.includes(Q)?(s=1,r.interrupt?t(B):U(B)):hG.includes(a.toLowerCase())?(s=6,re?(e.consume(B),y):r.interrupt?t(B):U(B)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?b(B):x(B))}return B===45||_r(B)?(e.consume(B),a+=String.fromCharCode(B),w):n(B)}function y(B){return B===62?(e.consume(B),r.interrupt?t:U):n(B)}function b(B){return At(B)?(e.consume(B),b):I(B)}function x(B){return B===47?(e.consume(B),I):B===58||B===95||Dr(B)?(e.consume(B),_):At(B)?(e.consume(B),x):I(B)}function _(B){return B===45||B===46||B===58||B===95||_r(B)?(e.consume(B),_):k(B)}function k(B){return B===61?(e.consume(B),N):At(B)?(e.consume(B),k):x(B)}function N(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),c=B,T):At(B)?(e.consume(B),N):S(B)}function T(B){return B===c?(e.consume(B),c=null,R):B===null||st(B)?n(B):(e.consume(B),T)}function S(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||nn(B)?k(B):(e.consume(B),S)}function R(B){return B===47||B===62||At(B)?x(B):n(B)}function I(B){return B===62?(e.consume(B),D):n(B)}function D(B){return B===null||st(B)?U(B):At(B)?(e.consume(B),D):n(B)}function U(B){return B===45&&s===2?(e.consume(B),C):B===60&&s===1?(e.consume(B),j):B===62&&s===4?(e.consume(B),z):B===63&&s===3?(e.consume(B),A):B===93&&s===5?(e.consume(B),P):st(B)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(mG,G,W)(B)):B===null||st(B)?(e.exit("htmlFlowData"),W(B)):(e.consume(B),U)}function W(B){return e.check(gG,M,G)(B)}function M(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),$}function $(B){return B===null||st(B)?W(B):(e.enter("htmlFlowData"),U(B))}function C(B){return B===45?(e.consume(B),A):U(B)}function j(B){return B===47?(e.consume(B),a="",L):U(B)}function L(B){if(B===62){const re=a.toLowerCase();return WT.includes(re)?(e.consume(B),z):U(B)}return Dr(B)&&a.length<8?(e.consume(B),a+=String.fromCharCode(B),L):U(B)}function P(B){return B===93?(e.consume(B),A):U(B)}function A(B){return B===62?(e.consume(B),z):B===45&&s===2?(e.consume(B),A):U(B)}function z(B){return B===null||st(B)?(e.exit("htmlFlowData"),G(B)):(e.consume(B),z)}function G(B){return e.exit("htmlFlow"),t(B)}}function EG(e,t,n){const r=this;return s;function s(a){return st(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 xG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(lh,t,n)}}const wG={name:"htmlText",tokenize:vG};function vG(e,t,n){const r=this;let s,i,a;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),k):A===63?(e.consume(A),x):Dr(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,m):Dr(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):st(A)?(a=f,j(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?C(A):A===45?h(A):f(A)}function m(A){const z="CDATA[";return A===z.charCodeAt(i++)?(e.consume(A),i===z.length?g:m):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),w):st(A)?(a=g,j(A)):(e.consume(A),g)}function w(A){return A===93?(e.consume(A),y):g(A)}function y(A){return A===62?C(A):A===93?(e.consume(A),y):g(A)}function b(A){return A===null||A===62?C(A):st(A)?(a=b,j(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),_):st(A)?(a=x,j(A)):(e.consume(A),x)}function _(A){return A===62?C(A):x(A)}function k(A){return Dr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||_r(A)?(e.consume(A),N):T(A)}function T(A){return st(A)?(a=T,j(A)):At(A)?(e.consume(A),T):C(A)}function S(A){return A===45||_r(A)?(e.consume(A),S):A===47||A===62||nn(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),C):A===58||A===95||Dr(A)?(e.consume(A),I):st(A)?(a=R,j(A)):At(A)?(e.consume(A),R):C(A)}function I(A){return A===45||A===46||A===58||A===95||_r(A)?(e.consume(A),I):D(A)}function D(A){return A===61?(e.consume(A),U):st(A)?(a=D,j(A)):At(A)?(e.consume(A),D):R(A)}function U(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,W):st(A)?(a=U,j(A)):At(A)?(e.consume(A),U):(e.consume(A),M)}function W(A){return A===s?(e.consume(A),s=void 0,$):A===null?n(A):st(A)?(a=W,j(A)):(e.consume(A),W)}function M(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||nn(A)?R(A):(e.consume(A),M)}function $(A){return A===47||A===62||nn(A)?R(A):n(A)}function C(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function j(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),L}function L(A){return At(A)?jt(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):P(A)}function P(A){return e.enter("htmlTextData"),a(A)}}const zv={name:"labelEnd",resolveAll:SG,resolveTo:TG,tokenize:AG},_G={tokenize:CG},kG={tokenize:IG},NG={tokenize:RG};function SG(e){let t=-1;const n=[];for(;++t=3&&(u===null||st(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),At(u)?jt(e,l,"whitespace")(u):l(u))}}const Wr={continuation:{tokenize:$G},exit:zG,name:"list",tokenize:UG},BG={partial:!0,tokenize:VG},FG={partial:!0,tokenize:HG};function UG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:YE(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(lm,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 YE(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(lh,r.interrupt?n:d,e.attempt(BG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return At(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function $G(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(lh,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!At(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(FG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,jt(e,e.attempt(Wr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function HG(e,t,n){const r=this;return jt(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 zG(e){e.exit(this.containerState.type)}function VG(e,t,n){const r=this;return jt(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!At(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const GT={name:"setextUnderline",resolveTo:KG,tokenize:YG};function KG(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 YG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),At(u)?jt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||st(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const WG={tokenize:GG};function GG(e){const t=this,n=e.attempt(lh,r,e.attempt(this.parser.constructs.flowInitial,s,jt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(JW,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 qG={resolveAll:l3()},XG=o3("string"),QG=o3("text");function o3(e){return{resolveAll:l3(e==="text"?ZG:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function dq(e,t){let n=-1;const r=[];let s;for(;++n0){const Ze=me.tokenStack[me.tokenStack.length-1];(Ze[1]||XT).call(me,void 0,Ze[0])}for(ee.position={start:Ia(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Ia(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye0&&(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 Nq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Eu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Aq(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 Cq(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 Iq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={src:Eu(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 Rq(e,t){const n={src:Eu(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 Oq(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 Lq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={href:Eu(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 Mq(e,t){const n={href:Eu(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 jq(e,t,n){const r=e.all(t),s=n?Dq(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 l=-1;for(;++l1}function Pq(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)},l=$i(t.children[1]),c=E0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Hq(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,l=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(JT(t.slice(s),s>0,!1)),i.join("")}function JT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===QT||i===ZT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===QT||i===ZT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Kq(e,t){const n={type:"text",value:Vq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Wq={blockquote:vq,break:_q,code:kq,delete:Nq,emphasis:Sq,footnoteReference:Tq,heading:Aq,html:Cq,imageReference:Iq,image:Rq,inlineCode:Oq,linkReference:Lq,link:Mq,listItem:jq,list:Pq,paragraph:Bq,root:Fq,strong:Uq,table:$q,tableCell:zq,tableRow:Hq,text:Kq,thematicBreak:Yq,toml:hp,yaml:hp,definition:hp,footnoteDefinition:hp};function hp(){}const h3=-1,v0=0,Vd=1,lg=2,Vv=3,Kv=4,Yv=5,Wv=6,p3=7,m3=8,Gq=typeof self=="object"?self:globalThis,e2=(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 Gq[e](t)},qq=(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 v0:case h3:return n(a,s);case Vd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case lg:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Vv:return n(new Date(a),s);case Kv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case Yv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Wv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case p3:{const{name:l,message:c}=a;return n(e2(l,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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(e2(i,a),s)};return r},t2=e=>qq(new Map,e)(0),Ll="",{toString:Xq}={},{keys:Qq}=Object,Ju=e=>{const t=typeof e;if(t!=="object"||!e)return[v0,t];const n=Xq.call(e).slice(8,-1);switch(n){case"Array":return[Vd,Ll];case"Object":return[lg,Ll];case"Date":return[Vv,Ll];case"RegExp":return[Kv,Ll];case"Map":return[Yv,Ll];case"Set":return[Wv,Ll];case"DataView":return[Vd,n]}return n.includes("Array")?[Vd,n]:n.includes("Error")?[p3,n]:[lg,n]},pp=([e,t])=>e===v0&&(t==="function"||t==="symbol"),Zq=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Ju(a);switch(l){case v0:{let d=a;switch(c){case"bigint":l=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([l,d],a)}case Vd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case lg:{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([l,d],a);for(const h of Qq(a))(e||!pp(Ju(a[h])))&&d.push([i(h),i(a[h])]);return f}case Vv:return s([l,a.toISOString()],a);case Kv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case Yv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(pp(Ju(h))||pp(Ju(p))))&&d.push([i(h),i(p)]);return f}case Wv:{const d=[],f=s([l,d],a);for(const h of a)(e||!pp(Ju(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},n2=(e,{json:t,lossy:n}={})=>{const r=[];return Zq(!(t||n),!!t,new Map,r)(e),r},Xc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?t2(n2(e,t)):structuredClone(e):(e,t)=>t2(n2(e,t));function Jq(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 eX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Jq,r=e.options.footnoteBackLabel||eX,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Xc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const ch=function(e){if(e==null)return iX;if(typeof e=="function")return _0(e);if(typeof e=="object")return Array.isArray(e)?nX(e):rX(e);if(typeof e=="string")return sX(e);throw new Error("Expected function, string, or object as test")};function nX(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=g3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=cX(n(c,d)),p[0]===GE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==lX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` +`}),n}function r2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function s2(e,t){const n=dX(e,t),r=n.one(e,void 0),s=tX(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function gX(e,t){return e&&"run"in e?async function(n,r){const s=s2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return s2(n,{file:r,...e||t})}}function i2(e){if(e)throw e}var cm=Object.prototype.hasOwnProperty,b3=Object.prototype.toString,a2=Object.defineProperty,o2=Object.getOwnPropertyDescriptor,l2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):b3.call(t)==="[object Array]"},c2=function(t){if(!t||b3.call(t)!=="[object Object]")return!1;var n=cm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||cm.call(t,s)},u2=function(t,n){a2&&n.name==="__proto__"?a2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},d2=function(t,n){if(n==="__proto__")if(cm.call(t,n)){if(o2)return o2(t,n).value}else return;return t[n]},yX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Ai={basename:xX,dirname:wX,extname:vX,join:_X,sep:"/"};function xX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dh(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function wX(e){if(dh(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 vX(e){dh(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 _X(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function dh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SX={cwd:TX};function TX(){return"/"}function QE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AX(e){if(typeof e=="string")e=new URL(e);else if(!QE(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 CX(e)}function CX(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 g=r[h][1];XE(g)&&XE(p)&&(p=cb(!0,g,p)),r[h]=[u,p,...m]}}}}const LX=new Gv().freeze();function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mb(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 h2(e){if(!XE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function p2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mp(e){return MX(e)?e:new E3(e)}function MX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jX(e){return typeof e=="string"||DX(e)}function DX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",m2=[],g2={allowDangerousHtml:!0},BX=/^(https?|ircs?|mailto|xmpp)$/i,FX=[{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 UX(e){const t=$X(e),n=HX(e);return zX(t.runSync(t.parse(n),n),e)}function $X(e){const t=e.rehypePlugins||m2,n=e.remarkPlugins||m2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...g2}:g2;return LX().use(wq).use(n).use(gX,r).use(t)}function HX(e){const t=e.children||"",n=new E3;return typeof t=="string"&&(n.value=t),n}function zX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||VX;for(const d of FX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+PX+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),uh(e,u),sW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 ab)if(Object.hasOwn(ab,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=ab[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function VX(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||BX.test(e.slice(0,t))?e:""}function y2(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 KX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function YX(e,t,n){const s=ch((n||{}).ignore||[]),i=WX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=y2(e,"(");let i=y2(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||ll(n)||x0(n))&&(!t||n!==47)}w3.peek=gQ;function lQ(){this.buffer()}function cQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uQ(){this.buffer()}function dQ(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=gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hQ(e){this.exit(e)}function pQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mQ(e){this.exit(e)}function gQ(){return"["}function w3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function yQ(){return{enter:{gfmFootnoteCallString:lQ,gfmFootnoteCall:cQ,gfmFootnoteDefinitionLabelString:uQ,gfmFootnoteDefinition:dQ},exit:{gfmFootnoteCallString:fQ,gfmFootnoteCall:hQ,gfmFootnoteDefinitionLabelString:pQ,gfmFootnoteDefinition:mQ}}}function bQ(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 l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?v3:EQ))),u(),c}}function EQ(e,t,n){return t===0?e:v3(e,t,n)}function v3(e,t,n){return(n?"":" ")+e}const xQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_3.peek=NQ;function wQ(){return{canContainEols:["delete"],enter:{strikethrough:_Q},exit:{strikethrough:kQ}}}function vQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xQ}],handlers:{delete:_3}}}function _Q(e){this.enter({type:"delete",children:[]},e)}function kQ(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 NQ(){return"~"}function SQ(e){return e.length}function TQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||SQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),IQ);return s(),a}function IQ(e,t,n){return">"+(n?"":" ")+e}function RQ(e,t){return x2(e,t.inConstruct,!0)&&!x2(e,t.notInConstruct,!1)}function x2(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 LQ(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 MQ(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 jQ(e,t,n,r){const s=MQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(LQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,DQ);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(OQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`,encode:["`"],...l.current()})),f()}return d+=l.move(` +`),i&&(d+=l.move(i+` +`)),d+=l.move(c),u(),d}function DQ(e,t,n){return(n?"":" ")+e}function qv(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 PQ(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function BQ(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 Rf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cg(e,t,n){const r=qc(e),s=qc(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=FQ;function N3(e,t,n,r){const s=BQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=cg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Rf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=cg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Rf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function FQ(e,t,n){return n.options.emphasis||"*"}function UQ(e,t){let n=!1;return uh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,GE}),!!((!e.depth||e.depth<3)&&$v(e)&&(t.options.setext||n))}function $Q(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(UQ(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),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=Rf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}S3.peek=HQ;function S3(e){return e.value||""}function HQ(){return"<"}T3.peek=zQ;function T3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function zQ(){return"!"}A3.peek=VQ;function A3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function VQ(){return"!"}C3.peek=KQ;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))}R3.peek=YQ;function R3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(I3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function YQ(e,t,n){return I3(e,n)?"<":"["}O3.peek=WQ;function O3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function WQ(){return"["}function Xv(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 GQ(e){const t=Xv(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 qQ(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 XQ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?qQ(n):Xv(n);const l=e.ordered?a==="."?")":".":GQ(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 JQ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const eZ=ch(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tZ(e,t,n,r){return(e.children.some(function(a){return eZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nZ(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=rZ;function M3(e,t,n,r){const s=nZ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=cg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Rf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=cg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Rf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function rZ(e,t,n){return n.options.strong||"*"}function sZ(e,t,n,r){return n.safe(e.value,r)}function iZ(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 aZ(e,t,n){const r=(L3(n)+(n.options.ruleSpaces?" ":"")).repeat(iZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const j3={blockquote:CQ,break:w2,code:jQ,definition:PQ,emphasis:N3,hardBreak:w2,heading:$Q,html:S3,image:T3,imageReference:A3,inlineCode:C3,link:R3,linkReference:O3,list:XQ,listItem:ZQ,paragraph:JQ,root:tZ,strong:M3,text:sZ,thematicBreak:aZ};function oZ(){return{enter:{table:lZ,tableData:v2,tableHeader:v2,tableRow:uZ},exit:{codeText:dZ,table:cZ,tableData:Eb,tableHeader:Eb,tableRow:Eb}}}function lZ(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 cZ(e){this.exit(e),this.data.inTable=void 0}function uZ(e){this.enter({type:"tableRow",children:[]},e)}function Eb(e){this.exit(e)}function v2(e){this.enter({type:"tableCell",children:[]},e)}function dZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fZ(e,t){return t==="|"?t:e}function hZ(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:l}};function a(p,m,g,w){return u(d(p,g,w),p.align)}function l(p,m,g,w){const y=f(p,g,w),b=u([y]);return b.slice(0,b.indexOf(` +`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return TQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const RZ={tokenize:FZ,partial:!0};function OZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DZ,continuation:{tokenize:PZ},exit:BZ}},text:{91:{name:"gfmFootnoteCall",tokenize:jZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LZ,resolveTo:MZ}}}}function LZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=gi(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 MZ(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)},l=[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,...l),e}function jZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||nn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(gi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return nn(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 DZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||nn(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=gi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return nn(m)||(l=!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),jt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function PZ(e,t,n){return e.check(lh,t,e.attempt(RZ,t,n))}function BZ(e){e.exit("gfmFootnoteDefinition")}function FZ(e,t,n){const r=this;return jt(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 UZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=qc(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class $Z{constructor(){this.map=[]}add(t,n,r){HZ(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 HZ(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,W=U==="tableHead"||U==="tableRow"?N:c;return W===N&&r.parser.lazy[r.now().line]?n(I):W(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):st(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):At(I)?jt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||nn(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,At(I)?jt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return At(I)?jt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||st(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return At(I)?jt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||st(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||st(I)?(e.exit("tableRow"),t(I)):At(I)?jt(e,T,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||nn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function YZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new $Z;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Hl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function k2(e,t,n,r,s){const i=[],a=Hl(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 Hl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const WZ={name:"tasklistCheck",tokenize:qZ};function GZ(){return{text:{91:WZ}}}function qZ(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 nn(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"),l):n(c)}function l(c){return st(c)?t(c):At(c)?e.check({tokenize:XZ},t,n)(c):n(c)}}function XZ(e,t,n){return jt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function QZ(e){return Zj([vZ(),OZ(),UZ(e),VZ(),GZ()])}const ZZ={};function JZ(e){const t=this,n=e||ZZ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(QZ(n)),i.push(bZ()),a.push(EZ(n))}const N2=function(e,t,n){const r=ch(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"?oJ(e,t,n):e.type==="text"?n.whitespace==="normal"?Y3(e,n):lJ(e):[]}function oJ(e,t,n){const r=W3(e,n),s=e.children||[];let i=-1,a=[];if(iJ(e))return a;let l,c;for(JE(e)||C2(e)&&N2(t,e,C2)?c=` +`:sJ(e)?(l=2,c=2):V3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mJ(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=pJ(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 G3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function gJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function yJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bJ(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const EJ=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_-]*/}}),xJ=["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"],wJ=["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"],vJ=[...xJ,...wJ],_J=["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(),kJ=["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(),NJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),SJ=["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 TJ(e){const t=e.regex,n=EJ(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_-]*",l=[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:":("+kJ.join("|")+")"},{begin:":(:)?("+NJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+SJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:_J.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vJ.join("|")+")\\b"}]}}function AJ(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 CJ(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 RJ(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,I2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I2,u]}}const R2="[A-Za-z$_][0-9A-Za-z$_]*",OJ=["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"],LJ=["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"],MJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jJ=[].concat(J3,Q3,Z3);function eD(e){const t=e.regex,n=(L,{after:P})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,P)=>{const A=L[0].length+L.index,z=L.input[A];if(z==="<"||z===","){P.ignoreMatch();return}z===">"&&(n(L,{after:A})||P.ignoreMatch());let G;const B=L.input.substring(A);if(G=B.match(/^\s*=/)){P.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){P.ignoreMatch();return}}},l={$pattern:R2,keyword:OJ,literal:LJ,built_in:jJ,"variable.language":MJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,U([...J3,"super","import"].map(L=>`${L}\\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},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,T,$,{match:/\$[(.]/}]}}function tD(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 Vl="[0-9](_*[0-9])*",Ep=`\\.(${Vl})`,xp="[0-9a-fA-F](_*[0-9a-fA-F])*",DJ={className:"number",variants:[{begin:`(\\b(${Vl})((${Ep})|\\.)?|(${Ep}))[eE][+-]?(${Vl})[fFdD]?\\b`},{begin:`\\b(${Vl})((${Ep})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ep})[fFdD]?\\b`},{begin:`\\b(${Vl})[fFdD]\\b`},{begin:`\\b0[xX]((${xp})\\.?|(${xp})?\\.(${xp}))[pP][+-]?(${Vl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${xp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function PJ(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 l={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=DJ,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const BJ=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_-]*/}}),FJ=["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"],UJ=["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"],$J=[...FJ,...UJ],HJ=["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(),nD=["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(),rD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zJ=["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(),VJ=nD.concat(rD).sort().reverse();function KJ(e){const t=BJ(e),n=VJ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:HJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+zJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+$J.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:":("+nD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+rD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function YJ(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 sD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 WJ(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_]*/,l={"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:l,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 GJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 qJ(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},l={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,$)=>{$.data._beginMatch=M[1]||M[2]},"on:end":(M,$)=>{$.data._beginMatch!==M[1]&&$.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(M=>{const $=[];return M.forEach(C=>{$.push(C),C.toLowerCase()===C?$.push(C.toUpperCase()):$.push(C.toLowerCase())}),$})(w),built_in:b},k=M=>M.map($=>$.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const U=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],W={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[W,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}]}},l,{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",W,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function XJ(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 QJ(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function ZJ(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function JJ(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 eee(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function tee(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const nee=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_-]*/}}),ree=["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"],see=["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"],iee=[...ree,...see],aee=["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(),oee=["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(),lee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cee=["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 uee(e){const t=nee(e),n=lee,r=oee,s="@[a-z-]+",i="and or not only",l={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("+iee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cee.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,l,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:aee.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function dee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function fee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:T}={}){const S=T;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function oD(e){return e?typeof e=="string"?e:e.source:null}function ed(e){return Qt("(?=",e,")")}function Qt(...e){return e.map(n=>oD(n)).join("")}function hee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Lr(...e){return"("+(hee(e).capture?"":"?:")+e.map(r=>oD(r)).join("|")+")"}const Jv=e=>Qt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),pee=["Protocol","Type"].map(Jv),O2=["init","self"].map(Jv),mee=["Any","Self"],xb=["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"],L2=["false","nil","true"],gee=["assignment","associativity","higherThan","left","lowerThan","none","right"],yee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],M2=["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"],lD=Lr(/[/=\-+!*%<>&|^~?]/,/[\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]/),cD=Lr(lD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wb=Qt(lD,cD,"*"),uD=Lr(/[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]/),ug=Lr(uD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Si=Qt(uD,ug,"*"),wp=Qt(/[A-Z]/,ug,"*"),bee=["attached","autoclosure",Qt(/convention\(/,Lr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Qt(/objc\(/,Si,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Eee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function xee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,Lr(...pee,...O2)],className:{2:"keyword"}},i={match:Qt(/\./,Lr(...xb)),relevance:0},a=xb.filter(Ae=>typeof Ae=="string").concat(["_|0"]),l=xb.filter(Ae=>typeof Ae!="string").concat(mee).map(Jv),c={variants:[{className:"keyword",match:Lr(...l,...O2)}]},u={$pattern:Lr(/\b\w+/,/#\w+/),keyword:a.concat(yee),literal:L2},d=[s,i,c],f={match:Qt(/\./,Lr(...M2)),relevance:0},h={className:"built_in",match:Qt(/\b/,Lr(...M2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:wb},{match:`\\.(\\.|${cD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Ae="")=>({className:"subst",variants:[{match:Qt(/\\/,Ae,/[0\\tnr"']/)},{match:Qt(/\\/,Ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Ae="")=>({className:"subst",match:Qt(/\\/,Ae,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Ae="")=>({className:"subst",label:"interpol",begin:Qt(/\\/,Ae,/\(/),end:/\)/}),T=(Ae="")=>({begin:Qt(Ae,/"""/),end:Qt(/"""/,Ae),contains:[_(Ae),k(Ae),N(Ae)]}),S=(Ae="")=>({begin:Qt(Ae,/"/),end:Qt(/"/,Ae),contains:[_(Ae),N(Ae)]}),R={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},U=Ae=>{const He=Qt(Ae,/\//),Ce=Qt(/\//,Ae);return{begin:He,end:Ce,contains:[...I,{scope:"comment",begin:`#(?!.*${Ce})`,end:/$/}]}},W={scope:"regexp",variants:[U("###"),U("##"),U("#"),D]},M={match:Qt(/`/,Si,/`/)},$={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${ug}+`},j=[M,$,C],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Eee,contains:[...w,x,R]}]}},P={scope:"keyword",match:Qt(/@/,Lr(...bee),ed(Lr(/\(/,/\s+/)))},A={scope:"meta",match:Qt(/@/,Si)},z=[L,P,A],G={match:ed(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Qt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ug,"+")},{className:"type",match:wp,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Qt(/\s+&\s+/,ed(wp)),relevance:0}]},B={begin://,keywords:u,contains:[...r,...d,...z,m,G]};G.contains.push(B);const re={match:Qt(Si,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",re,...r,W,...d,...p,...w,x,R,...j,...z,G]},se={begin://,keywords:"repeat each",contains:[...r,G]},de={begin:Lr(ed(Qt(Si,/\s*:/)),ed(Qt(Si,/\s+/,Si,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Si}]},te={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,x,R,...z,G,Q],endsParent:!0,illegal:/["']/},pe={match:[/(func|macro)/,/\s+/,Lr(M.match,Si,wb)],className:{1:"keyword",3:"title.function"},contains:[se,te,t],illegal:[/\[/,/%/]},ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[se,te,t],illegal:/\[|%/},ye={match:[/operator/,/\s+/,wb],className:{1:"keyword",3:"title"}},ge={begin:[/precedencegroup/,/\s+/,wp],className:{1:"keyword",3:"title"},contains:[G],keywords:[...gee,...L2],end:/}/},be={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},xe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ke={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Si,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[se,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:wp},...d],relevance:0}]};for(const Ae of R.variants){const He=Ae.contains.find(gt=>gt.label==="interpol");He.keywords=u;const Ce=[...d,...p,...w,x,R,...j];He.contains=[...Ce,{begin:/\(/,end:/\)/,contains:["self",...Ce]}]}return{name:"Swift",keywords:u,contains:[...r,pe,ne,be,xe,ke,ye,ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...p,...w,x,R,...j,...z,G,Q]}}const dg="[A-Za-z$_][0-9A-Za-z$_]*",dD=["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"],fD=["true","false","null","undefined","NaN","Infinity"],hD=["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"],pD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yD=[].concat(mD,hD,pD);function wee(e){const t=e.regex,n=(L,{after:P})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,P)=>{const A=L[0].length+L.index,z=L.input[A];if(z==="<"||z===","){P.ignoreMatch();return}z===">"&&(n(L,{after:A})||P.ignoreMatch());let G;const B=L.input.substring(A);if(G=B.match(/^\s*=/)){P.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){P.ignoreMatch();return}}},l={$pattern:dg,keyword:dD,literal:fD,built_in:yD,"variable.language":gD},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...hD,...pD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,U([...mD,"super","import"].map(L=>`${L}\\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},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,T,$,{match:/\$[(.]/}]}}function bD(e){const t=e.regex,n=wee(e),r=dg,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:dg,keyword:dD.concat(c),literal:fD,built_in:yD.concat(s),"variable.language":gD},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function vee(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 _ee(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},l={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,l]}}function kee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 ED(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Nee={arduino:mJ,bash:G3,c:gJ,cpp:yJ,csharp:bJ,css:TJ,diff:AJ,go:CJ,graphql:IJ,ini:q3,java:RJ,javascript:eD,json:tD,kotlin:PJ,less:KJ,lua:YJ,makefile:sD,markdown:iD,objectivec:WJ,perl:GJ,php:qJ,"php-template":XJ,plaintext:QJ,python:aD,"python-repl":ZJ,r:JJ,ruby:eee,rust:tee,scss:uee,shell:dee,sql:fee,swift:xee,typescript:bD,vbnet:vee,wasm:_ee,xml:kee,yaml:ED};function xD(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)&&xD(n)}),e}let j2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wD(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Wa(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 See="",D2=e=>!!e.scope,Tee=(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 Aee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=wD(t)}openNode(t){if(!D2(t))return;const n=Tee(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){D2(t)&&(this.buffer+=See)}value(){return this.buffer}span(t){this.buffer+=``}}const P2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class e_{constructor(){this.rootNode=P2(),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=P2({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=>{e_._collapse(n)}))}}class Cee extends e_{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 Aee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Of(e){return e?typeof e=="string"?e:e.source:null}function vD(e){return xl("(?=",e,")")}function Iee(e){return xl("(?:",e,")*")}function Ree(e){return xl("(?:",e,")?")}function xl(...e){return e.map(n=>Of(n)).join("")}function Oee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function t_(...e){return"("+(Oee(e).capture?"":"?:")+e.map(r=>Of(r)).join("|")+")"}function _D(e){return new RegExp(e.toString()+"|").exec("").length-1}function Lee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Mee=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function n_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Of(r),a="";for(;i.length>0;){const l=Mee.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const jee=/\b\B/,kD="[a-zA-Z]\\w*",r_="[a-zA-Z_]\\w*",ND="\\b\\d+(\\.\\d+)?",SD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",TD="\\b(0b[01]+)",Dee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Pee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=xl(t,/.*\b/,e.binary,/\b.*/)),Wa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Lf={begin:"\\\\[\\s\\S]",relevance:0},Bee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Lf]},Fee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Lf]},Uee={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/},k0=function(e,t,n={}){const r=Wa({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=t_("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:xl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},$ee=k0("//","$"),Hee=k0("/\\*","\\*/"),zee=k0("#","$"),Vee={scope:"number",begin:ND,relevance:0},Kee={scope:"number",begin:SD,relevance:0},Yee={scope:"number",begin:TD,relevance:0},Wee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Lf,{begin:/\[/,end:/\]/,relevance:0,contains:[Lf]}]},Gee={scope:"title",begin:kD,relevance:0},qee={scope:"title",begin:r_,relevance:0},Xee={begin:"\\.\\s*"+r_,relevance:0},Qee=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 vp=Object.freeze({__proto__:null,APOS_STRING_MODE:Bee,BACKSLASH_ESCAPE:Lf,BINARY_NUMBER_MODE:Yee,BINARY_NUMBER_RE:TD,COMMENT:k0,C_BLOCK_COMMENT_MODE:Hee,C_LINE_COMMENT_MODE:$ee,C_NUMBER_MODE:Kee,C_NUMBER_RE:SD,END_SAME_AS_BEGIN:Qee,HASH_COMMENT_MODE:zee,IDENT_RE:kD,MATCH_NOTHING_RE:jee,METHOD_GUARD:Xee,NUMBER_MODE:Vee,NUMBER_RE:ND,PHRASAL_WORDS_MODE:Uee,QUOTE_STRING_MODE:Fee,REGEXP_MODE:Wee,RE_STARTERS_RE:Dee,SHEBANG:Pee,TITLE_MODE:Gee,UNDERSCORE_IDENT_RE:r_,UNDERSCORE_TITLE_MODE:qee});function Zee(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Jee(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ete(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Zee,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tte(e,t){Array.isArray(e.illegal)&&(e.illegal=t_(...e.illegal))}function nte(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 rte(e,t){e.relevance===void 0&&(e.relevance=1)}const ste=(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=xl(n.beforeMatch,vD(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ite=["of","and","for","in","not","or","if","then","parent","list","value"],ate="keyword";function AD(e,t,n=ate){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,AD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,ote(c[0],c[1])]})}}function ote(e,t){return t?Number(t):lte(e)?0:1}function lte(e){return ite.includes(e.toLowerCase())}const B2={},Xo=e=>{console.error(e)},F2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ml=(e,t)=>{B2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),B2[`${e}/${t}`]=!0)},fg=new Error;function CD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=_D(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function cte(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fg;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xo("beginScope must be object"),fg;CD(e,e.begin,{key:"beginScope"}),e.begin=n_(e.begin,{joinWith:""})}}function ute(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fg;if(typeof e.endScope!="object"||e.endScope===null)throw Xo("endScope must be object"),fg;CD(e,e.end,{key:"endScope"}),e.end=n_(e.end,{joinWith:""})}}function dte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function fte(e){dte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),cte(e),ute(e)}function hte(e){function t(a,l){return new RegExp(Of(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=_D(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(n_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[Jee,nte,fte,ste].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[ete,tte,rte].forEach(d=>d(a,l)),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=AD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=Of(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return pte(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Wa(e.classNameAliases||{}),i(e)}function ID(e){return e?e.endsWithParent||ID(e.starts):!1}function pte(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Wa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ID(e)?Wa(e,{starts:e.starts?Wa(e.starts):null}):Object.isFrozen(e)?Wa(e):e}var mte="11.11.1";class gte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const vb=wD,U2=Wa,$2=Symbol("nomatch"),yte=7,RD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Cee};function c(C){return l.noHighlightRe.test(C)}function u(C){let j=C.className+" ";j+=C.parentNode?C.parentNode.className:"";const L=l.languageDetectRe.exec(j);if(L){const P=S(L[1]);return P||(F2(i.replace("{}",L[1])),F2("Falling back to no-highlight mode for this block.",C)),P?L[1]:"no-highlight"}return j.split(/\s+/).find(P=>c(P)||S(P))}function d(C,j,L){let P="",A="";typeof j=="object"?(P=C,L=j.ignoreIllegals,A=j.language):(Ml("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ml("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),A=C,P=j),L===void 0&&(L=!0);const z={code:P,language:A};M("before:highlight",z);const G=z.result?z.result:f(z.language,z.code,L);return G.code=z.code,M("after:highlight",G),G}function f(C,j,L,P){const A=Object.create(null);function z(X,ee){return X.keywords[ee]}function G(){if(!Ce.keywords){Ge.addText(ze);return}let X=0;Ce.keywordPatternRe.lastIndex=0;let ee=Ce.keywordPatternRe.exec(ze),me="";for(;ee;){me+=ze.substring(X,ee.index);const Le=ke.case_insensitive?ee[0].toLowerCase():ee[0],Ye=z(Ce,Le);if(Ye){const[Ze,Pt]=Ye;if(Ge.addText(me),me="",A[Le]=(A[Le]||0)+1,A[Le]<=yte&&(le+=Pt),Ze.startsWith("_"))me+=ee[0];else{const bt=ke.classNameAliases[Ze]||Ze;Q(ee[0],bt)}}else me+=ee[0];X=Ce.keywordPatternRe.lastIndex,ee=Ce.keywordPatternRe.exec(ze)}me+=ze.substring(X),Ge.addText(me)}function B(){if(ze==="")return;let X=null;if(typeof Ce.subLanguage=="string"){if(!t[Ce.subLanguage]){Ge.addText(ze);return}X=f(Ce.subLanguage,ze,!0,gt[Ce.subLanguage]),gt[Ce.subLanguage]=X._top}else X=p(ze,Ce.subLanguage.length?Ce.subLanguage:null);Ce.relevance>0&&(le+=X.relevance),Ge.__addSublanguage(X._emitter,X.language)}function re(){Ce.subLanguage!=null?B():G(),ze=""}function Q(X,ee){X!==""&&(Ge.startScope(ee),Ge.addText(X),Ge.endScope())}function se(X,ee){let me=1;const Le=ee.length-1;for(;me<=Le;){if(!X._emit[me]){me++;continue}const Ye=ke.classNameAliases[X[me]]||X[me],Ze=ee[me];Ye?Q(Ze,Ye):(ze=Ze,G(),ze=""),me++}}function de(X,ee){return X.scope&&typeof X.scope=="string"&&Ge.openNode(ke.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(Q(ze,ke.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),ze=""):X.beginScope._multi&&(se(X.beginScope,ee),ze="")),Ce=Object.create(X,{parent:{value:Ce}}),Ce}function te(X,ee,me){let Le=Lee(X.endRe,me);if(Le){if(X["on:end"]){const Ye=new j2(X);X["on:end"](ee,Ye),Ye.isMatchIgnored&&(Le=!1)}if(Le){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return te(X.parent,ee,me)}function pe(X){return Ce.matcher.regexIndex===0?(ze+=X[0],1):(ft=!0,0)}function ne(X){const ee=X[0],me=X.rule,Le=new j2(me),Ye=[me.__beforeBegin,me["on:begin"]];for(const Ze of Ye)if(Ze&&(Ze(X,Le),Le.isMatchIgnored))return pe(ee);return me.skip?ze+=ee:(me.excludeBegin&&(ze+=ee),re(),!me.returnBegin&&!me.excludeBegin&&(ze=ee)),de(me,X),me.returnBegin?0:ee.length}function ye(X){const ee=X[0],me=j.substring(X.index),Le=te(Ce,X,me);if(!Le)return $2;const Ye=Ce;Ce.endScope&&Ce.endScope._wrap?(re(),Q(ee,Ce.endScope._wrap)):Ce.endScope&&Ce.endScope._multi?(re(),se(Ce.endScope,X)):Ye.skip?ze+=ee:(Ye.returnEnd||Ye.excludeEnd||(ze+=ee),re(),Ye.excludeEnd&&(ze=ee));do Ce.scope&&Ge.closeNode(),!Ce.skip&&!Ce.subLanguage&&(le+=Ce.relevance),Ce=Ce.parent;while(Ce!==Le.parent);return Le.starts&&de(Le.starts,X),Ye.returnEnd?0:ee.length}function ge(){const X=[];for(let ee=Ce;ee!==ke;ee=ee.parent)ee.scope&&X.unshift(ee.scope);X.forEach(ee=>Ge.openNode(ee))}let be={};function xe(X,ee){const me=ee&&ee[0];if(ze+=X,me==null)return re(),0;if(be.type==="begin"&&ee.type==="end"&&be.index===ee.index&&me===""){if(ze+=j.slice(ee.index,ee.index+1),!s){const Le=new Error(`0 width match regex (${C})`);throw Le.languageName=C,Le.badRule=be.rule,Le}return 1}if(be=ee,ee.type==="begin")return ne(ee);if(ee.type==="illegal"&&!L){const Le=new Error('Illegal lexeme "'+me+'" for mode "'+(Ce.scope||"")+'"');throw Le.mode=Ce,Le}else if(ee.type==="end"){const Le=ye(ee);if(Le!==$2)return Le}if(ee.type==="illegal"&&me==="")return ze+=` +`,1;if(ut>1e5&&ut>ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=me,me.length}const ke=S(C);if(!ke)throw Xo(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Ae=hte(ke);let He="",Ce=P||Ae;const gt={},Ge=new l.__emitter(l);ge();let ze="",le=0,Ee=0,ut=0,ft=!1;try{if(ke.__emitTokens)ke.__emitTokens(j,Ge);else{for(Ce.matcher.considerAll();;){ut++,ft?ft=!1:Ce.matcher.considerAll(),Ce.matcher.lastIndex=Ee;const X=Ce.matcher.exec(j);if(!X)break;const ee=j.substring(Ee,X.index),me=xe(ee,X);Ee=X.index+me}xe(j.substring(Ee))}return Ge.finalize(),He=Ge.toHTML(),{language:C,value:He,relevance:le,illegal:!1,_emitter:Ge,_top:Ce}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:C,value:vb(j),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Ee,context:j.slice(Ee-100,Ee+100),mode:X.mode,resultSoFar:He},_emitter:Ge};if(s)return{language:C,value:vb(j),illegal:!1,relevance:0,errorRaised:X,_emitter:Ge,_top:Ce};throw X}}function h(C){const j={value:vb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return j._emitter.addText(C),j}function p(C,j){j=j||l.languages||Object.keys(t);const L=h(C),P=j.filter(S).filter(I).map(re=>f(re,C,!1));P.unshift(L);const A=P.sort((re,Q)=>{if(re.relevance!==Q.relevance)return Q.relevance-re.relevance;if(re.language&&Q.language){if(S(re.language).supersetOf===Q.language)return 1;if(S(Q.language).supersetOf===re.language)return-1}return 0}),[z,G]=A,B=z;return B.secondBest=G,B}function m(C,j,L){const P=j&&n[j]||L;C.classList.add("hljs"),C.classList.add(`language-${P}`)}function g(C){let j=null;const L=u(C);if(c(L))return;if(M("before:highlightElement",{el:C,language:L}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new gte("One of your code blocks includes unescaped HTML.",C.innerHTML);j=C;const P=j.textContent,A=L?d(P,{language:L,ignoreIllegals:!0}):p(P);C.innerHTML=A.value,C.dataset.highlighted="yes",m(C,L,A.language),C.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(C.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),M("after:highlightElement",{el:C,result:A,text:P})}function w(C){l=U2(l,C)}const y=()=>{_(),Ml("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Ml("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,j){let L=null;try{L=j(e)}catch(P){if(Xo("Language definition for '{}' could not be registered.".replace("{}",C)),s)Xo(P);else throw P;L=a}L.name||(L.name=C),t[C]=L,L.rawDefinition=j.bind(null,e),L.aliases&&R(L.aliases,{languageName:C})}function N(C){delete t[C];for(const j of Object.keys(n))n[j]===C&&delete n[j]}function T(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:j}){typeof C=="string"&&(C=[C]),C.forEach(L=>{n[L.toLowerCase()]=j})}function I(C){const j=S(C);return j&&!j.disableAutodetect}function D(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=j=>{C["before:highlightBlock"](Object.assign({block:j.el},j))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=j=>{C["after:highlightBlock"](Object.assign({block:j.el},j))})}function U(C){D(C),r.push(C)}function W(C){const j=r.indexOf(C);j!==-1&&r.splice(j,1)}function M(C,j){const L=C;r.forEach(function(P){P[L]&&P[L](j)})}function $(C){return Ml("10.7.0","highlightBlock will be removed entirely in v12.0"),Ml("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:$,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:T,getLanguage:S,registerAliases:R,autoDetection:I,inherit:U2,addPlugin:U,removePlugin:W}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=mte,e.regex={concat:xl,lookahead:vD,either:t_,optional:Ree,anyNumberOfTimes:Iee};for(const C in vp)typeof vp[C]=="object"&&xD(vp[C]);return Object.assign(e,vp),e},Qc=RD({});Qc.newInstance=()=>RD({});var bte=Qc;Qc.HighlightJS=Qc;Qc.default=Qc;const es=Wf(bte),H2={},Ete="hljs-";function xte(e){const t=es.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||H2,h=typeof f.prefix=="string"?f.prefix:Ete;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:wte,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||H2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class wte{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,l){return l?a+"_".repeat(l):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 vte={};function z2(e){const t=e||vte,n=t.aliases,r=t.detect||!1,s=t.languages||Nee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=xte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){uh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=_te(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=aJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function _te(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 l=n[a];if(l===void 0){const c=Y2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 qte(e){return e>=56320&&e<=57343}function Xte(e,t){return(e-55296)*1024+9216+t}function PD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function BD(e){return e>=64976&&e<=65007||Gte.has(e)}var he;(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"})(he||(he={}));const Qte=65536;class Zte{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=Qte,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(qte(n))return this.pos++,this._addGap(),Xte(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(he.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,DD(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){PD(t)?this._err(he.controlCharacterInInputStream):BD(t)&&this._err(he.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 Jte=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))),ene=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 tne(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ene.get(e))!==null&&t!==void 0?t:e}var ar;(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"})(ar||(ar={}));const nne=32;var Ga;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ga||(Ga={}));function tx(e){return e>=ar.ZERO&&e<=ar.NINE}function rne(e){return e>=ar.UPPER_A&&e<=ar.UPPER_F||e>=ar.LOWER_A&&e<=ar.LOWER_F}function sne(e){return e>=ar.UPPER_A&&e<=ar.UPPER_Z||e>=ar.LOWER_A&&e<=ar.LOWER_Z||tx(e)}function ine(e){return e===ar.EQUALS||sne(e)}var sr;(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"})(sr||(sr={}));var ta;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ta||(ta={}));class ane{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=sr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ta.Strict}startEntity(t){this.decodeMode=t,this.state=sr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case sr.EntityStart:return t.charCodeAt(n)===ar.NUM?(this.state=sr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=sr.NamedEntity,this.stateNamedEntity(t,n));case sr.NumericStart:return this.stateNumericStart(t,n);case sr.NumericDecimal:return this.stateNumericDecimal(t,n);case sr.NumericHex:return this.stateNumericHex(t,n);case sr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|nne)===ar.LOWER_X?(this.state=sr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=sr.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===ar.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ta.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]&Ga.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]&~Ga.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case sr.NamedEntity:return this.result!==0&&(this.decodeMode!==ta.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sr.NumericDecimal:return this.emitNumericEntity(0,2);case sr.NumericHex:return this.emitNumericEntity(0,3);case sr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sr.EntityStart:return 0}}}function one(e,t,n,r){const s=(t&Ga.BRANCH_LENGTH)>>7,i=t&Ga.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=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 Qo;(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"})(Qo||(Qo={}));var Os;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Os||(Os={}));var ae;(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"})(ae||(ae={}));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 lne=new Map([[ae.A,v.A],[ae.ADDRESS,v.ADDRESS],[ae.ANNOTATION_XML,v.ANNOTATION_XML],[ae.APPLET,v.APPLET],[ae.AREA,v.AREA],[ae.ARTICLE,v.ARTICLE],[ae.ASIDE,v.ASIDE],[ae.B,v.B],[ae.BASE,v.BASE],[ae.BASEFONT,v.BASEFONT],[ae.BGSOUND,v.BGSOUND],[ae.BIG,v.BIG],[ae.BLOCKQUOTE,v.BLOCKQUOTE],[ae.BODY,v.BODY],[ae.BR,v.BR],[ae.BUTTON,v.BUTTON],[ae.CAPTION,v.CAPTION],[ae.CENTER,v.CENTER],[ae.CODE,v.CODE],[ae.COL,v.COL],[ae.COLGROUP,v.COLGROUP],[ae.DD,v.DD],[ae.DESC,v.DESC],[ae.DETAILS,v.DETAILS],[ae.DIALOG,v.DIALOG],[ae.DIR,v.DIR],[ae.DIV,v.DIV],[ae.DL,v.DL],[ae.DT,v.DT],[ae.EM,v.EM],[ae.EMBED,v.EMBED],[ae.FIELDSET,v.FIELDSET],[ae.FIGCAPTION,v.FIGCAPTION],[ae.FIGURE,v.FIGURE],[ae.FONT,v.FONT],[ae.FOOTER,v.FOOTER],[ae.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ae.FORM,v.FORM],[ae.FRAME,v.FRAME],[ae.FRAMESET,v.FRAMESET],[ae.H1,v.H1],[ae.H2,v.H2],[ae.H3,v.H3],[ae.H4,v.H4],[ae.H5,v.H5],[ae.H6,v.H6],[ae.HEAD,v.HEAD],[ae.HEADER,v.HEADER],[ae.HGROUP,v.HGROUP],[ae.HR,v.HR],[ae.HTML,v.HTML],[ae.I,v.I],[ae.IMG,v.IMG],[ae.IMAGE,v.IMAGE],[ae.INPUT,v.INPUT],[ae.IFRAME,v.IFRAME],[ae.KEYGEN,v.KEYGEN],[ae.LABEL,v.LABEL],[ae.LI,v.LI],[ae.LINK,v.LINK],[ae.LISTING,v.LISTING],[ae.MAIN,v.MAIN],[ae.MALIGNMARK,v.MALIGNMARK],[ae.MARQUEE,v.MARQUEE],[ae.MATH,v.MATH],[ae.MENU,v.MENU],[ae.META,v.META],[ae.MGLYPH,v.MGLYPH],[ae.MI,v.MI],[ae.MO,v.MO],[ae.MN,v.MN],[ae.MS,v.MS],[ae.MTEXT,v.MTEXT],[ae.NAV,v.NAV],[ae.NOBR,v.NOBR],[ae.NOFRAMES,v.NOFRAMES],[ae.NOEMBED,v.NOEMBED],[ae.NOSCRIPT,v.NOSCRIPT],[ae.OBJECT,v.OBJECT],[ae.OL,v.OL],[ae.OPTGROUP,v.OPTGROUP],[ae.OPTION,v.OPTION],[ae.P,v.P],[ae.PARAM,v.PARAM],[ae.PLAINTEXT,v.PLAINTEXT],[ae.PRE,v.PRE],[ae.RB,v.RB],[ae.RP,v.RP],[ae.RT,v.RT],[ae.RTC,v.RTC],[ae.RUBY,v.RUBY],[ae.S,v.S],[ae.SCRIPT,v.SCRIPT],[ae.SEARCH,v.SEARCH],[ae.SECTION,v.SECTION],[ae.SELECT,v.SELECT],[ae.SOURCE,v.SOURCE],[ae.SMALL,v.SMALL],[ae.SPAN,v.SPAN],[ae.STRIKE,v.STRIKE],[ae.STRONG,v.STRONG],[ae.STYLE,v.STYLE],[ae.SUB,v.SUB],[ae.SUMMARY,v.SUMMARY],[ae.SUP,v.SUP],[ae.TABLE,v.TABLE],[ae.TBODY,v.TBODY],[ae.TEMPLATE,v.TEMPLATE],[ae.TEXTAREA,v.TEXTAREA],[ae.TFOOT,v.TFOOT],[ae.TD,v.TD],[ae.TH,v.TH],[ae.THEAD,v.THEAD],[ae.TITLE,v.TITLE],[ae.TR,v.TR],[ae.TRACK,v.TRACK],[ae.TT,v.TT],[ae.U,v.U],[ae.UL,v.UL],[ae.SVG,v.SVG],[ae.VAR,v.VAR],[ae.WBR,v.WBR],[ae.XMP,v.XMP]]);function wu(e){var t;return(t=lne.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ne=v,cne={[we.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[we.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[we.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[we.XLINK]:new Set,[we.XML]:new Set,[we.XMLNS]:new Set},nx=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var Y;(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"})(Y||(Y={}));const Un={DATA:Y.DATA,RCDATA:Y.RCDATA,RAWTEXT:Y.RAWTEXT,SCRIPT_DATA:Y.SCRIPT_DATA,PLAINTEXT:Y.PLAINTEXT,CDATA_SECTION:Y.CDATA_SECTION};function une(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function Ed(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function dne(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function ja(e){return dne(e)||Ed(e)}function G2(e){return ja(e)||une(e)}function _p(e){return e+32}function UD(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function q2(e){return UD(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function fne(e){return e===H.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:DD(e)?he.surrogateCharacterReference:BD(e)?he.noncharacterCharacterReference:PD(e)||e===H.CARRIAGE_RETURN?he.controlCharacterReference:null}class hne{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=Y.DATA,this.returnState=Y.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Zte(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new ane(Jte,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=fne(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(he.endTagWithAttributes),t.selfClosing&&this._err(he.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 Tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Tt.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:Tt.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=UD(t)?Tt.WHITESPACE_CHARACTER:t===H.NULL?Tt.NULL_CHARACTER:Tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Y.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ta.Attribute:ta.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Y.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Y.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Y.DATA:{this._stateData(t);break}case Y.RCDATA:{this._stateRcdata(t);break}case Y.RAWTEXT:{this._stateRawtext(t);break}case Y.SCRIPT_DATA:{this._stateScriptData(t);break}case Y.PLAINTEXT:{this._statePlaintext(t);break}case Y.TAG_OPEN:{this._stateTagOpen(t);break}case Y.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Y.TAG_NAME:{this._stateTagName(t);break}case Y.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Y.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Y.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Y.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Y.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Y.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Y.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Y.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Y.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Y.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Y.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Y.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Y.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Y.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Y.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Y.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Y.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Y.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Y.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Y.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Y.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Y.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Y.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Y.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Y.COMMENT_START:{this._stateCommentStart(t);break}case Y.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Y.COMMENT:{this._stateComment(t);break}case Y.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Y.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Y.COMMENT_END:{this._stateCommentEnd(t);break}case Y.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Y.DOCTYPE:{this._stateDoctype(t);break}case Y.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Y.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Y.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Y.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Y.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Y.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Y.CDATA_SECTION:{this._stateCdataSection(t);break}case Y.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Y.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Y.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Y.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(he.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=Y.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ja(t))this._createStartTagToken(),this.state=Y.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=Y.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=Y.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Y.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Y.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ja(t))this._createEndTagToken(),this.state=Y.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=Y.DATA;break}case H.EOF:{this._err(he.eofBeforeTagName),this._emitChars("");break}case H.NULL:{this._err(he.unexpectedNullCharacter),this.state=Y.SCRIPT_DATA_ESCAPED,this._emitChars(yn);break}case H.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ja(t)?(this._emitChars("<"),this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ja(t)?(this.state=Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case H.NULL:{this._err(he.unexpectedNullCharacter),this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(yn);break}case H.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.SOLIDUS?(this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Yr.SCRIPT,!1)&&q2(this.preprocessor.peek(Yr.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(bne,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(yne,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(gne,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(Z2.has(s))return!1;break}case we.MATHML:{if(Q2.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,hg)}hasInListItemScope(t){return this.hasInDynamicScope(t,pne)}hasInButtonScope(t){return this.hasInDynamicScope(t,mne)}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(nx.has(n))return!0;if(hg.has(n))return!1;break}case we.SVG:{if(Z2.has(n))return!1;break}case we.MATHML:{if(Q2.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&&$D.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&X2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&X2.has(this.currentTagId);)this.pop()}}const _b=3;var Ci;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ci||(Ci={}));const J2={type:Ci.Marker};class wne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=_b&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(J2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ci.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ci.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(J2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ci.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ci.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ci.Element&&n.element===t)}}const Da={createDocument(){return{nodeName:"#document",mode:Os.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};Da.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(Da.isTextNode(n)){n.value+=t;return}}Da.appendChild(e,Da.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Da.isTextNode(r)?r.value+=t:Da.insertBefore(e,Da.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Tne(e){return e.name===HD&&e.publicId===null&&(e.systemId===null||e.systemId===vne)}function Ane(e){if(e.name!==HD)return Os.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===_ne)return Os.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Nne.has(n))return Os.QUIRKS;let r=t===null?kne:zD;if(eA(n,r))return Os.QUIRKS;if(r=t===null?VD:Sne,eA(n,r))return Os.LIMITED_QUIRKS}return Os.NO_QUIRKS}const tA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Cne="definitionurl",Ine="definitionURL",Rne=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])),One=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}]]),Lne=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])),Mne=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 jne(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Qo.COLOR||r===Qo.SIZE||r===Qo.FACE)||Mne.has(t)}function KD(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=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=Un.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)===ae.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=Un.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Un.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Un.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Un.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(l=>this.treeAdapter.isDocumentTypeNode(l));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(ae.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===Tt.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)===ae.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 Tt.CHARACTER:{this.onCharacter(t);break}case Tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Tt.COMMENT:{this.onComment(t);break}case Tt.DOCTYPE:{this.onDoctype(t);break}case Tt.START_TAG:{this._processStartTag(t);break}case Tt.END_TAG:{this.onEndTag(t);break}case Tt.EOF:{this.onEof(t);break}case Tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Fne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ci.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(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=Z.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Z.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Z.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Z.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Z.IN_TABLE;return}case v.BODY:{this.insertionMode=Z.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Z.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?Z.AFTER_HEAD:Z.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Z.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Z.IN_HEAD;return}break}}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(t){return WD.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 cne[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ese(this,t);return}switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:{qD(this,t);break}case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_TABLE_TEXT:{tP(this,t);break}case Z.IN_COLUMN_GROUP:{pg(this,t);break}case Z.AFTER_BODY:{mg(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bse(this,t);return}switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.TEXT:{this._insertCharacters(t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_COLUMN_GROUP:{pg(this,t);break}case Z.AFTER_BODY:{mg(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){rx(this,t);return}switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:{rx(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.AFTER_BODY:{Xne(this,t);break}case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{Qne(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:{Zne(this,t);break}case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?xse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Jne(this,t);break}case Z.BEFORE_HEAD:{tre(this,t);break}case Z.IN_HEAD:{Ei(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{sre(this,t);break}case Z.AFTER_HEAD:{are(this,t);break}case Z.IN_BODY:{Tr(this,t);break}case Z.IN_TABLE:{Zc(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_CAPTION:{nse(this,t);break}case Z.IN_COLUMN_GROUP:{c_(this,t);break}case Z.IN_TABLE_BODY:{T0(this,t);break}case Z.IN_ROW:{A0(this,t);break}case Z.IN_CELL:{ise(this,t);break}case Z.IN_SELECT:{sP(this,t);break}case Z.IN_SELECT_IN_TABLE:{ose(this,t);break}case Z.IN_TEMPLATE:{cse(this,t);break}case Z.AFTER_BODY:{dse(this,t);break}case Z.IN_FRAMESET:{fse(this,t);break}case Z.AFTER_FRAMESET:{pse(this,t);break}case Z.AFTER_AFTER_BODY:{gse(this,t);break}case Z.AFTER_AFTER_FRAMESET:{yse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?wse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{ere(this,t);break}case Z.BEFORE_HEAD:{nre(this,t);break}case Z.IN_HEAD:{rre(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{ire(this,t);break}case Z.AFTER_HEAD:{ore(this,t);break}case Z.IN_BODY:{S0(this,t);break}case Z.TEXT:{Yre(this,t);break}case Z.IN_TABLE:{Mf(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_CAPTION:{rse(this,t);break}case Z.IN_COLUMN_GROUP:{sse(this,t);break}case Z.IN_TABLE_BODY:{sx(this,t);break}case Z.IN_ROW:{rP(this,t);break}case Z.IN_CELL:{ase(this,t);break}case Z.IN_SELECT:{iP(this,t);break}case Z.IN_SELECT_IN_TABLE:{lse(this,t);break}case Z.IN_TEMPLATE:{use(this,t);break}case Z.AFTER_BODY:{oP(this,t);break}case Z.IN_FRAMESET:{hse(this,t);break}case Z.AFTER_FRAMESET:{mse(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onEof(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:{JD(this,t);break}case Z.TEXT:{Wre(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_TEMPLATE:{aP(this,t);break}case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{l_(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 Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:{this._insertCharacters(t);break}case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{GD(this,t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_TABLE_TEXT:{eP(this,t);break}}}};function Vne(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):ZD(e,t),n}function Kne(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 Yne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Hne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Wne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Wne(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 Gne(e,t,n){const r=e.treeAdapter.getTagName(t),s=wu(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 qne(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 o_(e,t){for(let n=0;n<$ne;n++){const r=Vne(e,t);if(!r)break;const s=Kne(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=Yne(e,s,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),a&&Gne(e,a,i),qne(e,s,r)}}function rx(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Xne(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Qne(e,t){e._appendCommentNode(t,e.document)}function l_(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=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 Zne(e,t){e._setDocumentType(t);const n=t.forceQuirks?Os.QUIRKS:Ane(t);Tne(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function td(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Os.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function Jne(e,t){t.tagID===v.HTML?(e._insertElement(t,we.HTML),e.insertionMode=Z.BEFORE_HEAD):Kd(e,t)}function ere(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Kd(e,t)}function Kd(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function tre(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.HEAD:{e._insertElement(t,we.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break}default:Yd(e,t)}}function nre(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Yd(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function Yd(e,t){e._insertFakeElement(ae.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function Ei(e,t){switch(t.tagID){case v.HTML:{Tr(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,Un.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Un.RAWTEXT):(e._insertElement(t,we.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Un.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Un.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Wd(e,t)}}function rre(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Wd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function wl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Wd(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function sre(e,t){switch(t.tagID){case v.HTML:{Tr(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,he.nestedNoscriptInHead);break}default:Gd(e,t)}}function ire(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break}case v.BR:{Gd(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Gd(e,t){const n=t.type===Tt.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function are(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.BODY:{e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,we.HTML),e.insertionMode=Z.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,he.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),Ei(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:qd(e,t)}}function ore(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{qd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function qd(e,t){e._insertFakeElement(ae.BODY,v.BODY),e.insertionMode=Z.IN_BODY,N0(e,t)}function N0(e,t){switch(t.type){case Tt.CHARACTER:{qD(e,t);break}case Tt.WHITESPACE_CHARACTER:{GD(e,t);break}case Tt.COMMENT:{rx(e,t);break}case Tt.START_TAG:{Tr(e,t);break}case Tt.END_TAG:{S0(e,t);break}case Tt.EOF:{JD(e,t);break}}}function GD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function qD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function lre(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function cre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function ure(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_FRAMESET)}function dre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function fre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&nx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function hre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function pre(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 mre(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 gre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Un.PLAINTEXT}function yre(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 bre(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);n&&(o_(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 Ere(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(o_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function wre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function vre(e,t){e.treeAdapter.getDocumentMode(e.document)!==Os.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function XD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function QD(e){const t=FD(e,Qo.TYPE);return t!=null&&t.toLowerCase()===Une}function _re(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),QD(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function kre(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function Nre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sre(e,t){t.tagName=ae.IMG,t.tagID=v.IMG,XD(e,t)}function Tre(e,t){e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Un.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function Are(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function Cre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function sA(e,t){e._switchToTextParsing(t,Un.RAWTEXT)}function Ire(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function Rre(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function Ore(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function Lre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,we.HTML)}function Mre(e,t){e._reconstructActiveFormattingElements(),KD(t),a_(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function jre(e,t){e._reconstructActiveFormattingElements(),YD(t),a_(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function iA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function Tr(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:{Ere(e,t);break}case v.A:{bre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{fre(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:{dre(e,t);break}case v.LI:case v.DD:case v.DT:{mre(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{XD(e,t);break}case v.HR:{Nre(e,t);break}case v.RB:case v.RTC:{Ore(e,t);break}case v.RT:case v.RP:{Lre(e,t);break}case v.PRE:case v.LISTING:{hre(e,t);break}case v.XMP:{Are(e,t);break}case v.SVG:{jre(e,t);break}case v.HTML:{lre(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:{cre(e,t);break}case v.FORM:{pre(e,t);break}case v.NOBR:{xre(e,t);break}case v.MATH:{Mre(e,t);break}case v.TABLE:{vre(e,t);break}case v.INPUT:{_re(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{kre(e,t);break}case v.IMAGE:{Sre(e,t);break}case v.BUTTON:{yre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{wre(e,t);break}case v.IFRAME:{Cre(e,t);break}case v.SELECT:{Ire(e,t);break}case v.OPTION:case v.OPTGROUP:{Rre(e,t);break}case v.NOEMBED:case v.NOFRAMES:{sA(e,t);break}case v.FRAMESET:{ure(e,t);break}case v.TEXTAREA:{Tre(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?sA(e,t):iA(e,t);break}case v.PLAINTEXT:{gre(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:iA(e,t)}}function Dre(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Pre(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Z.AFTER_BODY,oP(e,t))}function Bre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Fre(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 Ure(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ae.P,v.P),e._closePElement()}function $re(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Hre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function zre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Vre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Kre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function ZD(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 S0(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:{o_(e,t);break}case v.P:{Ure(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:{Bre(e,t);break}case v.LI:{$re(e);break}case v.DD:case v.DT:{Hre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{zre(e);break}case v.BR:{Kre(e);break}case v.BODY:{Dre(e,t);break}case v.HTML:{Pre(e,t);break}case v.FORM:{Fre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Vre(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:ZD(e,t)}}function JD(e,t){e.tmplInsertionModeStack.length>0?aP(e,t):l_(e,t)}function Yre(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 Wre(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function kb(e,t){if(e.openElements.currentTagId!==void 0&&WD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case Tt.CHARACTER:{tP(e,t);break}case Tt.WHITESPACE_CHARACTER:{eP(e,t);break}}else fh(e,t)}function Gre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_CAPTION}function qre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function Xre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,v.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,c_(e,t)}function Qre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_TABLE_BODY}function Zre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,v.TBODY),e.insertionMode=Z.IN_TABLE_BODY,T0(e,t)}function Jre(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ese(e,t){QD(t)?e._appendElement(t,we.HTML):fh(e,t),t.ackSelfClosing=!0}function tse(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,we.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Zc(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{Zre(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{Ei(e,t);break}case v.COL:{Xre(e,t);break}case v.FORM:{tse(e,t);break}case v.TABLE:{Jre(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{Qre(e,t);break}case v.INPUT:{ese(e,t);break}case v.CAPTION:{Gre(e,t);break}case v.COLGROUP:{qre(e,t);break}default:fh(e,t)}}function Mf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{wl(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:fh(e,t)}}function fh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,N0(e,t),e.fosterParentingEnabled=n}function eP(e,t){e.pendingCharacterTokens.push(t)}function tP(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function nd(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:{wl(e,t);break}}}function ose(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)):sP(e,t)}function lse(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)):iP(e,t)}function cse(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]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,Zc(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,c_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,T0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,A0(e,t);break}default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,Tr(e,t)}}function use(e,t){t.tagID===v.TEMPLATE&&wl(e,t)}function aP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):l_(e,t)}function dse(e,t){t.tagID===v.HTML?Tr(e,t):mg(e,t)}function oP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Z.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 mg(e,t)}function mg(e,t){e.insertionMode=Z.IN_BODY,N0(e,t)}function fse(e,t){switch(t.tagID){case v.HTML:{Tr(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 hse(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function pse(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.NOFRAMES:{Ei(e,t);break}}}function mse(e,t){t.tagID===v.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function gse(e,t){t.tagID===v.HTML?Tr(e,t):dm(e,t)}function dm(e,t){e.insertionMode=Z.IN_BODY,N0(e,t)}function yse(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.NOFRAMES:{Ei(e,t);break}}}function bse(e,t){t.chars=yn,e._insertCharacters(t)}function Ese(e,t){e._insertCharacters(t),e.framesetOk=!1}function lP(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 xse(e,t){if(jne(t))lP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===we.MATHML?KD(t):r===we.SVG&&(Dne(t),YD(t)),a_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function wse(e,t){if(t.tagID===v.P||t.tagID===v.BR){lP(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}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const vse=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_se=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),aA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function cP(e,t){const n=Lse(e),r=k3("type",{handlers:{root:kse,element:Nse,text:Sse,comment:dP,doctype:Tse,raw:Cse},unknown:Ise}),s={parser:n?new rA(aA):rA.getFragmentParser(void 0,aA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),vu(s,$i());const i=n?s.parser.document:s.parser.getFragment(),a=Mte(i,{file:s.options.file});return s.stitches&&uh(a,"comment",function(l,c,u){const d=l;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 uP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Tt.CHARACTER,chars:e.value,location:hh(e)};vu(t,$i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Tse(e,t){const n={type:Tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:hh(e)};vu(t,$i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ase(e,t){t.stitches=!0;const n=Mse(e);if("children"in e&&"children"in n){const r=cP({type:"root",children:e.children},t.options);n.children=r.children}dP({type:"comment",value:{stitch:n}},t)}function dP(e,t){const n=e.value,r={type:Tt.COMMENT,data:n,location:hh(e)};vu(t,$i(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Cse(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,fP(t,$i(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(vse,"<$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 Ise(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ase(n,t);else{let r="";throw _se.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 vu(e,t){fP(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=Un.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 fP(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 Rse(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Un.PLAINTEXT)return;vu(t,$i(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ho.html;s===Ho.html&&n==="svg"&&(s=Ho.svg);const i=Fte({...e,children:[]},{space:s===Ho.svg?"svg":"html"}),a={type:Tt.START_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:hh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ose(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Wte.includes(n)||t.parser.tokenizer.state===Un.PLAINTEXT)return;vu(t,E0(e));const r={type:Tt.END_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:hh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Un.RCDATA||t.parser.tokenizer.state===Un.RAWTEXT||t.parser.tokenizer.state===Un.SCRIPT_DATA)&&(t.parser.tokenizer.state=Un.DATA)}function Lse(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function hh(e){const t=$i(e)||{line:void 0,column:void 0,offset:void 0},n=E0(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 Mse(e){return"children"in e?Xc({...e,children:[]}):Xc(e)}function jse(e){return function(t,n){return cP(t,{...e,file:n})}}const hP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function pP(e){if(!e)return!1;try{const t=e.toLowerCase();return hP.some(n=>t.includes(n))}catch{return!1}}function Dse(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(pP(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 hP.some(i=>s.includes(i))}return!1}function Pse({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(UX,{remarkPlugins:[JZ],rehypePlugins:n?[jse,z2]:[z2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(pP(d)||Dse(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(xM,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(u0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(pr,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const ph=E.memo(Pse),oA=6,lA=7,Bse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ix(e){return Bse[(e||"").trim().toLowerCase()]||"未知"}function cA(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 Fse(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 Use(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 $se({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Hse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function uA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 ax(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function dA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(uA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(uA,{direction:"right"})})]})]})}function fm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function zse({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx($se,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Hse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ix(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(ax,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(ph,{text:Use(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(fm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function Vse(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,T]=E.useState(""),[S,R]=E.useState(null),[I,D]=E.useState(null),[U,W]=E.useState(!1),[M,$]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let z=!0;return u(!0),f(""),WK({region:e,page:s,pageSize:oA}).then(G=>{if(!z)return;const B=G.items||[];r(B),l(G.totalCount||0),p(re=>B.find(Q=>Q.id===(re==null?void 0:re.id))||null)}).catch(G=>{z&&(r([]),l(0),p(null),f(G instanceof Error?G.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{z&&u(!1)}),()=>{z=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let z=!0;return k(!0),T(""),GK(h.id,{region:e,page:w,pageSize:lA,project:h.projectName}).then(G=>{z&&(g(G.items||[]),x(G.totalCount||0))}).catch(G=>{z&&(g([]),x(0),T(G instanceof Error?G.message:"读取技能失败,请稍后重试"))}).finally(()=>{z&&k(!1)}),()=>{z=!1}},[e,h,w]);const j=z=>{z!==e&&(P(),t(z),i(1),y(1),p(null),g([]))},L=z=>{P(),p(z),y(1)},P=()=>{C.current+=1,R(null),D(null),$(""),W(!1)},A=async z=>{if(!h)return;const G=C.current+1;C.current=G,R(z),D(null),$(""),W(!0);try{const B=await qK(h.id,z.skillId,z.version,e,h.projectName);C.current===G&&D(B)}catch(B){C.current===G&&$(B instanceof Error?B.message:"读取技能详情失败,请稍后重试")}finally{C.current===G&&W(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>j("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>j("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(fm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(z=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===z.id?"active":""}`,onClick:()=>L(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.name,children:z.name}),o.jsx("span",{className:"skillcenter-item-description",children:z.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${cA(z.status)}`,children:ix(z.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:z.projectName||"default",children:["Project · ",z.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[z.skillCount??0," 个技能"]}),z.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",Fse(z.updatedAt)]})]})]})},`${z.projectName||"default"}:${z.id}`))})]}),o.jsx(dA,{page:s,total:a,pageSize:oA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(fm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(z=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void A(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.skillName,children:z.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:z.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${cA(z.skillStatus)}`,children:ix(z.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",z.version||"—"]})]})]})},`${z.skillId}:${z.version}`))})]}),o.jsx(dA,{page:w,total:b,pageSize:lA,onPage:y})]}):o.jsx(fm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(zse,{skill:S,space:h,region:e,detail:I,loading:U,error:M,onClose:P})]})}function Kse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await vj(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(ro(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx(Ft,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function Zn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function C0(){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}})}hm.prototype=C0.prototype={constructor:hm,on:function(e,t){var n=this._,r=Wse(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)),hA.hasOwnProperty(t)?{space:hA[t],local:e}:e}function qse(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ox&&t.documentElement.namespaceURI===ox?t.createElement(e):t.createElementNS(n,e)}}function Xse(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mP(e){var t=I0(e);return(t.local?Xse:qse)(t)}function Qse(){}function u_(e){return e==null?Qse:function(){return this.querySelector(e)}}function Zse(e){typeof e!="function"&&(e=u_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function _ie(e){e||(e=kie);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 Nie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sie(){return Array.from(this)}function Tie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Bie:typeof t=="function"?Uie:Fie)(e,t,n??"")):Jc(this.node(),e)}function Jc(e,t){return e.style.getPropertyValue(t)||xP(e).getComputedStyle(e,null).getPropertyValue(t)}function Hie(e){return function(){delete this[e]}}function zie(e,t){return function(){this[e]=t}}function Vie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kie(e,t){return arguments.length>1?this.each((t==null?Hie:typeof t=="function"?Vie:zie)(e,t)):this.node()[e]}function wP(e){return e.trim().split(/^|\s+/)}function d_(e){return e.classList||new vP(e)}function vP(e){this._node=e,this._names=wP(e.getAttribute("class")||"")}vP.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 _P(e,t){for(var n=d_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Eae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function lx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}lx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Cae(e){return!e.ctrlKey&&!e.button}function Iae(){return this.parentNode}function Rae(e,t){return t??{x:e.x,y:e.y}}function Oae(){return navigator.maxTouchPoints||"ontouchstart"in this}function CP(){var e=Cae,t=Iae,n=Rae,r=Oae,s={},i=C0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Aae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(ls(_.view).on("mousemove.drag",m,jf).on("mouseup.drag",g,jf),TP(_.view),Nb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Sc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){ls(_.view).on("mousemove.drag mouseup.drag",null),AP(_.view,u),Sc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,T=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Np(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Np(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=Mae.exec(e))?new Xr(t[1],t[2],t[3],1):(t=jae.exec(e))?new Xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dae.exec(e))?Np(t[1],t[2],t[3],t[4]):(t=Pae.exec(e))?Np(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Bae.exec(e))?xA(t[1],t[2]/100,t[3]/100,1):(t=Fae.exec(e))?xA(t[1],t[2]/100,t[3]/100,t[4]):pA.hasOwnProperty(e)?yA(pA[e]):e==="transparent"?new Xr(NaN,NaN,NaN,0):null}function yA(e){return new Xr(e>>16&255,e>>8&255,e&255,1)}function Np(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xr(e,t,n,r)}function Hae(e){return e instanceof gh||(e=cl(e)),e?(e=e.rgb(),new Xr(e.r,e.g,e.b,e.opacity)):new Xr}function cx(e,t,n,r){return arguments.length===1?Hae(e):new Xr(e,t,n,r??1)}function Xr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}f_(Xr,cx,IP(gh,{brighter(e){return e=e==null?yg:Math.pow(yg,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xr(Zo(this.r),Zo(this.g),Zo(this.b),bg(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:bA,formatHex:bA,formatHex8:zae,formatRgb:EA,toString:EA}));function bA(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}`}function zae(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}${zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function EA(){const e=bg(this.opacity);return`${e===1?"rgb(":"rgba("}${Zo(this.r)}, ${Zo(this.g)}, ${Zo(this.b)}${e===1?")":`, ${e})`}`}function bg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zo(e){return e=Zo(e),(e<16?"0":"")+e.toString(16)}function xA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new li(e,t,n,r)}function RP(e){if(e instanceof li)return new li(e.h,e.s,e.l,e.opacity);if(e instanceof gh||(e=cl(e)),!e)return new li;if(e instanceof li)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new li(a,l,c,e.opacity)}function Vae(e,t,n,r){return arguments.length===1?RP(e):new li(e,t,n,r??1)}function li(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}f_(li,Vae,IP(gh,{brighter(e){return e=e==null?yg:Math.pow(yg,e),new li(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new li(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 Xr(Sb(e>=240?e-240:e+120,s,r),Sb(e,s,r),Sb(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new li(wA(this.h),Sp(this.s),Sp(this.l),bg(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=bg(this.opacity);return`${e===1?"hsl(":"hsla("}${wA(this.h)}, ${Sp(this.s)*100}%, ${Sp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wA(e){return e=(e||0)%360,e<0?e+360:e}function Sp(e){return Math.max(0,Math.min(1,e||0))}function Sb(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 h_=e=>()=>e;function Kae(e,t){return function(n){return e+n*t}}function Yae(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 Wae(e){return(e=+e)==1?OP:function(t,n){return n-t?Yae(t,n,e):h_(isNaN(t)?n:t)}}function OP(e,t){var n=t-e;return n?Kae(e,n):h_(isNaN(e)?t:e)}const Eg=function e(t){var n=Wae(t);function r(s,i){var a=n((s=cx(s)).r,(i=cx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=OP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Gae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:Ii(r,s)})),n=Tb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Ii(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Ii(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:Ii(u,f)},{i:g-2,x:Ii(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--eu}function kA(){ul=(wg=Bf.now())+R0,eu=xd=0;try{coe()}finally{eu=0,doe(),ul=0}}function uoe(){var e=Bf.now(),t=e-wg;t>DP&&(R0-=t,wg=e)}function doe(){for(var e,t=xg,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:xg=n);wd=e,fx(r)}function fx(e){if(!eu){xd&&(xd=clearTimeout(xd));var t=e-ul;t>24?(e<1/0&&(xd=setTimeout(kA,e-Bf.now()-R0)),rd&&(rd=clearInterval(rd))):(rd||(wg=Bf.now(),rd=setInterval(uoe,DP)),eu=1,PP(kA))}}function NA(e,t,n){var r=new vg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var foe=C0("start","end","cancel","interrupt"),hoe=[],FP=0,SA=1,hx=2,mm=3,TA=4,px=5,gm=6;function O0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;poe(e,n,{name:t,index:r,group:s,on:foe,tween:hoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:FP})}function m_(e,t){var n=xi(e,t);if(n.state>FP)throw new Error("too late; already scheduled");return n}function zi(e,t){var n=xi(e,t);if(n.state>mm)throw new Error("too late; already running");return n}function xi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function poe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=BP(i,0,n.time);function i(u){n.state=SA,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!==SA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===mm)return NA(a);p.state===TA?(p.state=gm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dhx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Voe(e,t,n){var r,s,i=zoe(t)?m_:zi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function Koe(e,t){var n=this._id;return arguments.length<2?xi(this.node(),n).on.on(e):this.each(Voe(n,e,t))}function Yoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Woe(){return this.on("end.remove",Yoe(this._id))}function Goe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=u_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Ele(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 sa(e,t,n){this.k=e,this.x=t,this.y=n}sa.prototype={constructor:sa,scale:function(e){return e===1?this:new sa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sa(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 L0=new sa(1,0,0);zP.prototype=sa.prototype;function zP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return L0;return e.__zoom}function Ab(e){e.stopImmediatePropagation()}function sd(e){e.preventDefault(),e.stopImmediatePropagation()}function xle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wle(){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 AA(){return this.__zoom||L0}function vle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _le(){return navigator.maxTouchPoints||"ontouchstart"in this}function kle(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 VP(){var e=xle,t=wle,n=kle,r=vle,s=_le,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=pm,u=C0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(M){M.property("__zoom",AA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",D).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,$,C,j){var L=M.selection?M.selection():M;L.property("__zoom",AA),M!==L?k(M,$,C,j):L.interrupt().each(function(){N(this,arguments).event(j).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},y.scaleBy=function(M,$,C,j){y.scaleTo(M,function(){var L=this.__zoom.k,P=typeof $=="function"?$.apply(this,arguments):$;return L*P},C,j)},y.scaleTo=function(M,$,C,j){y.transform(M,function(){var L=t.apply(this,arguments),P=this.__zoom,A=C==null?_(L):typeof C=="function"?C.apply(this,arguments):C,z=P.invert(A),G=typeof $=="function"?$.apply(this,arguments):$;return n(x(b(P,G),A,z),L,a)},C,j)},y.translateBy=function(M,$,C,j){y.transform(M,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,j)},y.translateTo=function(M,$,C,j,L){y.transform(M,function(){var P=t.apply(this,arguments),A=this.__zoom,z=j==null?_(P):typeof j=="function"?j.apply(this,arguments):j;return n(L0.translate(z[0],z[1]).scale(A.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof C=="function"?-C.apply(this,arguments):-C),P,a)},j,L)};function b(M,$){return $=Math.max(i[0],Math.min(i[1],$)),$===M.k?M:new sa($,M.x,M.y)}function x(M,$,C){var j=$[0]-C[0]*M.k,L=$[1]-C[1]*M.k;return j===M.x&&L===M.y?M:new sa(M.k,j,L)}function _(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function k(M,$,C,j){M.on("start.zoom",function(){N(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(j).end()}).tween("zoom",function(){var L=this,P=arguments,A=N(L,P).event(j),z=t.apply(L,P),G=C==null?_(z):typeof C=="function"?C.apply(L,P):C,B=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),re=L.__zoom,Q=typeof $=="function"?$.apply(L,P):$,se=c(re.invert(G).concat(B/re.k),Q.invert(G).concat(B/Q.k));return function(de){if(de===1)de=Q;else{var te=se(de),pe=B/te[2];de=new sa(pe,G[0]-te[0]*pe,G[1]-te[1]*pe)}A.zoom(null,de)}})}function N(M,$,C){return!C&&M.__zooming||new T(M,$)}function T(M,$){this.that=M,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,$),this.taps=0}T.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,$){return this.mouse&&M!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var $=ls(this.that).datum();u.call(M,this.that,new Ele(M,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),$)}};function S(M,...$){if(!e.apply(this,arguments))return;var C=N(this,$).event(M),j=this.__zoom,L=Math.max(i[0],Math.min(i[1],j.k*Math.pow(2,r.apply(this,arguments)))),P=ii(M);if(C.wheel)(C.mouse[0][0]!==P[0]||C.mouse[0][1]!==P[1])&&(C.mouse[1]=j.invert(C.mouse[0]=P)),clearTimeout(C.wheel);else{if(j.k===L)return;C.mouse=[P,j.invert(P)],ym(this),C.start()}sd(M),C.wheel=setTimeout(A,m),C.zoom("mouse",n(x(b(j,L),C.mouse[0],C.mouse[1]),C.extent,a));function A(){C.wheel=null,C.end()}}function R(M,...$){if(h||!e.apply(this,arguments))return;var C=M.currentTarget,j=N(this,$,!0).event(M),L=ls(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",B,!0),P=ii(M,C),A=M.clientX,z=M.clientY;TP(M.view),Ab(M),j.mouse=[P,this.__zoom.invert(P)],ym(this),j.start();function G(re){if(sd(re),!j.moved){var Q=re.clientX-A,se=re.clientY-z;j.moved=Q*Q+se*se>g}j.event(re).zoom("mouse",n(x(j.that.__zoom,j.mouse[0]=ii(re,C),j.mouse[1]),j.extent,a))}function B(re){L.on("mousemove.zoom mouseup.zoom",null),AP(re.view,j.moved),sd(re),j.event(re).end()}}function I(M,...$){if(e.apply(this,arguments)){var C=this.__zoom,j=ii(M.changedTouches?M.changedTouches[0]:M,this),L=C.invert(j),P=C.k*(M.shiftKey?.5:2),A=n(x(b(C,P),j,L),t.apply(this,$),a);sd(M),l>0?ls(this).transition().duration(l).call(k,A,j,M):ls(this).call(y.transform,A,j,M)}}function D(M,...$){if(e.apply(this,arguments)){var C=M.touches,j=C.length,L=N(this,$,M.changedTouches.length===j).event(M),P,A,z,G;for(Ab(M),A=0;A`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.`},Ff=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],KP=["Enter"," ","Escape"],YP={"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 tu;(function(e){e.Strict="strict",e.Loose="loose"})(tu||(tu={}));var Jo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jo||(Jo={}));var Uf;(function(e){e.Partial="partial",e.Full="full"})(Uf||(Uf={}));const WP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var za;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(za||(za={}));var nu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nu||(nu={}));var Fe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Fe||(Fe={}));const CA={[Fe.Left]:Fe.Right,[Fe.Right]:Fe.Left,[Fe.Top]:Fe.Bottom,[Fe.Bottom]:Fe.Top};function GP(e){return e===null?null:e?"valid":"invalid"}const qP=e=>"id"in e&&"source"in e&&"target"in e,Nle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),y_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yh=(e,t=[0,0])=>{const{width:n,height:r}=Ea(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Sle=(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):y_(s)?s:t.nodeLookup.get(s.id));const l=a?_g(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return M0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return j0(n)},bh=(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=M0(n,_g(s)),r=!0)}),r?j0(n):{x:0,y:0,width:0,height:0}},b_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={..._u(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,g=$f(l,su(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},Tle=(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 Ale(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 Cle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Ale(e,a),c=bh(l),u=x_(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 XP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",bi.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&fl(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=fl(f)?dl(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",bi.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 Ile({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=Tle(a,c);for(const h of c)l.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 ru=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dl=(e={x:0,y:0},t,n)=>({x:ru(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ru(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function QP(e,t,n){const{width:r,height:s}=Ea(n),{x:i,y:a}=n.internals.positionAbsolute;return dl(e,[[i,a],[i+r,a+s]],t)}const IA=(e,t,n)=>en?-ru(Math.abs(e-n),1,t)/t:0,E_=(e,t,n=15,r=40)=>{const s=IA(e.x,r,t.width-r)*n,i=IA(e.y,r,t.height-r)*n;return[s,i]},M0=(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)}),mx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),j0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),su=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:yh(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}},_g=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:yh(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)}},ZP=(e,t)=>j0(M0(mx(e),mx(t))),$f=(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)},RA=e=>ui(e.width)&&ui(e.height)&&ui(e.x)&&ui(e.y),ui=e=>!isNaN(e)&&isFinite(e),JP=(e,t)=>(n,r)=>{},Eh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_u=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?Eh(l,a):l},iu=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function jl(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 Rle(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jl(e,n),s=jl(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=jl(e.top??e.y??0,n),s=jl(e.bottom??e.y??0,n),i=jl(e.left??e.x??0,t),a=jl(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 Ole(e,t,n,r,s,i){const{x:a,y:l}=iu(e,[t,n,r]),{x:c,y:u}=iu({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const x_=(e,t,n,r,s,i)=>{const a=Rle(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=ru(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,g=Ole(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Hf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fl(e){return e!=null&&e!=="parent"}function Ea(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 w_(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 e4(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function OA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Lle(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Mle(e){return{...YP,...e||{}}}function Qd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=di(e),l=_u({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?Eh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const v_=e=>({width:e.offsetWidth,height:e.offsetHeight}),t4=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jle=["INPUT","SELECT","TEXTAREA"];function n4(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:jle.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const r4=e=>"clientX"in e,di=(e,t)=>{var i,a;const n=r4(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)}},LA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...v_(a)}})};function s4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Cp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function MA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case Fe.Left:return[t-Cp(t-r,i),n];case Fe.Right:return[t+Cp(r-t,i),n];case Fe.Top:return[t,n-Cp(n-s,i)];case Fe.Bottom:return[t,n+Cp(s-n,i)]}}function i4({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top,curvature:a=.25}){const[l,c]=MA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=MA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=s4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function a4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const Ble=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Fle=(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)),Ule=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",bi.error006()),t;const r=n.getEdgeId||Ble;let s;return qP(e)?s={...e}:s={...e,id:r(e)},Fle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function o4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=a4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const jA={[Fe.Left]:{x:-1,y:0},[Fe.Right]:{x:1,y:0},[Fe.Top]:{x:0,y:-1},[Fe.Bottom]:{x:0,y:1}},$le=({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 Hle({source:e,sourcePosition:t=Fe.Bottom,target:n,targetPosition:r=Fe.Top,center:s,offset:i,stepPosition:a}){const l=jA[t],c=jA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=$le({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=a4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const M=Math.abs(e[h]-n[h]);if(M<=i){const $=Math.min(i-1,i-M);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*$:b[h]=(d[h]>n[h]?-1:1)*$}}if(t!==r){const M=h==="x"?"y":"x",$=l[h]===c[M],C=u[M]>d[M],j=u[M]=W?(g=(I.x+D.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+D.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function zle(e,t,n,r){const s=Math.min(DA(e,t)/2,DA(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 gx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Kle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=gx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const l4=1e3,Yle=10,__={nodeOrigin:[0,0],nodeExtent:Ff,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Wle={...__,checkEquality:!0};function k_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Gle(e,t,n){const r=k_(__,n);for(const s of e.values())if(s.parentId)S_(s,e,t,r);else{const i=yh(s,r.nodeOrigin),a=fl(s.extent)?s.extent:r.nodeExtent,l=dl(i,a,Ea(s));s.internals.positionAbsolute=l}}function qle(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 N_(e){return e==="manual"}function yx(e,t,n,r={}){var d,f;const s=k_(Wle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!N_(s.zIndexMode)?l4: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=yh(h,s.nodeOrigin),g=fl(h.extent)?h.extent:s.nodeExtent,w=dl(m,g,Ea(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:qle(h,p),z:c4(h,l,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&&S_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Xle(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 S_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=k_(__,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}Xle(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*Yle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!N_(c)?l4:0,{x:h,y:p,z:m}=Qle(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function c4(e,t,n){const r=ui(e.zIndex)?e.zIndex:0;return N_(n)?r:r+(e.selected?t:0)}function Qle(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=Ea(e),u=yh(e,n),d=fl(e.extent)?dl(u,e.extent,c):u;let f=dl({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=QP(f,c,t));const h=c4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function T_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??su(c),d=ZP(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Ea(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=T_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function Jle({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 UA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 u4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;UA("source",c,d,e,s,a),UA("target",c,u,e,i,l),t.set(r.id,r)}}function d4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:d4(n,t):!1}function $A(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 ece(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!d4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Cb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function tce({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=Eh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function nce({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:T=0}){h=ls(_);function S({x:U,y:W}){const{nodeLookup:M,nodeExtent:$,snapGrid:C,snapToGrid:j,nodeOrigin:L,onNodeDrag:P,onSelectionDrag:A,onError:z,updateNodePositions:G}=t();i={x:U,y:W};let B=!1;const re=l.size>1,Q=re&&$?mx(bh(l)):null,se=re&&j?tce({dragItems:l,snapGrid:C,x:U,y:W}):null;for(const[de,te]of l){if(!M.has(de))continue;let pe={x:U-te.distance.x,y:W-te.distance.y};j&&(pe=se?{x:Math.round(pe.x+se.x),y:Math.round(pe.y+se.y)}:Eh(pe,C));let ne=null;if(re&&$&&!te.extent&&Q){const{positionAbsolute:be}=te.internals,xe=be.x-Q.x+$[0][0],ke=be.x+te.measured.width-Q.x2+$[1][0],Ae=be.y-Q.y+$[0][1],He=be.y+te.measured.height-Q.y2+$[1][1];ne=[[xe,Ae],[ke,He]]}const{position:ye,positionAbsolute:ge}=XP({nodeId:de,nextPosition:pe,nodeLookup:M,nodeExtent:ne||$,nodeOrigin:L,onError:z});B=B||te.position.x!==ye.x||te.position.y!==ye.y,te.position=ye,te.internals.positionAbsolute=ge}if(m=m||B,!!B&&(G(l,!0),g&&(r||P||!N&&A))){const[de,te]=Cb({nodeId:N,dragItems:l,nodeLookup:M});r==null||r(g,l,de,te),P==null||P(g,de,te),N||A==null||A(g,te)}}async function R(){if(!d)return;const{transform:U,panBy:W,autoPanSpeed:M,autoPanOnNodeDrag:$}=t();if(!$){c=!1,cancelAnimationFrame(a);return}const[C,j]=E_(u,d,M);(C!==0||j!==0)&&(i.x=(i.x??0)-C/U[2],i.y=(i.y??0)-j/U[2],await W({x:C,y:j})&&S(i)),a=requestAnimationFrame(R)}function I(U){var re;const{nodeLookup:W,multiSelectionActive:M,nodesDraggable:$,transform:C,snapGrid:j,snapToGrid:L,selectNodesOnDrag:P,onNodeDragStart:A,onSelectionDragStart:z,unselectNodesAndEdges:G}=t();f=!0,(!P||!k)&&!M&&N&&((re=W.get(N))!=null&&re.selected||G()),k&&P&&N&&(e==null||e(N));const B=Qd(U.sourceEvent,{transform:C,snapGrid:j,snapToGrid:L,containerBounds:d});if(i=B,l=ece(W,$,B,N),l.size>0&&(n||A||!N&&z)){const[Q,se]=Cb({nodeId:N,dragItems:l,nodeLookup:W});n==null||n(U.sourceEvent,l,Q,se),A==null||A(U.sourceEvent,Q,se),N||z==null||z(U.sourceEvent,se)}}const D=CP().clickDistance(T).on("start",U=>{const{domNode:W,nodeDragThreshold:M,transform:$,snapGrid:C,snapToGrid:j}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,p=!1,m=!1,g=U.sourceEvent,M===0&&I(U),i=Qd(U.sourceEvent,{transform:$,snapGrid:C,snapToGrid:j,containerBounds:d}),u=di(U.sourceEvent,d)}).on("drag",U=>{const{autoPanOnNodeDrag:W,transform:M,snapGrid:$,snapToGrid:C,nodeDragThreshold:j,nodeLookup:L}=t(),P=Qd(U.sourceEvent,{transform:M,snapGrid:$,snapToGrid:C,containerBounds:d});if(g=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||N&&!L.has(N))&&(p=!0),!p){if(!c&&W&&f&&(c=!0,R()),!f){const A=di(U.sourceEvent,d),z=A.x-u.x,G=A.y-u.y;Math.sqrt(z*z+G*G)>j&&I(U)}(i.x!==P.xSnapped||i.y!==P.ySnapped)&&l&&f&&(u=di(U.sourceEvent,d),S(P))}}).on("end",U=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:W,updateNodePositions:M,onNodeDragStop:$,onSelectionDragStop:C}=t();if(m&&(M(l,!1),m=!1),s||$||!N&&C){const[j,L]=Cb({nodeId:N,dragItems:l,nodeLookup:W,dragging:!1});s==null||s(U.sourceEvent,l,j,L),$==null||$(U.sourceEvent,j,L),N||C==null||C(U.sourceEvent,L)}}}).filter(U=>{const W=U.target;return!U.button&&(!b||!$A(W,`.${b}`,_))&&(!x||$A(W,x,_))});h.call(D)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function rce(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())$f(s,su(i))>0&&r.push(i);return r}const sce=250;function ice(e,t,n,r){var l,c;let s=[],i=1/0;const a=rce(e,n,t+sce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=hl(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 f4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...hl(a,c,c.position,!0)}:c}function h4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ace(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const p4=()=>!0;function oce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=p4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:S}){const R=t4(e.target);let I=0,D;const{x:U,y:W}=di(e),M=h4(i,S),$=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!$||!M)return;const j=f4(s,M,r,c,t);if(!j)return;let L=di(e,$),P=!1,A=null,z=!1,G=null;function B(){if(!d||!$)return;const[ye,ge]=E_(L,$,N);h({x:ye,y:ge}),I=requestAnimationFrame(B)}const re={...j,nodeId:s,type:M,position:j.position},Q=c.get(s);let de={inProgress:!0,isValid:null,from:hl(Q,re,Fe.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:Q,to:L,toHandle:null,toPosition:CA[re.position],toNode:null,pointer:L};function te(){C=!0,x(de),m==null||m(e,{nodeId:s,handleId:r,handleType:M})}T===0&&te();function pe(ye){if(!C){const{x:He,y:Ce}=di(ye),gt=He-U,Ge=Ce-W;if(!(gt*gt+Ge*Ge>T*T))return;te()}if(!k()||!re){ne(ye);return}const ge=_();L=di(ye,$),D=ice(_u(L,ge,!1,[1,1]),n,c,re),P||(B(),P=!0);const be=m4(ye,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});G=be.handleDomNode,A=be.connection,z=ace(!!D,be.isValid);const xe=c.get(s),ke=xe?hl(xe,re,Fe.Left,!0):de.from,Ae={...de,from:ke,isValid:z,to:be.toHandle&&z?iu({x:be.toHandle.x,y:be.toHandle.y},ge):L,toHandle:be.toHandle,toPosition:z&&be.toHandle?be.toHandle.position:CA[re.position],toNode:be.toHandle?c.get(be.toHandle.nodeId):null,pointer:L};x(Ae),de=Ae}function ne(ye){if(!("touches"in ye&&ye.touches.length>0)){if(C){(D||G)&&A&&z&&(g==null||g(A));const{inProgress:ge,...be}=de,xe={...be,toPosition:de.toHandle?de.toPosition:null};w==null||w(ye,xe),i&&(b==null||b(ye,xe))}p(),cancelAnimationFrame(I),P=!1,z=!1,A=null,G=null,R.removeEventListener("mousemove",pe),R.removeEventListener("mouseup",ne),R.removeEventListener("touchmove",pe),R.removeEventListener("touchend",ne)}}R.addEventListener("mousemove",pe),R.addEventListener("mouseup",ne),R.addEventListener("touchmove",pe),R.addEventListener("touchend",ne)}function m4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=p4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=di(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=h4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const T={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=T;const R=k&&N&&(n===tu.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(T),y.toHandle=f4(x,b,_,d,n,!0)}return y}const bx={onPointerDown:oce,isValid:m4};function lce({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ls(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Hf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=_[2]*Math.pow(2,N*k);t.scaleTo(T)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const T=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*T,y:_[1]-N[1]*T},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=VP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ii}}const D0=e=>({x:e.x,y:e.y,zoom:e.k}),Ib=({x:e,y:t,zoom:n})=>L0.translate(e,t).scale(n),cc=(e,t)=>e.target.closest(`.${t}`),g4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),cce=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Rb=(e,t=0,n=cce,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},y4=e=>{const t=e.ctrlKey&&Hf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function uce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(cc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ii(d),y=y4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Jo.Vertical?0:d.deltaX*h,m=s===Jo.Horizontal?0:d.deltaY*h;!Hf()&&d.shiftKey&&s!==Jo.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=D0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function dce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=cc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function fce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=D0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function hce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&g4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,D0(i.transform)))}}function pce({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&g4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=D0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function mce({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(cc(f,`${u}-flow__node`)||cc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||cc(f,l)&&m||cc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function gce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=VP().scaleExtent([t,n]).translateExtent(r),h=ls(e).call(f);b({x:s.x,y:s.y,zoom:ru(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(y4);async function g(D,U){return h?new Promise(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).transform(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}function w({noWheelClassName:D,noPanClassName:U,onPaneContextMenu:W,userSelectionActive:M,panOnScroll:$,panOnDrag:C,panOnScrollMode:j,panOnScrollSpeed:L,preventScrolling:P,zoomOnPinch:A,zoomOnScroll:z,zoomOnDoubleClick:G,zoomActivationKeyPressed:B,lib:re,onTransformChange:Q,connectionInProgress:se,paneClickDistance:de,selectionOnDrag:te}){M&&!u.isZoomingOrPanning&&y();const pe=$&&!B&&!M;f.clickDistance(te?1/0:!ui(de)||de<0?0:de);const ne=pe?uce({zoomPanValues:u,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:j,panOnScrollSpeed:L,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):dce({noWheelClassName:D,preventScrolling:P,d3ZoomHandler:p});h.on("wheel.zoom",ne,{passive:!1});const ye=fce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",ye);const ge=hce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!W,onPanZoom:i,onTransformChange:Q});f.on("zoom",ge);const be=pce({zoomPanValues:u,panOnDrag:C,panOnScroll:$,onPaneContextMenu:W,onPanZoomEnd:l,onDraggingChange:c});f.on("end",be);const xe=mce({zoomActivationKeyPressed:B,panOnDrag:C,zoomOnScroll:z,panOnScroll:$,zoomOnDoubleClick:G,zoomOnPinch:A,userSelectionActive:M,noPanClassName:U,noWheelClassName:D,lib:re,connectionInProgress:se});f.filter(xe),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(D,U,W){const M=Ib(D),$=f==null?void 0:f.constrain()(M,U,W);return $&&await g($),$}async function x(D,U){const W=Ib(D);return await g(W,U),W}function _(D){if(h){const U=Ib(D),W=h.property("__zoom");(W.k!==D.zoom||W.x!==D.x||W.y!==D.y)&&(f==null||f.transform(h,U,null,{sync:!0}))}}function k(){const D=h?zP(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(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).scaleTo(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}async function T(D,U){return h?new Promise(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).scaleBy(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function R(D){f==null||f.translateExtent(D)}function I(D){const U=!ui(D)||D<0?0:D;f==null||f.clickDistance(U)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:T,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var au;(function(e){e.Line="line",e.Handle="handle"})(au||(au={}));function yce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function HA(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 Ra(e,t){return Math.max(0,t-e)}function Oa(e,t){return Math.max(0,e-t)}function Ip(e,t,n){return Math.max(0,t-e,e-n)}function zA(e,t){return e?!t:t}function bce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:T}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),D=N+(u?-R:R),U=-i[0]*k,W=-i[1]*N;let M=Ip(I,g,w),$=Ip(D,y,b);if(a){let L=0,P=0;c&&S<0?L=Ra(x+S+U,a[0][0]):!c&&S>0&&(L=Oa(x+I+U,a[1][0])),u&&R<0?P=Ra(_+R+W,a[0][1]):!u&&R>0&&(P=Oa(_+D+W,a[1][1])),M=Math.max(M,L),$=Math.max($,P)}if(l){let L=0,P=0;c&&S>0?L=Oa(x+S,l[0][0]):!c&&S<0&&(L=Ra(x+I,l[1][0])),u&&R>0?P=Oa(_+R,l[0][1]):!u&&R<0&&(P=Ra(_+D,l[1][1])),M=Math.max(M,L),$=Math.max($,P)}if(s){if(d){const L=Ip(I/T,y,b)*T;if(M=Math.max(M,L),a){let P=0;!c&&!u||c&&!u&&h?P=Oa(_+W+I/T,a[1][1])*T:P=Ra(_+W+(c?S:-S)/T,a[0][1])*T,M=Math.max(M,P)}if(l){let P=0;!c&&!u||c&&!u&&h?P=Ra(_+I/T,l[1][1])*T:P=Oa(_+(c?S:-S)/T,l[0][1])*T,M=Math.max(M,P)}}if(f){const L=Ip(D*T,g,w)/T;if($=Math.max($,L),a){let P=0;!c&&!u||u&&!c&&h?P=Oa(x+D*T+U,a[1][0])/T:P=Ra(x+(u?R:-R)*T+U,a[0][0])/T,$=Math.max($,P)}if(l){let P=0;!c&&!u||u&&!c&&h?P=Ra(x+D*T,l[1][0])/T:P=Oa(x+(u?R:-R)*T,l[0][0])/T,$=Math.max($,P)}}}R=R+(R<0?$:-$),S=S+(S<0?M:-M),s&&(h?I>D*T?R=(zA(c,u)?-S:S)/T:S=(zA(c,u)?-R:R)*T:d?(R=S/T,u=c):(S=R*T,c=u));const C=c?x+S:x,j=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+j}}const b4={width:0,height:0,x:0,y:0},Ece={...b4,pointerX:0,pointerY:0,aspectRatio:1};function xce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function wce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=ls(e);let a={controlDirection:HA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...b4},b={...Ece};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:HA(u)};let x,_=null,k=[],N,T,S,R=!1;const I=CP().on("start",D=>{const{nodeLookup:U,transform:W,snapGrid:M,snapToGrid:$,nodeOrigin:C,paneDomNode:j}=n();if(x=U.get(t),!x)return;_=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:P}=Qd(D.sourceEvent,{transform:W,snapGrid:M,snapToGrid:$,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:L,pointerY:P,aspectRatio:y.width/y.height},N=void 0,T=fl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=U.get(x.parentId)),N&&x.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[A,z]of U)if(z.parentId===t&&(k.push({id:A,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const G=xce(z,x,z.origin??C);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,{...y})}).on("drag",D=>{const{transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$}=n(),C=Qd(D.sourceEvent,{transform:U,snapGrid:W,snapToGrid:M,containerBounds:_}),j=[];if(!x)return;const{x:L,y:P,width:A,height:z}=y,G={},B=x.origin??$,{width:re,height:Q,x:se,y:de}=bce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,B,T,S),te=re!==A,pe=Q!==z,ne=se!==L&&te,ye=de!==P&&pe;if(!ne&&!ye&&!te&&!pe)return;if((ne||ye||B[0]===1||B[1]===1)&&(G.x=ne?se:y.x,G.y=ye?de:y.y,y.x=G.x,y.y=G.y,k.length>0)){const ke=se-L,Ae=de-P;for(const He of k)He.position={x:He.position.x-ke+B[0]*(re-A),y:He.position.y-Ae+B[1]*(Q-z)},j.push(He)}if((te||pe)&&(G.width=te&&(!a.resizeDirection||a.resizeDirection==="horizontal")?re:y.width,G.height=pe&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:y.height,y.width=G.width,y.height=G.height),N&&x.expandParent){const ke=B[0]*(G.width??0);G.x&&G.x{R&&(g==null||g(D,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var E4={exports:{}},x4={},w4={exports:{}},v4={};/** + * @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 ou=E;function vce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _ce=typeof Object.is=="function"?Object.is:vce,kce=ou.useState,Nce=ou.useEffect,Sce=ou.useLayoutEffect,Tce=ou.useDebugValue;function Ace(e,t){var n=t(),r=kce({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Sce(function(){s.value=n,s.getSnapshot=t,Ob(s)&&i({inst:s})},[e,n,t]),Nce(function(){return Ob(s)&&i({inst:s}),e(function(){Ob(s)&&i({inst:s})})},[e]),Tce(n),n}function Ob(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_ce(e,n)}catch{return!0}}function Cce(e,t){return t()}var Ice=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cce:Ace;v4.useSyncExternalStore=ou.useSyncExternalStore!==void 0?ou.useSyncExternalStore:Ice;w4.exports=v4;var Rce=w4.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 P0=E,Oce=Rce;function Lce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mce=typeof Object.is=="function"?Object.is:Lce,jce=Oce.useSyncExternalStore,Dce=P0.useRef,Pce=P0.useEffect,Bce=P0.useMemo,Fce=P0.useDebugValue;x4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Dce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Bce(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,Mce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=jce(e,i[0],i[1]);return Pce(function(){a.hasValue=!0,a.value=l},[l]),Fce(l),l};E4.exports=x4;var Uce=E4.exports;const $ce=Wf(Uce),Hce={},VA=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:()=>{(Hce?"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},zce=e=>e?VA(e):VA,{useDebugValue:Vce}=kt,{useSyncExternalStoreWithSelector:Kce}=$ce,Yce=e=>e;function _4(e,t=Yce,n){const r=Kce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Vce(r),r}const KA=(e,t)=>{const n=zce(e),r=(s,i=t)=>_4(n,s,i);return Object.assign(r,n),r},Wce=(e,t)=>e?KA(e,t):KA;function xn(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 B0=E.createContext(null),Gce=B0.Provider,k4=bi.error001("react");function Ot(e,t){const n=E.useContext(B0);if(n===null)throw new Error(k4);return _4(n,e,t)}function wn(){const e=E.useContext(B0);if(e===null)throw new Error(k4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const YA={display:"none"},qce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},N4="react-flow__node-desc",S4="react-flow__edge-desc",Xce="react-flow__aria-live",Qce=e=>e.ariaLiveMessage,Zce=e=>e.ariaLabelConfig;function Jce({rfId:e}){const t=Ot(Qce);return o.jsx("div",{id:`${Xce}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:qce,children:t})}function eue({rfId:e,disableKeyboardA11y:t}){const n=Ot(Zce);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${N4}-${e}`,style:YA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${S4}-${e}`,style:YA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Jce,{rfId:e})]})}const F0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:Zn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});F0.displayName="Panel";function tue({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(F0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const nue=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}},Rp=e=>e.id;function rue(e,t){return xn(e.selectedNodes.map(Rp),t.selectedNodes.map(Rp))&&xn(e.selectedEdges.map(Rp),t.selectedEdges.map(Rp))}function sue({onSelectionChange:e}){const t=wn(),{selectedNodes:n,selectedEdges:r}=Ot(nue,rue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const iue=e=>!!e.onSelectionChangeHandlers;function aue({onSelectionChange:e}){const t=Ot(iue);return e||t?o.jsx(sue,{onSelectionChange:e}):null}const T4=[0,0],oue={x:0,y:0,zoom:1},lue=["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"],WA=[...lue,"rfId"],cue=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}),GA={translateExtent:Ff,nodeOrigin:T4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function uue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Ot(cue,xn),u=wn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=GA,l()}),[]);const d=E.useRef(GA);return E.useEffect(()=>{for(const f of WA){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:Mle(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},WA.map(f=>e[f])),null}function qA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function due(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=qA(),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=qA())!=null&&r.matches?"dark":"light"}const XA=typeof document<"u"?document:null;function zf(e=null,t={target:XA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.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 E.useEffect(()=>{const c=(t==null?void 0:t.target)??XA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&n4(p))return!1;const g=ZA(p.code,l);if(i.current.add(p[g]),QA(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=ZA(p.code,l);QA(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 QA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function ZA(e,t){return t.includes(e)?"code":"key"}const fue=()=>{const e=wn();return E.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:l}=e.getState(),c=x_(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return _u(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=iu(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function A4(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 l={...i};for(const c of a)hue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function hue(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 C4(e,t){return A4(e,t)}function I4(e,t){return A4(e,t)}function Oo(e,t){return{id:e,type:"select",selected:t}}function uc(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(Oo(i.id,a)))}return r}function JA({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 eC(e){return{id:e.id,type:"remove"}}const pue=JP();function R4(e,t,n={}){return Ule(e,t,{...n,onError:n.onError??pue})}const tC=e=>Nle(e),mue=e=>qP(e);function O4(e){return E.forwardRef(e)}const gue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function nC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>yue(()=>n(s=>s+BigInt(1))));return gue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function yue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const L4=E.createContext(null);function bue({children:e}){const t=wn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=JA({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=nC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(JA({items:p,lookup:h}))},[]),i=nC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(L4.Provider,{value:a,children:e})}function Eue(){const e=E.useContext(L4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xue=e=>!!e.panZoom;function U0(){const e=fue(),t=wn(),n=Eue(),r=Ot(xue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=tC(f)?f:h.get(f.id),g=m.parentId?e4(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return su(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&tC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&mue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Ile({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),T=N.length>0,S=k.length>0;if(T){const R=N.map(eC);w==null||w(N),b(R)}if(S){const R=k.map(eC);g==null||g(k),y(R)}return(S||T)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=RA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=su(w?y:b),_=$f(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=RA(f)?f:c(f);if(!g)return!1;const w=$f(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Sle(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??Lle();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const rC=e=>e.selected,wue=typeof window<"u"?window:void 0;function vue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=wn(),{deleteElements:r}=U0(),s=zf(e,{actInsideInputWithModifier:!1}),i=zf(t,{target:wue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(rC),edges:a.filter(rC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function _ue(e){const t=wn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=v_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",bi.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 $0={position:"absolute",width:"100%",height:"100%",top:0,left:0},kue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Nue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Jo.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=wn(),N=E.useRef(null),{userSelectionActive:T,lib:S,connectionInProgress:R}=Ot(kue,xn),I=zf(h),D=E.useRef();_ue(N);const U=E.useCallback(W=>{y==null||y({x:W[0],y:W[1],zoom:W[2]}),b||k.setState({transform:W})},[y,b]);return E.useEffect(()=>{if(N.current){D.current=gce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(j=>j.paneDragging===C?j:{paneDragging:C}),onPanZoomStart:(C,j)=>{const{onViewportChangeStart:L,onMoveStart:P}=k.getState();P==null||P(C,j),L==null||L(j)},onPanZoom:(C,j)=>{const{onViewportChange:L,onMove:P}=k.getState();P==null||P(C,j),L==null||L(j)},onPanZoomEnd:(C,j)=>{const{onViewportChangeEnd:L,onMoveEnd:P}=k.getState();P==null||P(C,j),L==null||L(j)}});const{x:W,y:M,zoom:$}=D.current.getViewport();return k.setState({panZoom:D.current,transform:[W,M,$],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=D.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var W;(W=D.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:T,noWheelClassName:g,lib:S,onTransformChange:U,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,T,g,S,U,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:$0,children:m})}const Sue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Tue(){const{userSelectionActive:e,userSelectionRect:t}=Ot(Sue,xn);return e&&t?o.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 Lb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Aue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Cue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Uf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=wn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:T}=Ot(Aue,xn),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),D=E.useRef(new Set),U=E.useRef(new Set),W=E.useRef(!1),M=E.useRef({x:0,y:0}),$=E.useRef(!1),C=te=>{if(W.current||k){W.current=!1;return}u==null||u(te),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},j=te=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){te.preventDefault();return}d==null||d(te)},L=f?te=>f(te):void 0,P=te=>{W.current&&(te.stopPropagation(),W.current=!1)},A=te=>{var He,Ce;const{domNode:pe,transform:ne}=y.getState();if(I.current=pe==null?void 0:pe.getBoundingClientRect(),!I.current)return;const ye=te.target===R.current;if(!ye&&!!te.target.closest(".nokey")||!e||!(a&&ye||t)||te.button!==0||!te.isPrimary)return;(Ce=(He=te.target)==null?void 0:He.setPointerCapture)==null||Ce.call(He,te.pointerId),W.current=!1;const{x:xe,y:ke}=di(te.nativeEvent,I.current),Ae=_u({x:xe,y:ke},ne);y.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:xe,y:ke}}),ye||(te.stopPropagation(),te.preventDefault())};function z(te,pe){const{userSelectionRect:ne}=y.getState();if(!ne)return;const{transform:ye,nodeLookup:ge,edgeLookup:be,connectionLookup:xe,triggerNodeChanges:ke,triggerEdgeChanges:Ae,defaultEdgeOptions:He}=y.getState(),Ce={x:ne.startX,y:ne.startY},{x:gt,y:Ge}=iu(Ce,ye),ze={startX:Ce.x,startY:Ce.y,x:teft.id)),U.current=new Set;const ut=(He==null?void 0:He.selectable)??!0;for(const ft of D.current){const X=xe.get(ft);if(X)for(const{edgeId:ee}of X.values()){const me=be.get(ee);me&&(me.selectable??ut)&&U.current.add(ee)}}if(!OA(le,D.current)){const ft=uc(ge,D.current,!0);ke(ft)}if(!OA(Ee,U.current)){const ft=uc(be,U.current);Ae(ft)}y.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!s||!I.current)return;const[te,pe]=E_(M.current,I.current,T);N({x:te,y:pe}).then(ne=>{if(!W.current||!ne){w.current=requestAnimationFrame(G);return}const{x:ye,y:ge}=M.current;z(ye,ge),w.current=requestAnimationFrame(G)})}const B=()=>{cancelAnimationFrame(w.current),w.current=0,$.current=!1};E.useEffect(()=>()=>B(),[]);const re=te=>{const{userSelectionRect:pe,transform:ne,resetSelectedElements:ye}=y.getState();if(!I.current||!pe)return;const{x:ge,y:be}=di(te.nativeEvent,I.current);M.current={x:ge,y:be};const xe=iu({x:pe.startX,y:pe.startY},ne);if(!W.current){const ke=t?0:i;if(Math.hypot(ge-xe.x,be-xe.y)<=ke)return;ye(),l==null||l(te)}W.current=!0,$.current||(G(),$.current=!0),z(ge,be)},Q=te=>{var pe,ne;te.button===0&&((ne=(pe=te.target)==null?void 0:pe.releasePointerCapture)==null||ne.call(pe,te.pointerId),!b&&te.target===R.current&&y.getState().userSelectionRect&&(C==null||C(te)),y.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(c==null||c(te),y.setState({nodesSelectionActive:D.current.size>0})),B())},se=te=>{var pe,ne;(ne=(pe=te.target)==null?void 0:pe.releasePointerCapture)==null||ne.call(pe,te.pointerId),B()},de=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:Zn(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:S?void 0:Lb(C,R),onContextMenu:Lb(j,R),onWheel:Lb(L,R),onPointerEnter:S?void 0:h,onPointerMove:S?re:p,onPointerUp:S?Q:void 0,onPointerCancel:S?se:void 0,onPointerDownCapture:S?A:void 0,onClickCapture:S?P:void 0,onPointerLeave:m,ref:R,style:$0,children:[g,o.jsx(Tue,{})]})}function Ex({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",bi.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 M4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=wn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=nce({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Ex({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 Iue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function j4(){const e=wn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Iue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=Eh(b,i));const{position:x,positionAbsolute:_}=XP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const A_=E.createContext(null),Rue=A_.Provider;A_.Consumer;const D4=()=>E.useContext(A_),Oue=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Lue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===tu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Mue({type:e="source",position:t=Fe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var $,C;const m=a||null,g=e==="target",w=wn(),y=D4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Ot(Oue,xn),{connectingFrom:k,connectingTo:N,clickConnecting:T,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:D}=Ot(Lue(y,m,e),xn);y||(C=($=w.getState()).onError)==null||C.call($,"010",bi.error010());const U=j=>{const{defaultEdgeOptions:L,onConnect:P,hasDefaultEdges:A}=w.getState(),z={...L,...j};if(A){const{edges:G,setEdges:B,onError:re}=w.getState();B(R4(z,G,{onError:re}))}P==null||P(z),l==null||l(z)},W=j=>{if(!y)return;const L=r4(j.nativeEvent);if(s&&(L&&j.button===0||!L)){const P=w.getState();bx.onPointerDown(j.nativeEvent,{handleDomNode:j.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:g,handleId:m,nodeId:y,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:(...A)=>{var z,G;return(G=(z=w.getState()).onConnectEnd)==null?void 0:G.call(z,...A)},updateConnection:P.updateConnection,onConnect:U,isValidConnection:n||((...A)=>{var z,G;return((G=(z=w.getState()).isValidConnection)==null?void 0:G.call(z,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}L?d==null||d(j):f==null||f(j)},M=j=>{const{onClickConnectStart:L,onClickConnectEnd:P,connectionClickStartHandle:A,connectionMode:z,isValidConnection:G,lib:B,rfId:re,nodeLookup:Q,connection:se}=w.getState();if(!y||!A&&!s)return;if(!A){L==null||L(j.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const de=t4(j.target),te=n||G,{connection:pe,isValid:ne}=bx.isValid(j.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:z,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:te,flowId:re,doc:de,lib:B,nodeLookup:Q});ne&&pe&&U(pe);const ye=structuredClone(se);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,P==null||P(j,ye),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:Zn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:k,connectingto:N,valid:D,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:W,onTouchStart:W,onClick:b?M:void 0,ref:p,...h,children:c})}const kr=E.memo(O4(Mue));function jue({data:e,isConnectable:t,sourcePosition:n=Fe.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(kr,{type:"source",position:n,isConnectable:t})]})}function Due({data:e,isConnectable:t,targetPosition:n=Fe.Top,sourcePosition:r=Fe.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(kr,{type:"source",position:r,isConnectable:t})]})}function Pue(){return null}function Bue({data:e,isConnectable:t,targetPosition:n=Fe.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ng={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},sC={input:jue,default:Due,output:Bue,group:Pue};function Fue(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 Uue=e=>{const{width:t,height:n,x:r,y:s}=bh(e.nodeLookup,{filter:i=>!!i.selected});return{width:ui(t)?t:null,height:ui(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 $ue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=wn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Ot(Uue,xn),c=j4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(M4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Ng,p.key)&&(p.preventDefault(),c({direction:Ng[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:Zn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 iC=typeof window<"u"?window:void 0,Hue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function P4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:D,minZoom:U,maxZoom:W,preventScrolling:M,onSelectionContextMenu:$,noWheelClassName:C,noPanClassName:j,disableKeyboardA11y:L,onViewportChange:P,isControlledViewport:A}){const{nodesSelectionActive:z,userSelectionActive:G}=Ot(Hue,xn),B=zf(u,{target:iC}),re=zf(g,{target:iC}),Q=re||S,se=re||_,de=d&&Q!==!0,te=B||G||de;return vue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(Nue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:se,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!B&&Q,defaultViewport:I,translateExtent:D,minZoom:U,maxZoom:W,zoomActivationKeyCode:w,preventScrolling:M,noWheelClassName:C,noPanClassName:j,onViewportChange:P,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:de,children:o.jsxs(Cue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:R,isSelecting:!!te,selectionMode:f,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:de,children:[e,z&&o.jsx($ue,{onSelectionContextMenu:$,noPanClassName:j,disableKeyboardA11y:L})]})})}P4.displayName="FlowRenderer";const zue=E.memo(P4),Vue=e=>t=>e?b_(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 Kue(e){return Ot(E.useCallback(Vue(e),[e]),xn)}const Yue=e=>e.updateNodeInternals;function Wue(){const e=Ot(Yue),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Gue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=wn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 que({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Ot(te=>{const pe=te.nodeLookup.get(e),ne=te.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:ne}},xn);let N=x.type||"default",T=(w==null?void 0:w[N])||sC[N];T===void 0&&(b==null||b("003",bi.error003(N)),N="default",T=(w==null?void 0:w.default)||sC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),D=!!(x.focusable||d&&typeof x.focusable>"u"),U=wn(),W=w_(x),M=Gue({node:x,nodeType:N,hasDimensions:W,resizeObserver:f}),$=M4({nodeRef:M,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=j4();if(x.hidden)return null;const j=Ea(x),L=Fue(x),P=R||S||t||n||r||s,A=n?te=>n(te,{..._.userNode}):void 0,z=r?te=>r(te,{..._.userNode}):void 0,G=s?te=>s(te,{..._.userNode}):void 0,B=i?te=>i(te,{..._.userNode}):void 0,re=a?te=>a(te,{..._.userNode}):void 0,Q=te=>{const{selectNodesOnDrag:pe,nodeDragThreshold:ne}=U.getState();R&&(!pe||!S||ne>0)&&Ex({id:e,store:U,nodeRef:M}),t&&t(te,{..._.userNode})},se=te=>{if(!(n4(te.nativeEvent)||m)){if(KP.includes(te.key)&&R){const pe=te.key==="Escape";Ex({id:e,store:U,unselect:pe,nodeRef:M})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(Ng,te.key)){te.preventDefault();const{ariaLabelConfig:pe}=U.getState();U.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Ng[te.key],factor:te.shiftKey?4:1})}}},de=()=>{var xe;if(m||!((xe=M.current)!=null&&xe.matches(":focus-visible")))return;const{transform:te,width:pe,height:ne,autoPanOnNodeFocus:ye,setCenter:ge}=U.getState();if(!ye)return;b_(new Map([[e,x]]),{x:0,y:0,width:pe,height:ne},te,!0).length>0||ge(x.position.x+j.width/2,x.position.y+j.height/2,{zoom:te[2]})};return o.jsx("div",{className:Zn(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:$}]),ref:M,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:W?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:z,onMouseLeave:G,onContextMenu:B,onClick:Q,onDoubleClick:re,onKeyDown:D?se:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:x.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${N4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(Rue,{value:e,children:o.jsx(T,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:$,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...j})})})}var Xue=E.memo(que);const Que=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function B4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Ot(Que,xn),a=Kue(e.onlyRenderVisibleElements),l=Wue();return o.jsx("div",{className:"react-flow__nodes",style:$0,children:a.map(c=>o.jsx(Xue,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}B4.displayName="NodeRenderer";const Zue=E.memo(B4);function Jue(e){return Ot(E.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&&Ple({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),xn)}const ede=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},tde=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},aC={[nu.Arrow]:ede,[nu.ArrowClosed]:tde};function nde(e){const t=wn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(aC,e)?aC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",bi.error009(e)),null)},[e])}const rde=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=nde(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},F4=({defaultColor:e,rfId:t})=>{const n=Ot(i=>i.edges),r=Ot(i=>i.defaultEdgeOptions),s=E.useMemo(()=>Kle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(rde,{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};F4.displayName="MarkerDefinitions";var sde=E.memo(F4);function U4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=Zn(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}U4.displayName="EdgeText";const ide=E.memo(U4);function xh({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:Zn(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ui(t)&&ui(n)?o.jsx(ide,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function oC({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 $4({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top}){const[a,l]=oC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=oC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=s4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function H4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=$4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(xh,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const ade=H4({isInternal:!1}),z4=H4({isInternal:!0});ade.displayName="SimpleBezierEdge";z4.displayName="SimpleBezierEdgeInternal";function V4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Fe.Bottom,targetPosition:m=Fe.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=kg({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(xh,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const K4=V4({isInternal:!1}),Y4=V4({isInternal:!0});K4.displayName="SmoothStepEdge";Y4.displayName="SmoothStepEdgeInternal";function W4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(K4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const ode=W4({isInternal:!1}),G4=W4({isInternal:!0});ode.displayName="StepEdge";G4.displayName="StepEdgeInternal";function q4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=o4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(xh,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const lde=q4({isInternal:!1}),X4=q4({isInternal:!0});lde.displayName="StraightEdge";X4.displayName="StraightEdgeInternal";function Q4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Fe.Bottom,targetPosition:l=Fe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=i4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(xh,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const cde=Q4({isInternal:!1}),Z4=Q4({isInternal:!0});cde.displayName="BezierEdge";Z4.displayName="BezierEdgeInternal";const lC={default:Z4,straight:X4,step:G4,smoothstep:Y4,simplebezier:z4},cC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ude=(e,t,n)=>n===Fe.Left?e-t:n===Fe.Right?e+t:e,dde=(e,t,n)=>n===Fe.Top?e-t:n===Fe.Bottom?e+t:e,uC="react-flow__edgeupdater";function dC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Zn([uC,`${uC}-${l}`]),cx:ude(t,r,e),cy:dde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function fde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=wn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:D,cancelConnection:U,nodeLookup:W,rfId:M,panBy:$,updateConnection:C}=m.getState(),j=k.type==="target",L=(z,G)=>{h(!1),f==null||f(z,n,k.type,G)},P=z=>u==null?void 0:u(n,z),A=(z,G)=>{h(!0),d==null||d(_,n,k.type),D==null||D(z,G)};bx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:T,handleId:k.id,nodeId:k.nodeId,nodeLookup:W,isTarget:j,edgeUpdaterType:k.type,lib:I,flowId:M,cancelConnection:U,panBy:$,isValidConnection:(...z)=>{var G,B;return((B=(G=m.getState()).isValidConnection)==null?void 0:B.call(G,...z))??!0},onConnect:P,onConnectStart:A,onConnectEnd:(...z)=>{var G,B;return(B=(G=m.getState()).onConnectEnd)==null?void 0:B.call(G,...z)},onReconnectEnd:L,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(dC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(dC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function hde({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Ot(ge=>ge.edgeLookup.get(e));const _=Ot(ge=>ge.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||lC[k];N===void 0&&(y==null||y("011",bi.error011(k)),k="default",N=(g==null?void 0:g.default)||lC.default);const T=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[D,U]=E.useState(!1),[W,M]=E.useState(!1),$=wn(),{zIndex:C,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G}=Ot(E.useCallback(ge=>{const be=ge.nodeLookup.get(x.source),xe=ge.nodeLookup.get(x.target);if(!be||!xe)return{zIndex:x.zIndex,...cC};const ke=Vle({id:e,sourceNode:be,targetNode:xe,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:y});return{zIndex:Dle({selected:x.selected,zIndex:x.zIndex,sourceNode:be,targetNode:xe,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...ke||cC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),xn),B=E.useMemo(()=>x.markerStart?`url('#${gx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),re=E.useMemo(()=>x.markerEnd?`url('#${gx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||j===null||L===null||P===null||A===null)return null;const Q=ge=>{var Ae;const{addSelectedEdges:be,unselectNodesAndEdges:xe,multiSelectionActive:ke}=$.getState();R&&($.setState({nodesSelectionActive:!1}),x.selected&&ke?(xe({nodes:[],edges:[x]}),(Ae=I.current)==null||Ae.blur()):be([e])),s&&s(ge,x)},se=i?ge=>{i(ge,{...x})}:void 0,de=a?ge=>{a(ge,{...x})}:void 0,te=l?ge=>{l(ge,{...x})}:void 0,pe=c?ge=>{c(ge,{...x})}:void 0,ne=u?ge=>{u(ge,{...x})}:void 0,ye=ge=>{var be;if(!b&&KP.includes(ge.key)&&R){const{unselectNodesAndEdges:xe,addSelectedEdges:ke}=$.getState();ge.key==="Escape"?((be=I.current)==null||be.blur(),xe({edges:[x]})):ke([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:Zn(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:D,selectable:R}]),onClick:Q,onDoubleClick:se,onContextMenu:de,onMouseEnter:te,onMouseMove:pe,onMouseLeave:ne,onKeyDown:T?ye:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${S4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!W&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:B,markerEnd:re,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(fde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G,setUpdateHover:U,setReconnecting:M})]})})}var pde=E.memo(hde);const mde=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function J4({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Ot(mde,xn),_=Jue(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(sde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(pde,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}J4.displayName="EdgeRenderer";const gde=E.memo(J4),yde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bde({children:e}){const t=Ot(yde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Ede(e){const t=U0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const xde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function wde(e){const t=Ot(xde),n=wn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function vde(e){return e.connection.inProgress?{...e.connection,to:_u(e.connection.to,e.transform)}:{...e.connection}}function _de(e){return vde}function kde(e){const t=_de();return Ot(t,xn)}const Nde=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Sde({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Ot(Nde,xn);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:Zn(["react-flow__connection",GP(l)]),children:o.jsx(e6,{style:t,type:n,CustomComponent:r,isValid:l})})})}const e6=({style:e,type:t=za.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=kde();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:GP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case za.Bezier:[m]=i4(g);break;case za.SimpleBezier:[m]=$4(g);break;case za.Step:[m]=kg({...g,borderRadius:0});break;case za.SmoothStep:[m]=kg(g);break;default:[m]=o4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};e6.displayName="ConnectionLine";const Tde={};function fC(e=Tde){E.useRef(e),wn(),E.useEffect(()=>{},[e])}function Ade(){wn(),E.useRef(!1),E.useEffect(()=>{},[])}function t6({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:D,translateExtent:U,minZoom:W,maxZoom:M,preventScrolling:$,defaultMarkerColor:C,zoomOnScroll:j,zoomOnPinch:L,panOnScroll:P,panOnScrollSpeed:A,panOnScrollMode:z,zoomOnDoubleClick:G,panOnDrag:B,autoPanOnSelection:re,onPaneClick:Q,onPaneMouseEnter:se,onPaneMouseMove:de,onPaneMouseLeave:te,onPaneScroll:pe,onPaneContextMenu:ne,paneClickDistance:ye,nodeClickDistance:ge,onEdgeContextMenu:be,onEdgeMouseEnter:xe,onEdgeMouseMove:ke,onEdgeMouseLeave:Ae,reconnectRadius:He,onReconnect:Ce,onReconnectStart:gt,onReconnectEnd:Ge,noDragClassName:ze,noWheelClassName:le,noPanClassName:Ee,disableKeyboardA11y:ut,nodeExtent:ft,rfId:X,viewport:ee,onViewportChange:me}){return fC(e),fC(t),Ade(),Ede(n),wde(ee),o.jsx(zue,{onPaneClick:Q,onPaneMouseEnter:se,onPaneMouseMove:de,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:pe,paneClickDistance:ye,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:j,zoomOnPinch:L,zoomOnDoubleClick:G,panOnScroll:P,panOnScrollSpeed:A,panOnScrollMode:z,panOnDrag:B,autoPanOnSelection:re,defaultViewport:D,translateExtent:U,minZoom:W,maxZoom:M,onSelectionContextMenu:f,preventScrolling:$,noDragClassName:ze,noWheelClassName:le,noPanClassName:Ee,disableKeyboardA11y:ut,onViewportChange:me,isControlledViewport:!!ee,children:o.jsxs(bde,{children:[o.jsx(gde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ce,onReconnectStart:gt,onReconnectEnd:Ge,onlyRenderVisibleElements:R,onEdgeContextMenu:be,onEdgeMouseEnter:xe,onEdgeMouseMove:ke,onEdgeMouseLeave:Ae,reconnectRadius:He,defaultMarkerColor:C,noPanClassName:Ee,disableKeyboardA11y:ut,rfId:X}),o.jsx(Sde,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(Zue,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:Ee,noDragClassName:ze,disableKeyboardA11y:ut,nodeExtent:ft,rfId:X}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}t6.displayName="GraphView";const Cde=E.memo(t6),Ide=JP(),hC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Ff;u4(g,w,y);const{nodesInitialized:k}=yx(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const T=bh(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:R,zoom:I}=x_(T,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Ff,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...WP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ide,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:YP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Rde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Wce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:T}=m();y&&(await Cle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:T},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...hC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:T}=m(),{nodesInitialized:S,hasSelectedNodes:R}=yx(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=T&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();u4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:T,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:D}=Zle(w,b,x,_,k,N,R);D&&(Gle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const D=_.get(R),U=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(I!=null&&I.position)),W={id:R,type:"position",position:U?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(D&&N.inProgress&&N.fromNode.id===D.id){const M=hl(D,N.fromHandle,Fe.Left,!0);T({...N,from:M})}U&&D.parentId&&b.push({id:R,parentId:D.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(W)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),D=T_(b,_,R,I);x.push(...D)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=C4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=I4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Oo(T,!0));_(N);return}_(uc(x,new Set([...w]),!0)),k(uc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Oo(T,!0));k(N);return}k(uc(b,new Set([...w]))),_(uc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),T=w||x,S=y||b,R=[];for(const D of T){if(!D.selected)continue;const U=_.get(D.id);U&&(U.selected=!1),R.push(Oo(D.id,!1))}const I=[];for(const D of S)D.selected&&I.push(Oo(D.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((T,S)=>S.selected?[...T,Oo(S.id,!1)]:T,[]),N=w.reduce((T,S)=>S.selected?[...T,Oo(S.id,!1)]:T,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:T}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(yx(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:T}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return Jle({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const T=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*T,y:_/2-y*T,zoom:T},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...WP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...hC()})}},Object.is);function C_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>Rde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Gce,{value:m,children:o.jsx(bue,{children:p})})}function Ode({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(B0)?o.jsx(o.Fragment,{children:e}):o.jsx(C_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Lde={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Mde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:D,onDelete:U,onSelectionChange:W,onSelectionDragStart:M,onSelectionDrag:$,onSelectionDragStop:C,onSelectionContextMenu:j,onSelectionStart:L,onSelectionEnd:P,onBeforeDelete:A,connectionMode:z,connectionLineType:G=za.Bezier,connectionLineStyle:B,connectionLineComponent:re,connectionLineContainerStyle:Q,deleteKeyCode:se="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:te=!1,selectionMode:pe=Uf.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ye=Hf()?"Meta":"Control",zoomActivationKeyCode:ge=Hf()?"Meta":"Control",snapToGrid:be,snapGrid:xe,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ae,nodesDraggable:He,autoPanOnNodeFocus:Ce,nodesConnectable:gt,nodesFocusable:Ge,nodeOrigin:ze=T4,edgesFocusable:le,edgesReconnectable:Ee,elementsSelectable:ut=!0,defaultViewport:ft=oue,minZoom:X=.5,maxZoom:ee=2,translateExtent:me=Ff,preventScrolling:Le=!0,nodeExtent:Ye,defaultMarkerColor:Ze="#b1b1b7",zoomOnScroll:Pt=!0,zoomOnPinch:bt=!0,panOnScroll:Bt=!1,panOnScrollSpeed:zt=.5,panOnScrollMode:Nt=Jo.Free,zoomOnDoubleClick:Ut=!0,panOnDrag:Be=!0,onPaneClick:pt,onPaneMouseEnter:Je,onPaneMouseMove:Re,onPaneMouseLeave:It,onPaneScroll:St,onPaneContextMenu:ce,paneClickDistance:Ve=1,nodeClickDistance:at=0,children:rn,onReconnect:sn,onReconnectStart:fn,onReconnectEnd:Wt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Vn,onEdgeMouseMove:Kn,onEdgeMouseLeave:vt,reconnectRadius:an=10,onNodesChange:ue,onEdgesChange:Se,noDragClassName:ve="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ot="nopan",fitView:et,fitViewOptions:lt,connectOnClick:Vt,attributionPosition:Kt,proOptions:J,defaultEdgeOptions:rt,elevateNodesOnSelect:Ue=!0,elevateEdgesOnSelect:qe=!1,disableKeyboardA11y:Xe=!1,autoPanOnConnect:Rt,autoPanOnNodeDrag:Yn,autoPanOnSelection:Wn=!0,autoPanSpeed:en,connectionRadius:vn,isValidConnection:Yt,onError:_n,style:kn,id:Mt,nodeDragThreshold:Nn,connectionDragThreshold:mr,viewport:Lt,onViewportChange:jn,width:lr,height:gr,colorMode:Ar="light",debug:Ks,onScroll:Hr,ariaLabelConfig:ns,zIndexMode:Ys="basic",...Es},Vi){const Cr=Mt||"1",Ki=due(Ar),xa=E.useCallback(vi=>{vi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Hr==null||Hr(vi)},[Hr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Es,onScroll:xa,style:{...kn,...Lde},ref:Vi,className:Zn(["react-flow",s,Ki]),id:Mt,role:"application",children:o.jsxs(Ode,{nodes:e,edges:t,width:lr,height:gr,fitView:et,fitViewOptions:lt,minZoom:X,maxZoom:ee,nodeOrigin:ze,nodeExtent:Ye,zIndexMode:Ys,children:[o.jsx(uue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:He,autoPanOnNodeFocus:Ce,nodesConnectable:gt,nodesFocusable:Ge,edgesFocusable:le,edgesReconnectable:Ee,elementsSelectable:ut,elevateNodesOnSelect:Ue,elevateEdgesOnSelect:qe,minZoom:X,maxZoom:ee,nodeExtent:Ye,onNodesChange:ue,onEdgesChange:Se,snapToGrid:be,snapGrid:xe,connectionMode:z,translateExtent:me,connectOnClick:Vt,defaultEdgeOptions:rt,fitView:et,fitViewOptions:lt,onNodesDelete:I,onEdgesDelete:D,onDelete:U,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:$,onSelectionDragStart:M,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ot,nodeOrigin:ze,rfId:Cr,autoPanOnConnect:Rt,autoPanOnNodeDrag:Yn,autoPanSpeed:en,onError:_n,connectionRadius:vn,isValidConnection:Yt,selectNodesOnDrag:Ae,nodeDragThreshold:Nn,connectionDragThreshold:mr,onBeforeDelete:A,debug:Ks,ariaLabelConfig:ns,zIndexMode:Ys}),o.jsx(Cde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:G,connectionLineStyle:B,connectionLineComponent:re,connectionLineContainerStyle:Q,selectionKeyCode:de,selectionOnDrag:te,selectionMode:pe,deleteKeyCode:se,multiSelectionKeyCode:ye,panActivationKeyCode:ne,zoomActivationKeyCode:ge,onlyRenderVisibleElements:ke,defaultViewport:ft,translateExtent:me,minZoom:X,maxZoom:ee,preventScrolling:Le,zoomOnScroll:Pt,zoomOnPinch:bt,zoomOnDoubleClick:Ut,panOnScroll:Bt,panOnScrollSpeed:zt,panOnScrollMode:Nt,panOnDrag:Be,autoPanOnSelection:Wn,onPaneClick:pt,onPaneMouseEnter:Je,onPaneMouseMove:Re,onPaneMouseLeave:It,onPaneScroll:St,onPaneContextMenu:ce,paneClickDistance:Ve,nodeClickDistance:at,onSelectionContextMenu:j,onSelectionStart:L,onSelectionEnd:P,onReconnect:sn,onReconnectStart:fn,onReconnectEnd:Wt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Vn,onEdgeMouseMove:Kn,onEdgeMouseLeave:vt,reconnectRadius:an,defaultMarkerColor:Ze,noDragClassName:ve,noWheelClassName:Qe,noPanClassName:ot,rfId:Cr,disableKeyboardA11y:Xe,nodeExtent:Ye,viewport:Lt,onViewportChange:jn}),o.jsx(aue,{onSelectionChange:W}),rn,o.jsx(tue,{proOptions:J,position:Kt}),o.jsx(eue,{rfId:Cr,disableKeyboardA11y:Xe})]})})}var n6=O4(Mde);const jde=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Dde({children:e}){const t=Ot(jde);return t?ps.createPortal(e,t):null}function r6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>C4(s,i)),[]);return[t,n,r]}function s6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>I4(s,i)),[]);return[t,n,r]}const Pde=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||!w_(n.userNode))return!1;return!0};function Bde(e={includeHiddenNodes:!1}){return Ot(Pde(e))}function Fde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Zn(["react-flow__background-pattern",n,r])})}function Ude({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:Zn(["react-flow__background-pattern","dots",t])})}var so;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(so||(so={}));const $de={[so.Dots]:1,[so.Lines]:1,[so.Cross]:6},Hde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function i6({id:e,variant:t=so.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Ot(Hde,xn),m=r||$de[t],g=t===so.Dots,w=t===so.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:Zn(["react-flow__background",u]),style:{...c,...$0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Ude,{radius:x/2,className:d}):o.jsx(Fde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}i6.displayName="Background";const a6=E.memo(i6);function zde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Vde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Kde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Yde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Wde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Op({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:Zn(["react-flow__controls-button",t]),...n,children:e})}const Gde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function o6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=wn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Ot(Gde,xn),{zoomIn:x,zoomOut:_,fitView:k}=U0(),N=()=>{x(),i==null||i()},T=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs(F0,{className:Zn(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Op,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(zde,{})}),o.jsx(Op,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(Vde,{})})]}),n&&o.jsx(Op,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(Kde,{})}),r&&o.jsx(Op,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Wde,{}):o.jsx(Yde,{})}),d]})}o6.displayName="Controls";const l6=E.memo(o6);function qde({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:Zn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Xde=E.memo(qde),Qde=e=>e.nodes.map(t=>t.id),Mb=e=>e instanceof Function?e:()=>e;function Zde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=Xde,onClick:a}){const l=Ot(Qde,xn),c=Mb(t),u=Mb(e),d=Mb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(efe,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Jde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Ot(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=Ea(w);return{node:w,x:y,y:b,width:x,height:_}},xn);return!u||u.hidden||!w_(u)?null:o.jsx(l,{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 efe=E.memo(Jde);var tfe=E.memo(Zde);const nfe=200,rfe=150,sfe=e=>!e.hidden,ife=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?ZP(bh(e.nodeLookup,{filter:sfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},afe="react-flow__minimap-desc";function c6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=wn(),N=E.useRef(null),{boundingRect:T,viewBB:S,rfId:R,panZoom:I,translateExtent:D,flowWidth:U,flowHeight:W,ariaLabelConfig:M}=Ot(ife,xn),$=(e==null?void 0:e.width)??nfe,C=(e==null?void 0:e.height)??rfe,j=T.width/$,L=T.height/C,P=Math.max(j,L),A=P*$,z=P*C,G=_*P,B=T.x-(A-T.width)/2-G,re=T.y-(z-T.height)/2-G,Q=A+G*2,se=z+G*2,de=`${afe}-${R}`,te=E.useRef(0),pe=E.useRef();te.current=P,E.useEffect(()=>{if(N.current&&I)return pe.current=lce({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>te.current}),()=>{var be;(be=pe.current)==null||be.destroy()}},[I]),E.useEffect(()=>{var be;(be=pe.current)==null||be.update({translateExtent:D,width:U,height:W,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,D,U,W]);const ne=p?be=>{var Ae;const[xe,ke]=((Ae=pe.current)==null?void 0:Ae.pointer(be))||[0,0];p(be,{x:xe,y:ke})}:void 0,ye=m?E.useCallback((be,xe)=>{const ke=k.getState().nodeLookup.get(xe).internals.userNode;m(be,ke)},[]):void 0,ge=y??M["minimap.ariaLabel"];return o.jsx(F0,{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*P: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:Zn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:$,height:C,viewBox:`${B} ${re} ${Q} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:N,onClick:ne,children:[ge&&o.jsx("title",{id:de,children:ge}),o.jsx(tfe,{onClick:ye,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-G},${re-G}h${Q+G*2}v${se+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"})]})})}c6.displayName="MiniMap";const ofe=E.memo(c6),lfe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,cfe={[au.Line]:"right",[au.Handle]:"bottom-right"};function ufe({nodeId:e,position:t,variant:n=au.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=D4(),x=typeof e=="string"?e:b,_=wn(),k=E.useRef(null),N=n===au.Handle,T=Ot(E.useCallback(lfe(N&&p),[N,p]),xn),S=E.useRef(null),R=t??cfe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=wce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:D,transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$,domNode:C}=_.getState();return{nodeLookup:D,transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$,paneDomNode:C}},onChange:(D,U)=>{const{triggerNodeChanges:W,nodeLookup:M,parentLookup:$,nodeOrigin:C}=_.getState(),j=[],L={x:D.x,y:D.y},P=M.get(x);if(P&&P.expandParent&&P.parentId){const A=P.origin??C,z=D.width??P.measured.width??0,G=D.height??P.measured.height??0,B={id:P.id,parentId:P.parentId,rect:{width:z,height:G,...e4({x:D.x??P.position.x,y:D.y??P.position.y},{width:z,height:G},P.parentId,M,A)}},re=T_([B],M,$,C);j.push(...re),L.x=D.x?Math.max(A[0]*z,D.x):void 0,L.y=D.y?Math.max(A[1]*G,D.y):void 0}if(L.x!==void 0&&L.y!==void 0){const A={id:x,type:"position",position:{...L}};j.push(A)}if(D.width!==void 0&&D.height!==void 0){const z={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};j.push(z)}for(const A of U){const z={...A,type:"position"};j.push(z)}W(j)},onEnd:({width:D,height:U})=>{const W={id:x,type:"dimensions",resizing:!1,dimensions:{width:D,height:U}};_.getState().triggerNodeChanges([W])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:Zn(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(ufe);var u6=Object.defineProperty,dfe=(e,t,n)=>t in e?u6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ffe=(e,t)=>{for(var n in t)u6(e,n,{get:t[n],enumerable:!0})},hfe=(e,t,n)=>dfe(e,t+"",n),d6={};ffe(d6,{Graph:()=>Vs,alg:()=>I_,json:()=>h6,version:()=>gfe});var pfe=Object.defineProperty,f6=(e,t)=>{for(var n in t)pfe(e,n,{get:t[n],enumerable:!0})},Vs=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=vd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=mfe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,pC(this._preds[i],s),pC(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?jb(this._isDirected,e):vd(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?jb(this._isDirected,e):vd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?jb(this._isDirected,e):vd(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],mC(this._preds[a],i),mC(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 pC(e,t){e[t]?e[t]++:e[t]=1}function mC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function vd(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 mfe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function jb(e,t){return vd(e,t.v,t.w,t.name)}var gfe="4.0.1",h6={};f6(h6,{read:()=>xfe,write:()=>yfe});function yfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:bfe(e),edges:Efe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function bfe(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 Efe(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 xfe(e){let t=new Vs(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 I_={};f6(I_,{CycleException:()=>Tg,bellmanFord:()=>p6,components:()=>_fe,dijkstra:()=>Sg,dijkstraAll:()=>Sfe,findCycles:()=>Tfe,floydWarshall:()=>Cfe,isAcyclic:()=>Rfe,postorder:()=>Lfe,preorder:()=>Mfe,prim:()=>jfe,shortestPaths:()=>Dfe,tarjan:()=>g6,topsort:()=>y6});var wfe=()=>1;function p6(e,t,n,r){return vfe(e,String(t),n||wfe,r||function(s){return e.outEdges(s)})}function vfe(e,t,n,r){let s={},i,a=0,l=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 Sg(e,t,n,r){let s=function(i){return e.outEdges(i)};return Nfe(e,String(t),n||kfe,r||s)}function Nfe(e,t,n,r){let s={},i=new m6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Sfe(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Sg(e,s,t,n),r},{})}function g6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 Tfe(e){return g6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Afe=()=>1;function Cfe(e,t,n){return Ife(e,t||Afe,n||function(r){return e.outEdges(r)})}function Ife(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=b6(e,l,n==="post",a,i,r,s)}),s}function b6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=b6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function E6(e,t,n){return Ofe(e,t,n,function(r,s){return r.push(s),r},[])}function Lfe(e,t){return E6(e,t,"post")}function Mfe(e,t){return E6(e,t,"pre")}function jfe(e,t){let n=new Vs,r={},s=new m6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function Dfe(e,t,n,r){return Pfe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function Pfe(e,t,n,r){if(n===void 0)return Sg(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 x6(e){let t=new Vs({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 gC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function wh(e){let t=Vf(v6(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 Ffe(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=Oi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function Ufe(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Oi(Math.min,t),r=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function yC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),ku(e,"border",s,t)}function $fe(e,t=w6){let n=[];for(let r=0;rw6){let n=$fe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function v6(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Oi(Math.max,t)}function Hfe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function _6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function k6(e,t){return t()}var zfe=0;function R_(e){let t=++zfe;return e+(""+t)}function Vf(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 Vfe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var z0="\0",Kfe="3.0.0",Yfe=class{constructor(){hfe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return bC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&bC(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,Wfe)),n=n._prev;return"["+e.join(", ")+"]"}};function bC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Wfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Gfe=Yfe,qfe=()=>1;function Xfe(e,t){if(e.nodeCount()<=1)return[];let n=Zfe(e,t||qfe);return Qfe(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function Qfe(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)Db(e,t,n,l);for(;l=i.dequeue();)Db(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(Db(e,t,n,l,!0)||[]);break}}}return s}function Db(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,xx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,xx(t,n,d)}),e.removeNode(r.v),a}function Zfe(e,t){let n=new Vs,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=Jfe(s+r+3).map(()=>new Gfe),a=r+1;return n.nodes().forEach(l=>{xx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function xx(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 Jfe(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,R_("rev"))});function t(n){return r=>n.edge(r).weight}}function the(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 nhe(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 rhe(e){e.graph().dummyChains=[],e.edges().forEach(t=>she(e,t))}function she(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 O_(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):[],l=Oi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function lu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var N6=ahe;function ahe(e){let t=new Vs({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(;ohe(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!lu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function lhe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=lu(t,r)),st.node(r).rank+=n)}var{preorder:uhe,postorder:dhe}=I_,fhe=vl;vl.initLowLimValues=M_;vl.initCutValues=L_;vl.calcCutValue=S6;vl.leaveEdge=A6;vl.enterEdge=C6;vl.exchangeEdges=I6;function vl(e){e=Bfe(e),O_(e);let t=N6(e);M_(t),L_(t,e);let n,r;for(;n=A6(t);)r=C6(t,e,n),I6(t,e,n,r)}function L_(e,t){let n=dhe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>hhe(e,t,r))}function hhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=S6(e,t,n)}function S6(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 l=t.nodeEdges(n);return l&&l.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,mhe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function M_(e,t){arguments.length<2&&(t=e.nodes()[0]),T6(e,{},1,t)}function T6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=T6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function A6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function C6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===EC(e,e.node(u.v),l)&&c!==EC(e,e.node(u.w),l)).reduce((u,d)=>lu(t,d)!e.node(s).parent);if(!n)return;let r=uhe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function mhe(e,t,n){return e.hasEdge(t,n)}function EC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var ghe=yhe;function yhe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":xC(e);break;case"tight-tree":Ehe(e);break;case"longest-path":bhe(e);break;case"none":break;default:xC(e)}}var bhe=O_;function Ehe(e){O_(e),N6(e)}function xC(e){fhe(e)}var xhe=whe;function whe(e){let t=_he(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=vhe(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 _he(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(z0).forEach(r),t}function khe(e){let t=ku(e,"root",{},"_root"),n=Nhe(e),r=Object.values(n),s=Oi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=She(e)+1;e.children(z0).forEach(l=>R6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function R6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=yC(e,"_bt"),d=yC(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;R6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function Nhe(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(z0).forEach(r=>n(r,1)),t}function She(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function The(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Ahe=Che;function Che(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;ivC(e.node(t))),e.edges().forEach(t=>vC(e.edge(t)))}function vC(e){let t=e.width;e.width=e.height,e.height=t}function Ohe(e){e.nodes().forEach(t=>Pb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Pb),Object.hasOwn(r,"y")&&Pb(r)})}function Pb(e){e.y=-e.y}function Lhe(e){e.nodes().forEach(t=>Bb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Bb),Object.hasOwn(r,"x")&&Bb(r)})}function Bb(e){let t=e.x;e.x=e.y,e.y=t}function Mhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Oi(Math.max,r),i=Vf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function jhe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Phe(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function Bhe(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 Fhe(r)}function Fhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Uhe(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=>Ag(s,["vs","i","barycenter","weight"]))}function Uhe(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 $he(e,t){let n=Hfe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Hhe(!!t)),c=_C(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=_C(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function _C(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 Hhe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function L6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=Phe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=L6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&Vhe(h,p)}});let d=Bhe(u,n);zhe(d,c);let f=$he(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function zhe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function Vhe(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 Khe(e,t,n,r){r||(r=e.nodes());let s=Yhe(e),i=new Vs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function Yhe(e){let t;for(;e.hasNode(t=R_("_root")););return t}function Whe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function M6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,M6);return}let n=v6(e),r=kC(e,Vf(1,n+1),"inEdges"),s=kC(e,Vf(n-1,-1,-1),"outEdges"),i=Mhe(e);if(NC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Ghe(u%2?r:s,u%4>=2,c),i=wh(e);let f=jhe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return Khe(e,i,n,r.get(i)||[])})}function Ghe(e,t,n){let r=new Vs;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=L6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Whe(s,r,a.vs)})}function NC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function qhe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=Qhe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&j6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function Qhe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function j6(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 Zhe(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 Jhe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function tpe(e,t,n,r){let s=new Vs,i=e.graph(),a=ape(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 npe(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=ope(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=r-Oi(Math.min,u);a!=="l"&&(d=s-Oi(Math.max,u)),d&&(e[l]=H0(c,f=>f+d))})})}function spe(e,t=void 0){let n=e.ul;return n?H0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function ipe(e){let t=wh(e),n=Object.assign(qhe(e,t),Xhe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=Jhe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=epe(e,s,c.root,c.align,l==="r");l==="r"&&(u=H0(u,d=>-d)),r[a+l]=u})});let i=npe(e,r);return rpe(r,i),spe(r,e.graph().align)}function ape(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function ope(e,t){return e.node(t).width}function lpe(e){e=x6(e),cpe(e),Object.entries(ipe(e)).forEach(([t,n])=>e.node(t).x=n)}function cpe(e){let t=wh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function upe(e,t={}){let n=t.debugTiming?_6:k6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>xpe(e));return n(" runLayout",()=>dpe(r,n,t)),n(" updateInputGraph",()=>fpe(e,r)),r})}function dpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>wpe(e)),t(" removeSelfEdges",()=>Ipe(e)),t(" acyclic",()=>ehe(e)),t(" nestingGraph.run",()=>khe(e)),t(" rank",()=>ghe(x6(e))),t(" injectEdgeLabelProxies",()=>vpe(e)),t(" removeEmptyRanks",()=>Ufe(e)),t(" nestingGraph.cleanup",()=>The(e)),t(" normalizeRanks",()=>Ffe(e)),t(" assignRankMinMax",()=>_pe(e)),t(" removeEdgeLabelProxies",()=>kpe(e)),t(" normalize.run",()=>rhe(e)),t(" parentDummyChains",()=>xhe(e)),t(" addBorderSegments",()=>Ahe(e)),t(" order",()=>M6(e,n)),t(" insertSelfEdges",()=>Rpe(e)),t(" adjustCoordinateSystem",()=>Ihe(e)),t(" position",()=>lpe(e)),t(" positionSelfEdges",()=>Ope(e)),t(" removeBorderNodes",()=>Cpe(e)),t(" normalize.undo",()=>ihe(e)),t(" fixupEdgeLabelCoords",()=>Tpe(e)),t(" undoCoordinateSystem",()=>Rhe(e)),t(" translateGraph",()=>Npe(e)),t(" assignNodeIntersects",()=>Spe(e)),t(" reversePoints",()=>Ape(e)),t(" acyclic.undo",()=>nhe(e))}function fpe(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 hpe=["nodesep","edgesep","ranksep","marginx","marginy"],ppe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},mpe=["acyclicer","ranker","rankdir","align","rankalign"],gpe=["width","height","rank"],SC={width:0,height:0},ype=["minlen","weight","width","height","labeloffset"],bpe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Epe=["labelpos"];function xpe(e){let t=new Vs({multigraph:!0,compound:!0}),n=Ub(e.graph());return t.setGraph(Object.assign({},ppe,Fb(n,hpe),Ag(n,mpe))),e.nodes().forEach(r=>{let s=Ub(e.node(r)),i=Fb(s,gpe);Object.keys(SC).forEach(l=>{i[l]===void 0&&(i[l]=SC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Ub(e.edge(r));t.setEdge(r,Object.assign({},bpe,Fb(s,ype),Ag(s,Epe)))}),t}function wpe(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 vpe(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};ku(e,"edge-proxy",s,"_ep")}})}function _pe(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 kpe(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 Npe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function Spe(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(gC(r,i)),n.points.push(gC(s,a))})}function Tpe(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 Ape(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Cpe(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 Ipe(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 Rpe(e){wh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{ku(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 Ope(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function Fb(e,t){return H0(Ag(e,t),Number)}function Ub(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Lpe(e){let t=wh(e),n=new Vs({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Mpe={graphlib:d6,version:Kfe,layout:upe,debug:Lpe,util:{time:_6,notime:k6}},TC=Mpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const _d={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:il},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:IM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:vM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:wv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:d0}},wx=220,vx=88,AC=96,CC=34,Zd=64,$b=310,dc=24,D6=56,_x=40,IC=40,jpe=18,Dpe=58,Ppe=!1,Bpe=e=>e==="sequential"||e==="parallel"||e==="loop";function kx(e,t){const n=e.agentType??"llm";return Bpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Nx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!kx(e,t))return{width:wx,height:vx};if(r&&e.subAgents.length===0)return{width:$b,height:Zd};const i=e.subAgents.map((f,h)=>Nx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?D6:dc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?jpe+IC:s==="loop"?Dpe:0:IC;return u?{width:Math.max($b,i.reduce((f,h)=>f+h.width,0)+_x*Math.max(0,i.length-1)+c*2),height:Zd+dc+l+d+dc}:{width:Math.max($b,a+dc*2),height:Zd+c+i.reduce((f,h)=>f+h.height,0)+_x*Math.max(0,i.length-1)+d+c}}function id(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Fpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function RC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function ad(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:nu.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 OC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=id(f);return kx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||_d[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=id(f),y=Nx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":_d[g].label),pattern:g,description:d.description.trim()||_d[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((T,S)=>Nx(T,[...f,S],t,n)),x=b.length&&g!=="parallel"?D6:dc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((T,S)=>{const R=b[S],I=_?{x:k,y:Zd+dc}:{x:(y.width-R.width)/2,y:Zd+k};return k+=(_?R.width:R.height)+_x,i(T,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let T=0;T1&&s.push(ad(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=id(f);if(kx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||_d[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=id(y);s.push(ad(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=id([]),u=l(e,[]);return s.push(ad("terminal-input",c)),u.forEach(d=>s.push(ad(d,"terminal-output"))),Upe(r,s,t)}function Upe(e,t,n){const r=new TC.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?AC:i.data.layoutWidth??wx,height:a?CC:i.data.layoutHeight??vx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),TC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?AC:i.data.layoutWidth??wx,u=l?CC:i.data.layoutHeight??vx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const V0=E.createContext(null),K0=E.createContext("horizontal");function $pe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(V0),[h,p]=E.useState(!1),[m,g,w]=kg({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(xh,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Dde,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(dr,{})})]})})]})}function Hpe({data:e,selected:t}){const n=E.useContext(V0),r=E.useContext(K0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,l=e.pattern??"llm",c=_d[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(kr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Fi,{})}),o.jsx(kr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(kr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(kr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function zpe({data:e,selected:t}){const n=E.useContext(V0),r=E.useContext(K0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(kr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(dr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(dr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(dr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(dr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Fi,{})}),o.jsx(kr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(kr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(kr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Vpe({data:e}){const t=E.useContext(K0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(kr,{type:"target",position:t==="vertical"?Fe.Top:Fe.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(kr,{type:"source",position:t==="vertical"?Fe.Bottom:Fe.Right,className:"abc-handle"})]})}const Kpe={agent:Hpe,group:zpe,terminal:Vpe},Ype={insertStep:$pe};function Wpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>OC(e,c,a),[]),[d,f,h]=r6(u.nodes),[p,m,g]=s6(u.edges),w=Bde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${RC(e)}`),b=E.useRef(null),{fitView:x}=U0(),_=E.useMemo(()=>OC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(T))})},[T,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),D=U=>N(U.matches);return I.addEventListener("change",D),()=>I.removeEventListener("change",D)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${RC(e)}`,D=I!==y.current;y.current=I,m(_.edges),f(U=>{const W=new Map(U.map(M=>[M.id,M.position]));return _.nodes.map(M=>({...M,position:!D&&W.get(M.id)?W.get(M.id):M.position,selected:M.data.kind==="agent"&&!!M.data.path&&Fpe(M.data.path,t)}))}),D&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(K0.Provider,{value:c,children:o.jsx(V0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(n6,{nodes:d,edges:p,nodeTypes:Kpe,edgeTypes:Ype,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,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||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(a6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(l6,{showInteractive:!1}),Ppe]})})})})})}function Cg(e){return o.jsx(C_,{children:o.jsx(Wpe,{...e})})}const Gpe="doubao-seed-2-1-pro-260628",qpe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Xpe=`你是一个专业、可靠的智能助手。 + +你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 + +约束: +- 信息不足时主动提问澄清,不要臆造事实。 +- 需要时合理调用可用的工具,并说明关键结论。 +- 保持礼貌、专业的语气。`;function Pr(){return{name:"",description:qpe,instruction:Xpe,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:Gpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Wc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}function Qpe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function Zpe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}const Jpe=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],eme=[{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"}]}],tme=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function P6(e){const t=e.tools??[],n=ol.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Pr(),name:e.name,description:e.description,instruction:e.instruction||Pr().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(P6)}}function nme(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?P6(e.graph):{...Pr(),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 B6(e){return e?1+e.children.reduce((t,n)=>t+B6(n),0):1}function F6(e){return 1+e.subAgents.reduce((t,n)=>t+F6(n),0)}function Sx(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function rme(e){const t=Sx(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function sme(e,t){return e.find(n=>n.kind===t)}function ime(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Ig=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],ame=Ig.findIndex(e=>e.phase==="build");function U6(e){if(e.status==="success")return Ig.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Ig.findIndex(r=>r.phase===t);return n<0?0:n}function ome(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function lme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&U6(e)===ame,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` +`),f=s?u:d.slice(-36).join(` +`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=ome(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(zs,{"aria-hidden":!0}):o.jsx(c0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function cme({task:e}){const t=U6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx(Ft,{className:"spin"}):e.status==="success"?o.jsx(SM,{}):e.status==="error"?o.jsx(l0,{}):o.jsx(NE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Ig.map((s,i)=>{const a=e.status==="success"||inew Set),[ze,le]=E.useState(()=>new Set),[Ee,ut]=E.useState(!1),[ft,X]=E.useState(""),[ee,me]=E.useState(null),[Le,Ye]=E.useState([]),[Ze,Pt]=E.useState([]),[bt,Bt]=E.useState(!1),[zt,Nt]=E.useState(""),[Ut,Be]=E.useState(0),[pt,Je]=E.useState(!1),[Re,It]=E.useState(()=>new Set),[St,ce]=E.useState(!1),[Ve,at]=E.useState(""),[rn,sn]=E.useState(""),[fn,Wt]=E.useState(()=>new Set),Jt=E.useRef(!1),Mn=E.useRef(null),Vn=E.useRef(""),Kn=E.useRef(null),[vt,an]=E.useState(eme),[ue,Se]=E.useState("");E.useEffect(()=>{e.length!==0&&an(V=>V.map((O,q)=>q===0&&O.agentIds.length===0?{...O,agentIds:e.slice(0,2).map(oe=>oe.id)}:O))},[e]);const ve=E.useMemo(()=>{const V=new Map;for(const O of e)O.runtimeId&&V.set(O.runtimeId,O);return V},[e]),Qe=E.useMemo(()=>{var O;const V=new Map;for(const q of t){const oe=(O=q.deploymentTarget)==null?void 0:O.runtimeId;if(!oe||!ve.has(oe))continue;const Pe=V.get(oe);(!Pe||q.updatedAt>Pe.updatedAt)&&V.set(oe,q)}return V},[ve,t]),ot=E.useMemo(()=>{const V=new Map;for(const O of d){if(!O.runtimeId)continue;const q=V.get(O.runtimeId);(!q||O.startedAt>q.startedAt)&&V.set(O.runtimeId,O)}return V},[d]),et=E.useMemo(()=>{const V=Q.trim().toLowerCase();return V?e.filter(O=>{const q=O.runtimeId?Qe.get(O.runtimeId):void 0,oe=O.runtimeId?ot.get(O.runtimeId):void 0;return[O.label,O.app,O.host??"",(q==null?void 0:q.draft.name)??"",(q==null?void 0:q.draft.description)??"",(oe==null?void 0:oe.runtimeName)??""].join(" ").toLowerCase().includes(V)}):e},[e,ot,Q,Qe]),lt=E.useMemo(()=>{const V=Q.trim().toLowerCase();return t.filter(O=>{var oe;const q=(oe=O.deploymentTarget)==null?void 0:oe.runtimeId;return q&&ve.has(q)?!1:V?`${O.draft.name} ${O.draft.description}`.toLowerCase().includes(V):!0})},[ve,t,Q]),Vt=E.useMemo(()=>t.filter(V=>{var q;const O=(q=V.deploymentTarget)==null?void 0:q.runtimeId;return!O||!ve.has(O)}).length,[ve,t]),Kt=E.useMemo(()=>{const V=Q.trim().toLowerCase();return V?vt.filter(O=>O.name.toLowerCase().includes(V)):vt},[vt,Q]),J=e.find(V=>V.id===$),rt=t.find(V=>V.id===j),Ue=f?d.find(V=>V.id===f):void 0,qe=J!=null&&J.runtimeId?Qe.get(J.runtimeId):void 0,Xe=g?z:$&&s===$?r:null,Rt=E.useMemo(()=>{const V=new Map(e.map((q,oe)=>[q.id,oe])),O=new Map(n.map((q,oe)=>[q,oe]));return[...et].sort((q,oe)=>{const Pe=q.runtimeId?ot.get(q.runtimeId):void 0,nt=oe.runtimeId?ot.get(oe.runtimeId):void 0,it=(Pe==null?void 0:Pe.status)==="running"?Pe.startedAt:0,tn=(nt==null?void 0:nt.status)==="running"?nt.startedAt:0;if(it!==tn)return tn-it;const We=O.get(q.id),Gt=O.get(oe.id);return We!=null&&Gt!=null?We-Gt:We!=null?-1:Gt!=null?1:(V.get(q.id)??0)-(V.get(oe.id)??0)})},[n,e,et,ot]),Yn=(J==null?void 0:J.label)||(Xe==null?void 0:Xe.name)||(rt==null?void 0:rt.draft.name)||(Ue==null?void 0:Ue.runtimeName)||"未选择智能体",Wn=vt.find(V=>V.id===ue),en=Rt.filter(V=>V.canDelete===!0),vn=Rt.filter(V=>gt.has(V.id)&&V.canDelete===!0),Yt=lt.filter(V=>ze.has(V.id)),_n=en.length+lt.length,kn=vn.length+Yt.length,Mt=E.useMemo(()=>(Ue==null?void 0:Ue.agentDraft)??(rt==null?void 0:rt.draft)??(qe==null?void 0:qe.draft)??nme(Xe,(J==null?void 0:J.label)??"agent"),[Xe,J==null?void 0:J.label,qe==null?void 0:qe.draft,rt==null?void 0:rt.draft,Ue==null?void 0:Ue.agentDraft]),Nn=E.useMemo(()=>{if(Xe)return Xe.tools;const V=(Mt.builtinTools??[]).map(O=>{var q;return((q=ol.find(oe=>oe.id===O))==null?void 0:q.label)??O});return Array.from(new Set([...Mt.tools,...V,...(Mt.customTools??[]).map(O=>O.name),...(Mt.mcpTools??[]).map(O=>O.name)].filter(Boolean)))},[Mt,Xe]),mr=E.useMemo(()=>Xe?Xe.skillsPreviewSupported?Xe.skills.map(V=>V.name):null:Array.from(new Set([...(Mt.selectedSkills??[]).map(V=>V.name),...Mt.skills].filter(Boolean))),[Mt,Xe]),Lt=E.useMemo(()=>{if(Ue)return Ue;if(rt)return d.filter(V=>{var O,q;return((O=V.agentDraft)==null?void 0:O.name)===rt.draft.name||V.runtimeName===rt.draft.name||!!((q=rt.deploymentTarget)!=null&&q.runtimeId)&&V.runtimeId===rt.deploymentTarget.runtimeId}).sort((V,O)=>O.startedAt-V.startedAt)[0];if(J)return d.filter(V=>!!J.runtimeId&&V.runtimeId===J.runtimeId||V.runtimeName===J.label).sort((V,O)=>O.startedAt-V.startedAt)[0]},[d,J,rt,Ue]),jn=!!(f&&Lt&&Lt.id===f),lr=!!(Lt&&(Lt.status!=="success"||jn)),gr=E.useMemo(()=>ime(Mt),[Mt]),Ar=(J==null?void 0:J.currentVersion)??(P==null?void 0:P.currentVersion)??null,Ks=Ar??(Ue==null?void 0:Ue.startedAt)??"unknown",Hr=Xe?`runtime:${(J==null?void 0:J.runtimeId)??Xe.name}:v${Ks}:${gr}`:`draft:${(Ue==null?void 0:Ue.id)??(rt==null?void 0:rt.id)??(J==null?void 0:J.id)??Yn}:${gr}`,ns=!!(g&&(J!=null&&J.runtimeId)&&!B);E.useEffect(()=>{if(!f)return;const V=d.find(q=>q.id===f),O=V!=null&&V.runtimeId?ve.get(V.runtimeId):void 0;if(O){L(""),C(O.id),M("basic");return}C(""),L(""),M("basic")},[ve,d,f]),E.useEffect(()=>{if(!h){Vn.current="";return}const V=`${h}:${p}:${m}`;Vn.current!==V&&e.some(O=>O.id===h)&&(Vn.current=V,L(""),C(h),M(p),p==="evaluations"&&(te(m),ne("")))},[e,h,p,m]),E.useEffect(()=>{let V=!1;if(G(null),re(!g||!(J!=null&&J.runtimeId)||!J.region),!(!g||!(J!=null&&J.runtimeId)||!J.region))return Ov(J.runtimeId,J.region,J.runtimeApp).then(O=>{V||G(O)}).catch(()=>{V||G(null)}).finally(()=>{V||re(!0)}),()=>{V=!0}},[g,J==null?void 0:J.currentVersion,J==null?void 0:J.region,J==null?void 0:J.runtimeApp,J==null?void 0:J.runtimeId]),E.useEffect(()=>{let V=!1;if(A(null),!(!(J!=null&&J.runtimeId)||!J.region))return Lv(J.runtimeId,J.region).then(O=>{V||A(O)}).catch(()=>{V||A(null)}),()=>{V=!0}},[J==null?void 0:J.currentVersion,J==null?void 0:J.region,J==null?void 0:J.runtimeId]),E.useEffect(()=>{let V=!1;if(Ye([]),Pt([]),Nt(""),W!=="evaluations"||!(J!=null&&J.runtimeId)||!J.region){Bt(!1);return}return Bt(!0),VM({runtimeId:J.runtimeId,region:J.region,appName:J.app,pageSize:100}).then(O=>{V||(Pt(O.sets),Ye(O.items.map(q=>({...q,tag:q.kind==="good"?"Good case":"Bad case"})).sort((q,oe)=>Sx(oe.createdAt)-Sx(q.createdAt))))}).catch(O=>{V||Nt(O instanceof Error?O.message:String(O))}).finally(()=>{V||Bt(!1)}),()=>{V=!0}},[Ut,W,J==null?void 0:J.app,J==null?void 0:J.region,J==null?void 0:J.runtimeId]),E.useEffect(()=>{const V=new Set(Le.map(O=>O.id));It(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q}),Wt(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q}),rn&&!V.has(rn)&&sn("")},[Le,rn]),E.useEffect(()=>{Je(!1),It(new Set),Wt(new Set),at(""),sn("")},[J==null?void 0:J.runtimeId]),E.useEffect(()=>{const V=new Set(Rt.filter(O=>O.canDelete===!0).map(O=>O.id));Ge(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q})},[Rt]),E.useEffect(()=>{const V=new Set(lt.map(O=>O.id));le(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q})},[lt]),E.useEffect(()=>{var q;if(!ee)return;const V=document.body.style.overflow;document.body.style.overflow="hidden",(q=Mn.current)==null||q.focus();const O=oe=>{oe.key==="Escape"&&!Ee&&me(null)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=V,window.removeEventListener("keydown",O)}},[ee,Ee]);const Ys=J!=null&&J.runtimeId?Le:Jpe,Es=Ys.filter(V=>{if(V.kind!==de)return!1;const O=pe.trim().toLowerCase();return O?[V.input,V.output,V.referenceOutput,V.comment,V.tag??"",V.sessionId,V.messageId,V.userId,V.evaluationSetName].join(" ").toLowerCase().includes(O):!0}),Vi=Es.filter(V=>Re.has(V.id)),Cr=!!(J!=null&&J.runtimeId),Ki=V=>{te(V),ne(""),at("");const O=Ys.find(q=>q.kind===V);sn((O==null?void 0:O.id)??""),window.setTimeout(()=>{var q;(q=Kn.current)==null||q.scrollIntoView({behavior:"smooth",block:"start"})},0)},xa=V=>{at(""),It(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q})},vi=()=>{at(""),It(new Set(Es.map(V=>V.id)))},Iu=()=>{at(""),It(new Set),Je(!1)},Ws=V=>{Wt(O=>{const q=new Set(O);return q.has(V)?q.delete(V):q.add(V),q})},Ru=V=>{sn(V.id),at(""),!(!V.sessionId||!V.messageId)&&(N==null||N(V))},xs=async V=>{if(!(J!=null&&J.runtimeId)||!J.region||St||V.length===0)return;const O=V.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${V.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(O))return;const q=V.map(Pe=>Pe.id),oe=new Set(q);ce(!0),at("");try{await KM({runtimeId:J.runtimeId,region:J.region,appName:J.app,itemIds:q});const Pe=new Map;for(const nt of V)Pe.set(nt.kind,(Pe.get(nt.kind)??0)+1);Ye(nt=>nt.filter(it=>!oe.has(it.id))),Pt(nt=>nt.map(it=>({...it,itemCount:Math.max(0,it.itemCount-(Pe.get(it.kind)??0))}))),It(nt=>new Set([...nt].filter(it=>!oe.has(it)))),Wt(nt=>new Set([...nt].filter(it=>!oe.has(it)))),rn&&oe.has(rn)&&sn(""),V.length>1&&Je(!1),T==null||T(V)}catch(Pe){at(Pe instanceof Error?Pe.message:String(Pe))}finally{ce(!1)}},ws=V=>{an(O=>O.map(q=>q.id===V.id?V:q))},wa=()=>{const V=new Set(e.map(oe=>oe.id)),O=n.filter(oe=>V.has(oe)),q=new Set(O);return[...O,...e.filter(oe=>!q.has(oe.id)).map(oe=>oe.id)]},nr=(V,O,q)=>{if(!y||V===O)return;const oe=wa().filter(it=>it!==V),Pe=oe.indexOf(O),nt=Pe<0?oe.length:q==="after"?Pe+1:Pe;oe.splice(nt,0,V),y(oe)},va=(V,O)=>{if(!ye||ye===O)return;const q=V.currentTarget.getBoundingClientRect();xe(O),Ae(V.clientY>q.top+q.height/2?"after":"before")},Yi=(V,O)=>{if(!y)return;const q=wa(),oe=q.indexOf(V),Pe=Math.max(0,Math.min(q.length-1,oe+O));oe<0||oe===Pe||(q.splice(oe,1),q.splice(Pe,0,V),y(q))},Nl=V=>{V.canDelete===!0&&(X(""),Ge(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q}))},Sl=V=>{X(""),le(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q})},_a=()=>{X(""),Ge(new Set(en.map(V=>V.id))),le(new Set(lt.map(V=>V.id)))},ka=()=>{X(""),Ge(new Set),le(new Set),Ce(!1)},Na=()=>{if(kn===0||Ee)return;const V=vn.length,O=Yt.length;X(""),me({kind:"selection",title:V===1&&O===0?"删除 Agent?":V===0&&O===1?"删除草稿?":"删除所选项目?",description:V===1&&O===0?`"${vn[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:V===0&&O===1?`"${Yt[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${kn} 个项目。${V>0?`${V} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:V===0&&O===1?"删除草稿":"删除所选",agents:vn,drafts:Yt})},Tl=async()=>{if(!(!ee||Ee)){ut(!0),X("");try{if(ee.kind==="selection"){const{agents:V,drafts:O}=ee;if(V.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(V)}O.length>0&&(x==null||x(O)),Ge(new Set),le(new Set),Ce(!1),V.some(q=>q.id===$)&&C(""),O.some(q=>q.id===j)&&L("")}else if(ee.kind==="agent"){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b([ee.agent]),$===ee.agent.id&&C("")}else{if(!x)throw new Error("当前页面不支持删除草稿。");x([ee.draft]),j===ee.draft.id&&L("")}me(null)}catch(V){X(V instanceof Error?V.message:String(V))}finally{ut(!1)}}},bo=V=>{!b||V.canDelete!==!0||Ee||(X(""),me({kind:"agent",title:"删除 Agent?",description:`"${V.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:V}))},Gs=V=>{if(!x||Ee)return;const O=V.draft.name||"未命名 Agent";X(""),me({kind:"draft",title:"删除草稿?",description:`"${O}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:V})},_t=()=>{const V=`eval-${Date.now()}`,O={id:V,name:`新评测组 ${vt.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};an(q=>[O,...q]),Se(V)},Eo=V=>{ws({...V,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+V.history.length%7,status:"completed"},...V.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:D==="library"?"is-active":"","aria-pressed":D==="library",onClick:()=>{U("library"),se("")},children:"智能体库"}),o.jsx("button",{type:"button",className:D==="evaluation"?"is-active":"","aria-pressed":D==="evaluation",onClick:()=>{U("evaluation"),se("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":D==="evaluation"||void 0,ref:V=>V==null?void 0:V.toggleAttribute("inert",D==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":D==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(Sf,{"aria-hidden":!0}),o.jsx("input",{value:Q,onChange:V=>se(V.currentTarget.value),placeholder:D==="library"?"搜索智能体":"搜索评测组","aria-label":D==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:D==="library"?S:_t,disabled:D==="library"&&!a,children:[o.jsx(dr,{"aria-hidden":!0}),o.jsx("span",{children:D==="library"?"新建 Agent":"新建评测组"})]}),D==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${He?" is-active":""}`,children:He?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",kn," 个"]}),o.jsx("button",{type:"button",onClick:_a,disabled:_n===0||Ee,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Na(),disabled:kn===0||Ee,children:Ee?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:ka,disabled:Ee,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{X(""),Ce(!0)},disabled:_n===0,children:"选择"})}),D==="library"&&ft&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ft}),o.jsx("div",{className:"aw-agent-list",children:D==="evaluation"?Kt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Kt.map(V=>o.jsxs("button",{type:"button",className:`aw-agent-item${V.id===ue?" is-active":""}`,onClick:()=>Se(V.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:V.name}),o.jsxs("small",{children:[V.agentIds.length," 个智能体 · ",V.history.length," 次运行"]})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)):c&&Rt.length===0&<.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&Rt.length===0&<.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):Rt.length===0&<.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[lt.map(V=>{const O=d.filter(oe=>{var Pe,nt;return((Pe=oe.agentDraft)==null?void 0:Pe.name)===V.draft.name||oe.runtimeName===V.draft.name||!!((nt=V.deploymentTarget)!=null&&nt.runtimeId)&&oe.runtimeId===V.deploymentTarget.runtimeId}).sort((oe,Pe)=>Pe.startedAt-oe.startedAt)[0],q=ze.has(V.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",He?"is-selecting":"",q?"is-selected-for-delete":"",V.id===j?"is-active":""].filter(Boolean).join(" "),"aria-pressed":He?q:void 0,onClick:()=>{if(He){Sl(V);return}C(""),L(V.id),M("basic")},children:[He&&o.jsx("span",{className:`aw-select-marker${q?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:V.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(O==null?void 0:O.status)==="running"?" is-deploying":""}`,children:(O==null?void 0:O.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:V.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)}),Rt.map(V=>{const O=V.runtimeId?ot.get(V.runtimeId):void 0,q=V.runtimeId?Qe.get(V.runtimeId):void 0,oe=gt.has(V.id),Pe=V.canDelete===!0,nt=(O==null?void 0:O.status)==="running"?{label:"部署中",className:" is-deploying"}:(O==null?void 0:O.status)==="error"?{label:"失败",className:" is-error"}:(O==null?void 0:O.status)==="cancelled"?{label:"已取消",className:" is-muted"}:q?{label:"待更新",className:""}:null,it=(O==null?void 0:O.status)==="running"?"正在更新部署":q?"待更新":V.remote?V.host||"远程智能体":"本地智能体",tn=["aw-agent-item","aw-agent-item--sortable",V.id===$?"is-active":"",He?"is-selecting":"",oe?"is-selected-for-delete":"",He&&!Pe?"is-selection-disabled":"",V.id===ye?"is-dragging":"",V.id===be&&V.id!==ye?`is-drop-target is-drop-${ke}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!He,className:tn,"aria-pressed":He?oe:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:We=>{y&&(Jt.current=!0,ge(V.id),We.dataTransfer.effectAllowed="move",We.dataTransfer.setData("text/plain",V.id))},onDragEnter:We=>{va(We,V.id)},onDragOver:We=>{!ye||ye===V.id||(We.preventDefault(),We.dataTransfer.dropEffect="move",va(We,V.id))},onDragLeave:We=>{const Gt=We.relatedTarget;Gt instanceof Node&&We.currentTarget.contains(Gt)||be===V.id&&xe("")},onDrop:We=>{We.preventDefault();const Gt=We.dataTransfer.getData("text/plain")||ye;nr(Gt,V.id,ke),ge(""),xe(""),Ae("before")},onDragEnd:()=>{ge(""),xe(""),Ae("before"),window.setTimeout(()=>{Jt.current=!1},0)},onKeyDown:We=>{We.altKey&&(We.key==="ArrowUp"?(We.preventDefault(),Yi(V.id,-1)):We.key==="ArrowDown"&&(We.preventDefault(),Yi(V.id,1)))},onClick:We=>{if(He){We.preventDefault(),Nl(V);return}if(Jt.current){We.preventDefault(),Jt.current=!1;return}L(""),C(V.id),M("basic"),_(V.id)},children:[He&&o.jsx("span",{className:`aw-select-marker${oe?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:V.label}),V.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",V.currentVersion]}),nt&&o.jsx("span",{className:`aw-draft-badge${nt.className}`,children:nt.label})]}),o.jsx("small",{children:it})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",D==="library"?e.length+Vt:vt.length," 个"]})]}),D==="evaluation"&&Wn?o.jsx(fme,{group:Wn,agents:e,cases:Ys,onChange:ws,onRun:Eo}):D==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!J&&!rt&&!Ue?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[J&&!Xe&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Yn}),Ar!=null&&o.jsxs("span",{children:["v",Ar]}),rt&&o.jsx("span",{children:"草稿"}),qe&&o.jsx("span",{children:"待更新"}),!J&&!rt&&Ue&&o.jsx("span",{children:Ue.label})]}),o.jsx("p",{children:Mt.description||(i||g&&!B?"正在读取智能体信息…":"暂无描述")})]}),(rt||qe||(J==null?void 0:J.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(rt||qe)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const V=rt??qe;V&&Gs(V)},disabled:Ee,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(Fi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(J==null?void 0:J.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void bo(J),disabled:Ee,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(Fi,{"aria-hidden":!0}),o.jsx("span",{children:Ee?"删除中…":"删除 Agent"})]})]})]}),Lt&&lr&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(cme,{task:Lt})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:tme.map(V=>o.jsx("button",{type:"button",className:W===V.id?"is-active":"","aria-pressed":W===V.id,onClick:()=>M(V.id),children:V.label},V.id))}),o.jsxs("div",{className:"aw-content",children:[W==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(P==null?void 0:P.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(P==null?void 0:P.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(P==null?void 0:P.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(P==null?void 0:P.region)||(J==null?void 0:J.region)||(Lt==null?void 0:Lt.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:P!=null&&P.networkTypes.length?P.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:ns?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Cg,{draft:Mt,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Hr)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(Xe==null?void 0:Xe.model)||Mt.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:Xe!=null&&Xe.graph?B6(Xe.graph):F6(Mt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:Nn.length?Nn.map(V=>o.jsx("span",{children:V},V)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:mr===null?"暂不支持预览":mr.length?mr.map(V=>o.jsx("span",{children:V},V)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:Ar!=null?`v${Ar}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:rt?"草稿":(Lt==null?void 0:Lt.status)==="error"?"部署失败":(Lt==null?void 0:Lt.status)==="cancelled"?"已取消":qe?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([V,O])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:V}),o.jsx("small",{children:O})]})]},V))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),W==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[J!=null&&J.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(V=>{const O=sme(Ze,V),q=(O==null?void 0:O.itemCount)??Le.filter(oe=>oe.kind===V).length;return o.jsxs("button",{type:"button",onClick:()=>Ki(V),children:[o.jsx("strong",{children:q}),o.jsx("span",{children:V==="good"?"Good cases":"Bad cases"})]},V)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(V=>o.jsx("button",{type:"button",className:de===V?"is-active":"","aria-pressed":de===V,onClick:()=>te(V),children:V==="good"?"Good case":"Bad case"},V))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(Sf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:pe,onChange:V=>ne(V.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),Cr&&o.jsx("div",{className:`aw-case-toolbar${pt?" is-active":""}`,children:pt?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Vi.length," 条"]}),o.jsx("button",{type:"button",onClick:vi,disabled:Es.length===0||St,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void xs(Vi),disabled:Vi.length===0||St,children:St?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Iu,disabled:St,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{at(""),Je(!0)},disabled:Es.length===0||St,children:"选择案例"})}),Ve&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Ve}),o.jsx("div",{ref:Kn,children:o.jsx(dme,{cases:Es,loading:bt,error:zt,runtimeBacked:!!(J!=null&&J.runtimeId),selectionMode:pt,selectedCaseIds:Re,focusedCaseId:rn,expandedCaseIds:fn,deleting:St,canDelete:Cr,onOpenCase:Ru,onToggleCase:xa,onToggleExpanded:Ws,onDeleteCase:V=>void xs([V]),onRetry:()=>Be(V=>V+1)})})]})]}),W==="basic"&&(J||rt)&&o.jsxs("div",{className:"aw-basic-actions",children:[J&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(J.id),children:[o.jsx(iV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:rt||qe?!a:!(J!=null&&J.runtimeId)||!l||!i&&!Xe,onClick:()=>rt?I==null?void 0:I(rt):qe?I==null?void 0:I(qe):R(Mt),children:rt||qe?"继续编辑":"更新"})]})]})]}),D==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),ee&&ps.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:V=>{V.target===V.currentTarget&&!Ee&&me(null)},children:o.jsxs("section",{className:"studio-confirm-dialog studio-confirm-dialog--danger",role:"alertdialog","aria-modal":"true","aria-labelledby":"aw-delete-confirm-title","aria-describedby":"aw-delete-confirm-description","aria-busy":Ee||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(Qpe,{})}),o.jsx("h2",{id:"aw-delete-confirm-title",children:ee.title})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:()=>me(null),disabled:Ee,"aria-label":"关闭删除确认",children:o.jsx(Zpe,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:"aw-delete-confirm-description",children:ee.description})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:Mn,type:"button",onClick:()=>me(null),disabled:Ee,children:"取消"}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:()=>void Tl(),disabled:Ee,children:Ee?"删除中...":ee.confirmLabel})]})]})}),document.body)]})}function dme({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(Fi,{"aria-hidden":!0})})]}),o.jsx("small",{children:rme(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function fme({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Gz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(zs,{}),"已完成"]}),o.jsx(Fd,{"aria-hidden":!0})]},f.id))})]})})]})}const LC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],hme=100,pme=3e4,fc=new Map,Ac=new Map,mme=new Set;function MC(e){if(!e){fc.clear(),Ac.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,r]of Ac)r.page.runtimes.some(s=>t.has(s.runtimeId))&&Ac.delete(n);fc.clear()}}function gme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function yme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function bme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Eme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function jC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:xme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function wme(e,t,n){const r=`${e}:${t}`,s=Ac.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(jC)),s.page.nextToken;s&&Ac.delete(r);let i=fc.get(r);i||(i=kc({scope:"mine",region:e,pageSize:hme,nextToken:t}),fc.set(r,i),i.then(()=>fc.delete(r),()=>fc.delete(r)));const a=await i;return Ac.set(r,{page:a,expiresAt:Date.now()+pme}),n(a.runtimes.map(jC)),a.nextToken}function vme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function _me({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s="",hiddenRuntimeIds:i=mme}){const a=E.useRef(null),l=E.useRef(null),c=E.useRef(0),[u,d]=E.useState("general"),[f,h]=E.useState("cn-beijing"),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState([]),[x,_]=E.useState(""),[k,N]=E.useState(!0),[T,S]=E.useState(""),[R,I]=E.useState(""),D=E.useCallback((z,G)=>{const B=++c.current;return N(!0),S(""),wme(f,z,re=>{c.current===B&&b(Q=>G?re:[...Q,...re])}).then(re=>{c.current===B&&_(re)}).catch(re=>{c.current===B&&S(re instanceof Error?re.message:String(re))}).finally(()=>{c.current===B&&N(!1)})},[f]);E.useEffect(()=>(b([]),_(""),D("",!0),()=>{c.current+=1}),[D]),E.useEffect(()=>{const z=l.current,G=a.current;if(!z||!G||u!=="general"||!x||k)return;const B=new IntersectionObserver(([re])=>{re.isIntersecting&&D(x,!1)},{root:G,rootMargin:"180px 0px",threshold:.01});return B.observe(z),()=>B.disconnect()},[u,D,k,x]);const U=E.useCallback(async z=>{if(!R){I(z.id);try{await new Promise(G=>requestAnimationFrame(()=>G())),await n(z)}finally{I("")}}},[R,n]),W=E.useMemo(()=>{if(u!=="general")return[];const z=g.trim().toLocaleLowerCase(),G=z?y.filter(Q=>Q.name.toLocaleLowerCase().includes(z)):y,B=i.size>0?G.filter(Q=>!Q.runtime||!i.has(Q.runtime.runtimeId)):G,re=B.findIndex(Q=>{var se;return((se=Q.runtime)==null?void 0:se.runtimeId)===s});return re<=0?B:[B[re],...B.slice(0,re),...B.slice(re+1)]},[u,s,i,g,y]),M=LC.find(z=>z.id===u),$=(M==null?void 0:M.label)??"智能体",C=(M==null?void 0:M.createLabel)??"添加智能体",j=u==="general"&&k&&y.length===0,L=!j&&W.length===0,P=u==="openclaw"||u==="hermes"?"暂未开放":g.trim()?"没有匹配的智能体":`${$}暂无内容`,A=u==="general"?()=>e(f):u==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:z=>{z.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(z=>!z),children:[o.jsx("span",{children:f==="cn-beijing"?"北京":"上海"}),o.jsx(bme,{className:`my-agents-region-chevron${p?" is-open":""}`})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(z=>{const G=z.value===f;return o.jsxs("button",{type:"button",role:"option","aria-selected":G,className:`my-agents-region-option${G?" is-selected":""}`,onClick:()=>{h(z.value),m(!1)},children:[o.jsx("span",{children:z.label}),G&&o.jsx(Eme,{})]},z.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(gme,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:g,onChange:z=>w(z.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:LC.map(z=>o.jsx("button",{type:"button",className:`my-agent-type-pill${u===z.id?" is-active":""}`,"aria-pressed":u===z.id,onClick:()=>d(z.id),children:z.label},z.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!A,onClick:()=>A==null?void 0:A(),children:[o.jsx(yme,{}),C]})]}),o.jsxs("section",{className:"my-agent-results",ref:a,"aria-label":`${$}列表`,children:[j?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):T&&u==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T}),o.jsx("button",{type:"button",onClick:()=>void D("",!0),children:"重新加载"})]}):L?o.jsxs("div",{className:"my-agent-empty",children:[!g.trim()&&u==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(f),children:"点此创建"})]}):o.jsx("p",{children:P}),g.trim()&&u!=="openclaw"&&u!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:W.map(z=>{var G;return o.jsx(vme,{agent:z,onUse:U,onViewDetails:r,connecting:z.id===R,connected:((G=z.runtime)==null?void 0:G.runtimeId)===s},z.id)})}),u==="general"&&W.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:l,"aria-live":"polite",children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):x?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const kme={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 Nme(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 Sme(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Tme(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function j_(e,t){if(Sme(e))return Nme(t,e.path);if(Tme(e)){const n=kme[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=j_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Ame(e,t){const n=j_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const $6=new Map;function _l(e,t){$6.set(e,t)}function Cme(e){return $6.get(e)}function Ime(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;ij_(r,e.dataModel),resolveString:r=>Ame(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Cme(s.component)??Rme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Lme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 D_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(al,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(pr,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(kM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(pr,{})}):null]}):null]})}function P_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function z6(e){var n,r,s,i;const t=P_(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 V6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function K6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?QM(t,e.uri):""}function Mme({kind:e}){return e==="image"?o.jsx(xv,{}):e==="video"?o.jsx(TM,{}):e==="pdf"?o.jsx(Yz,{}):o.jsx(bv,{})}function B_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=P_(a.mimeType),c=K6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(hV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Mme,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:z6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(Ft,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":V6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(_c,{className:"media-card-open"}):null]});return o.jsxs(Zt.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(xM,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(pr,{})}):null]},a.id)})}),o.jsx(oi,{children:s?o.jsx(jme,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function jme({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>K6(t,e),[e,t]),s=P_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(Zt.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:o.jsxs(Zt.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[z6(t),t.sizeBytes?` · ${V6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(u0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(pr,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(Ft,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(ph,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Dme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 Pme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 Y6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Bme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function Fme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Ume(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function $me(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Hme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function W6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function zme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(ma,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(W6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Vme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Dme},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Hme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Pme},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:Y6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:Bme},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Fme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Ume},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:$me}};function Kme(e){return Vme[e]}const G6="send_a2ui_json_to_client",Yme=28;function Wme(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Gme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function q6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function qme({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 Xme(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 Qme(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 X6({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=q6(c,!t||n,r),{ref:d,onScroll:f}=Lme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(qme,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(ma,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx(Ds,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function Q6(){return o.jsx(X6,{text:"",done:!1})}const Zme=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=q6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:s})}):null});function Jme({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===G6?"渲染 UI":e,l=Kme(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 o.jsxs(Zt.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(zme,{definition:l,label:Qme(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(Xme,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(ma,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(W6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function ege({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx(Ft,{className:"spin"}):o.jsx(yv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx(Ft,{className:"spin"}):o.jsx(u0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(pr,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function tge({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(Zt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(uT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(Zt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(uT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(Ft,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function F_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(X6,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(Zme,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx(B_,{appName:t,items:c.files},u);case"artifact":return o.jsx(ege,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(D_,{value:c.value},u);case"tool":return c.name===G6&&c.done?null:o.jsx(Jme,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(tge,{block:c,onAuth:i},u);case"a2ui":return H6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(Zt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Ome,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function Z6(e){return e.isComposing||e.keyCode===229}const nge="/assets/arkclaw-DG3MhHYM.png",rge="/assets/codex-Csw-JJxq.png",sge="/assets/hermes-C6L-CfGS.png",ei=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],ige=[{label:"ArkClaw",logo:nge},{label:"Hermes 智能体",logo:sge}];function DC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Kc,{className:"new-chat-mode__agent-icon"})}function age(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function oge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>ei.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=ei.find(k=>k.value===e)??ei[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var T;(T=f.current)!=null&&T.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+ei.length)%ei.length;while(w(ei[N]));d(N),c(ei[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(ei.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(ei[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(DC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(ei[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:ei.map((k,N)=>{const T=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(DC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),T?o.jsx(age,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:rge,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),ige.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const J6={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},lge={ppt:[],image:[],video:["video_task_query"]},U_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function PC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function cge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function uge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function dge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const fge=[{icon:cge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:uge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:dge,text:"帮我整理并润色一段内容,让表达更清晰"}],BC=[{value:"ppt",label:"PPT",icon:cV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:xv,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:Y6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function hge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:T,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:D=!1,builtinTools:U=[]}){const W=E.useRef(null),M=E.useRef(null),$=E.useRef(null),C=E.useRef(null),[j,L]=E.useState(!1),[P,A]=E.useState(null),[z,G]=E.useState(0),[B,re]=E.useState(!1);async function Q(){if(e)try{await navigator.clipboard.writeText(e),re(!0),setTimeout(()=>re(!1),1500)}catch{re(!1)}}E.useLayoutEffect(()=>{const le=W.current;le&&(le.style.height="auto",le.style.height=`${Math.min(le.scrollHeight,200)}px`)},[s]);const se=x==="skill-create";E.useEffect(()=>{se&&(L(!1),A(null))},[se]);const de=!se&&d.some(le=>le.status!=="ready"),te=!l&&!c&&!de&&(s.trim().length>0||!se&&d.length>0),pe=(P==null?void 0:P.query.toLocaleLowerCase())??"",ne=(P==null?void 0:P.kind)==="skill"?f.filter(le=>!p.skills.some(Ee=>Ee.name===le.name)).filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(pe)).map(le=>({kind:"skill",value:le})):(P==null?void 0:P.kind)==="agent"?h.filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(pe)).map(le=>({kind:"agent",value:le})):[];function ye(le){var Ee;L(!1),A(null),(Ee=le.current)==null||Ee.click()}function ge(le){i(le),L(!1),A(null),requestAnimationFrame(()=>{var Ee,ut;(Ee=W.current)==null||Ee.focus(),(ut=W.current)==null||ut.setSelectionRange(le.length,le.length)})}function be(le){S==null||S(le.value),L(!1),A(null),requestAnimationFrame(()=>{var Ee,ut;(Ee=W.current)==null||Ee.focus(),(ut=W.current)==null||ut.setSelectionRange(s.length,s.length)})}function xe(le){i(le),L(!1),A(null),requestAnimationFrame(()=>{var ft,X,ee;(ft=W.current)==null||ft.focus();const Ee=le.indexOf("【"),ut=le.indexOf("】",Ee+1);Ee>=0&&ut>Ee?(X=W.current)==null||X.setSelectionRange(Ee+1,ut):(ee=W.current)==null||ee.setSelectionRange(le.length,le.length)})}function ke(){S==null||S(null),i(""),L(!1),A(null),requestAnimationFrame(()=>{var le,Ee;(le=W.current)==null||le.focus(),(Ee=W.current)==null||Ee.setSelectionRange(0,0)})}const Ae=BC.find(le=>le.value===_),He=BC.filter(le=>J6[le.value].every(Ee=>U.includes(Ee)));function Ce(le,Ee){const ut=le.slice(0,Ee),ft=/(^|\s)([/@])([^\s/@]*)$/.exec(ut);if(!ft){A(null);return}const X=ft[2].length+ft[3].length,ee={kind:ft[2]==="/"?"skill":"agent",query:ft[3],start:Ee-X,end:Ee},me=!P||P.kind!==ee.kind||P.query!==ee.query||P.start!==ee.start||P.end!==ee.end;A(ee),me&&G(0),L(!1)}function gt(le){if(!P)return;const Ee=s.slice(0,P.start)+s.slice(P.end);i(Ee),le.kind==="skill"?w({...p,skills:[...p.skills,le.value]}):w({skills:[],targetAgent:le.value});const ut=P.start;A(null),requestAnimationFrame(()=>{var ft,X;(ft=W.current)==null||ft.focus(),(X=W.current)==null||X.setSelectionRange(ut,ut)})}function Ge(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function ze(le){const Ee=le.target.files?Array.from(le.target.files):[];Ee.length&&y(Ee),le.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${se?" composer--skill-mode":""}${Ae?` composer--has-task composer--task-${Ae.value}`:""}`,children:[se?null:o.jsx(D_,{value:p,onRemoveSkill:le=>w({...p,skills:p.skills.filter(Ee=>Ee.name!==le)}),onRemoveAgent:()=>w({skills:[]})}),!se&&d.length>0&&o.jsx(B_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[P?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":P.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[P.kind==="skill"?o.jsx(al,{}):o.jsx(kM,{}),o.jsx("span",{children:P.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:P.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(Ft,{className:"spin"})," 正在读取 Agent 能力…"]}):ne.length===0?o.jsx("div",{className:"composer-command-empty",children:P.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:ne.map((le,Ee)=>o.jsxs("button",{type:"button",role:"option","aria-selected":Ee===z,className:`composer-command-item${Ee===z?" is-active":""}`,onMouseDown:ut=>{ut.preventDefault(),gt(le)},onMouseEnter:()=>G(Ee),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${le.kind}`,children:le.kind==="skill"?o.jsx(al,{}):o.jsx(il,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[le.kind==="skill"?"/":"@",le.value.name]}),o.jsx("span",{children:le.value.description||(le.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:Ee===z?"↵":le.kind==="skill"?"技能":"Agent"})]},`${le.kind}-${le.value.name}`))})]}):null,se?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{A(null),L(le=>!le)},children:o.jsx(dr,{className:"icon"})}),j&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye(M),children:[o.jsx(xv,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye($),children:[o.jsx(bv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye(C),children:[o.jsx(TM,{className:"icon"}),"上传视频"]})]})]})]}),N&&T?o.jsx(oge,{value:x,onChange:T,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Ae&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Ae.value}`,"aria-label":`取消${Ae.label}任务`,disabled:c,onClick:ke,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Ae.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(pr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Ae.label})]}):null,k&&se&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(PC,{className:"new-chat-task-chip__task-icon"}),o.jsx(pr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:W,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:se?`描述你想创建的 Skill,将使用 ${U_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!P,onChange:le=>{i(le.target.value),se||Ce(le.target.value,le.target.selectionStart)},onSelect:le=>{se||Ce(le.currentTarget.value,le.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:le=>{if(!Z6(le.nativeEvent)){if(P){if(le.key==="ArrowDown"&&ne.length>0){le.preventDefault(),G(Ee=>(Ee+1)%ne.length);return}if(le.key==="ArrowUp"&&ne.length>0){le.preventDefault(),G(Ee=>(Ee-1+ne.length)%ne.length);return}if((le.key==="Enter"||le.key==="Tab")&&ne[z]){le.preventDefault(),gt(ne[z]);return}if(le.key==="Escape"){le.preventDefault(),A(null);return}}if(le.key==="Backspace"&&!s&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){Ge();return}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),te&&a())}}})}),o.jsx(Zt.button,{type:"button",className:"comp-send",disabled:!te,onClick:a,"aria-label":"发送",whileTap:te?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx(Ft,{className:"icon spin"}):o.jsx(_M,{className:"icon"})})]}),k&&x==="agent"&&D&&!Ae?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[He.map(le=>{const Ee=le.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>be(le),children:[o.jsx(Ee,{}),o.jsx("span",{children:le.label})]},le.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(PC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Ae?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Ae.label}企业提示词`,children:Ae.prompts.map(le=>{const Ee=Ae.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>xe(le),children:[o.jsx(Ee,{}),o.jsx("span",{children:le})]},le)})}):null,k&&x==="agent"&&!D&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:fge.map(le=>{const Ee=le.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ge(le.text),children:[o.jsx(Ee,{}),o.jsx("span",{children:le.text})]},le.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:B?"已复制":"复制会话 ID","aria-label":B?"已复制会话 ID":"复制会话 ID",onClick:()=>void Q(),children:B?o.jsx(zs,{}):o.jsx(c0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:M,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:$,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ze})]})}function e5({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(Zt.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx(Ds,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const $_=Symbol.for("yaml.alias"),Tx=Symbol.for("yaml.document"),io=Symbol.for("yaml.map"),t5=Symbol.for("yaml.pair"),Ui=Symbol.for("yaml.scalar"),Nu=Symbol.for("yaml.seq"),$s=Symbol.for("yaml.node.type"),Su=e=>!!e&&typeof e=="object"&&e[$s]===$_,vh=e=>!!e&&typeof e=="object"&&e[$s]===Tx,_h=e=>!!e&&typeof e=="object"&&e[$s]===io,zn=e=>!!e&&typeof e=="object"&&e[$s]===t5,un=e=>!!e&&typeof e=="object"&&e[$s]===Ui,kh=e=>!!e&&typeof e=="object"&&e[$s]===Nu;function $n(e){if(e&&typeof e=="object")switch(e[$s]){case io:case Nu:return!0}return!1}function Hn(e){if(e&&typeof e=="object")switch(e[$s]){case $_:case io:case Ui:case Nu:return!0}return!1}const n5=e=>(un(e)||$n(e))&&!!e.anchor,Lo=Symbol("break visit"),pge=Symbol("skip children"),Jd=Symbol("remove node");function Tu(e,t){const n=mge(t);vh(e)?hc(null,e.contents,n,Object.freeze([e]))===Jd&&(e.contents=null):hc(null,e,n,Object.freeze([]))}Tu.BREAK=Lo;Tu.SKIP=pge;Tu.REMOVE=Jd;function hc(e,t,n,r){const s=gge(e,t,n,r);if(Hn(s)||zn(s))return yge(e,r,s),hc(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=>bge[t]);class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){const t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.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+Ege(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&Hn(t.contents)){const i={};Tu(t.contents,(a,l)=>{Hn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` +`)}}jr.defaultYaml={explicit:!1,version:"1.2"};jr.defaultTags={"!!":"tag:yaml.org,2002:"};function r5(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 s5(e){const t=new Set;return Tu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function i5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function xge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=s5(e));const a=i5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(un(a.node)||$n(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function pc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sBs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!n5(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 H_{constructor(t){Object.defineProperty(this,$s,{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(!vh(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},l=Bs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?pc(i,{"":l},"",l):l}}class z_ extends H_{constructor(t){super($_),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=[],Tu(t,{Node:(i,a)=>{(Su(a)||n5(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 l=r.get(a);if(l||(Bs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=bm(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(r5(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 bm(e,t,n){if(Su(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=bm(e,s,n);i>r&&(r=i)}return r}else if(zn(t)){const r=bm(e,t.key,n),s=bm(e,t.value,n);return Math.max(r,s)}return 1}const a5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends H_{constructor(t){super(Ui),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Bs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const wge="tag:yaml.org,2002:";function vge(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 Kf(e,t,n){var f,h,p;if(vh(e)&&(e=e.contents),Hn(e))return e;if(zn(e)){const m=(h=(f=n.schema[io]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new z_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=wge+t.slice(2));let u=vge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[io]:Symbol.iterator in Object(e)?a[Nu]:a[io]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Rg(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 Kf(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 kd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class o5 extends H_{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Hn(r)||zn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(kd(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,Rg(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&&un(i)?i.value:i:$n(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!zn(n))return!1;const r=n.value;return r==null||t&&un(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,Rg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const _ge=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ia(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Vo=(e,t,n)=>e.endsWith(` +`)?ia(n,t):n.includes(` +`)?` +`+ia(n,t):(e.endsWith(" ")?"":" ")+n,l5="flow",Ax="block",Em="quoted";function Y0(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,g=-1,w=-1,y=-1;n===Ax&&(g=FC(e,g,t.length),g!==-1&&(f=g+c));for(let x;x=e[g+=1];){if(n===Em&&x==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(x===` +`)n===Ax&&(g=FC(e,g,t.length)),f=g+t.length+c,h=void 0;else{if(x===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const _=e[g+1];_&&_!==" "&&_!==` +`&&_!==" "&&(h=g)}if(g>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===Em){for(;p===" "||p===" ";)p=x,x=e[g+=1],m=!0;const _=g>y+1?g-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=x}if(m&&l&&l(),u.length===0)return e;a&&a();let b=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),G0=e=>/^(%|---|\.\.\.)/m.test(e);function kge(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 ef(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(G0(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,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,l=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(Ix,`$&${u}`));let g=!1,w,y=-1;for(w=0;w{N=!0});const S=Y0(`${b}${k}${p}`,u,Ax,T);if(!N)return`>${_} +${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} +${u}${b}${n}${p}`}function Nge(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` +`)||d&&/[[\]{},]/.test(i))return mc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` +`)?mc(i,t):xm(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` +`))return xm(e,t,n,r);if(G0(i)){if(c==="")return t.forceBlockIndent=!0,xm(e,t,n,r);if(l&&c===u)return mc(i,t)}const f=i.replace(/\n+/g,`$& +${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return mc(i,t)}return l?f:Y0(f,c,l5,W0(t,!1))}function V_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?mc(a.value,t):xm(a,t,n,r);case yt.QUOTE_DOUBLE:return ef(a.value,t);case yt.QUOTE_SINGLE:return Cx(a.value,t);case yt.PLAIN:return Nge(a,t,n,r);default:return null}};let u=c(l);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 c5(e,t){const n=Object.assign({blockQuote:!0,commentString:_ge,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 Sge(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(un(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 Tge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(un(e)||$n(e))&&e.anchor;i&&r5(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 cu(e,t,n,r){var c;if(zn(e))return e.toString(t,n,r);if(Su(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=Hn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Sge(t.doc.schema.tags,i));const a=Tge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):un(i)?V_(i,t,n,r):i.toString(t,n,r);return a?un(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function Age({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Hn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if($n(e)||!Hn(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||$n(e)||(un(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=cu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Vo(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Vo(w,n.indent,u(h))),w=`? ${w} +${l}:`):(w=`${w}:`,h&&(w+=Vo(w,n.indent,u(h))));let y,b,x;Hn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&un(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&kh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=cu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` +`:"",b){const T=u(b);N+=` +${ia(T,n.indent)}`}k===""&&!n.inFlow?N===` +`&&x&&(N=` + +`):N+=` +${n.indent}`}else if(!p&&$n(t)){const T=k[0],S=k.indexOf(` +`),R=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let D=!1;if(R&&(T==="&"||T==="!")){let U=k.indexOf(" ");T==="&"&&U!==-1&&Ue===Lp||typeof e=="symbol"&&e.description===Lp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(Lp)),{addToJSMap:d5}),stringify:()=>Lp},Cge=(e,t)=>(ca.identify(t)||un(t)&&(!t.type||t.type===yt.PLAIN)&&ca.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ca.tag&&n.default));function d5(e,t,n){const r=f5(e,n);if(kh(r))for(const s of r.items)Hb(e,t,s);else if(Array.isArray(r))for(const s of r)Hb(e,t,s);else Hb(e,t,r)}function Hb(e,t,n){const r=f5(e,n);if(!_h(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 f5(e,t){return e&&Su(t)?t.resolve(e.doc,e):t}function h5(e,t,{key:n,value:r}){if(Hn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Cge(e,n))d5(e,t,r);else{const s=Bs(n,"",e);if(t instanceof Map)t.set(s,Bs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Ige(n,s,e),a=Bs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Ige(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Hn(e)&&(n!=null&&n.doc)){const r=c5(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)+'..."'),u5(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 K_(e,t,n){const r=Kf(e,void 0,n),s=Kf(t,void 0,n);return new Fr(r,s)}class Fr{constructor(t,n=null){Object.defineProperty(this,$s,{value:t5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Hn(n)&&(n=n.clone(t)),Hn(r)&&(r=r.clone(t)),new Fr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return h5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Age(this,t,n,r):JSON.stringify(this)}}function p5(e,t,n){return(t.inFlow??e.flow?Oge:Rge)(e,t,n)}function Rge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Vo(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||y.includes(` +`)),m0&&(u||(u=f.reduce((b,x)=>b+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),w&&(y+=Vo(y,r,l(w))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const g of f)m+=g?` +${i}${s}${g}`:` +`;return`${m} +${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Og({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=ia(t(r),e);n.push(i.trimStart())}}function Ko(e,t){const n=un(t)?t.value:t;for(const r of e)if(zn(r)&&(r.key===t||r.key===n||un(r.key)&&r.key.value===n))return r}class Ms extends o5{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(io,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),l=(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(K_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;zn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Fr(t,t==null?void 0:t.value):r=new Fr(t.key,t.value);const s=Ko(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`);un(s.value)&&a5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Ko(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ko(this.items,t),s=r==null?void 0:r.value;return(!n&&un(s)?s.value:s)??void 0}has(t){return!!Ko(this.items,t)}set(t,n){this.add(new Fr(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)h5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!zn(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})),p5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Au={collection:"map",default:!0,nodeClass:Ms,tag:"tag:yaml.org,2002:map",resolve(e,t){return _h(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ms.from(e,t,n)};class pl extends o5{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=Mp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Mp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&un(s)?s.value:s}has(t){const n=Mp(t);return typeof n=="number"&&n=0?t:null}const Cu={collection:"seq",default:!0,nodeClass:pl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>pl.from(e,t,n)},q0={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),V_(e,t,n,r)}},X0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&X0.test.test(e)?e:t.options.nullStr},Y_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Y_.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 wi({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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const m5={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:wi},g5={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():wi(e)}},y5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:wi},Q0=e=>typeof e=="bigint"||Number.isInteger(e),W_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function b5(e,t,n){const{value:r}=e;return Q0(r)&&r>=0?n+r.toString(t):wi(e)}const E5={identify:e=>Q0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>W_(e,2,8,n),stringify:e=>b5(e,8,"0o")},x5={identify:Q0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>W_(e,0,10,n),stringify:wi},w5={identify:e=>Q0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>W_(e,2,16,n),stringify:e=>b5(e,16,"0x")},Lge=[Au,Cu,q0,X0,Y_,E5,x5,w5,m5,g5,y5];function UC(e){return typeof e=="bigint"||Number.isInteger(e)}const jp=({value:e})=>JSON.stringify(e),Mge=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:jp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:jp},{identify:UC,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})=>UC(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:jp}],jge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Dge=[Au,Cu].concat(Mge,jge),G_={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 Fr(new yt(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]=zn(r)?r:new Fr(r)}}else t("Expected a sequence for this tag");return e}function _5(e,t,n){const{replacer:r}=n,s=new pl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(K_(l,c,n))}return s}const q_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:v5,createNode:_5};class Cc extends pl{constructor(){super(),this.add=Ms.prototype.add.bind(this),this.delete=Ms.prototype.delete.bind(this),this.get=Ms.prototype.get.bind(this),this.has=Ms.prototype.has.bind(this),this.set=Ms.prototype.set.bind(this),this.tag=Cc.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(zn(s)?(i=Bs(s.key,"",n),a=Bs(s.value,i,n)):i=Bs(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=_5(t,n,r),i=new this;return i.items=s.items,i}}Cc.tag="tag:yaml.org,2002:omap";const X_={collection:"seq",identify:e=>e instanceof Map,nodeClass:Cc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=v5(e,t),r=[];for(const{key:s}of n.items)un(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Cc,n)},createNode:(e,t,n)=>Cc.from(e,t,n)};function k5({value:e,source:t},n){return t&&(e?N5:S5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const N5={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 yt(!0),stringify:k5},S5={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 yt(!1),stringify:k5},Pge={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:wi},Bge={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():wi(e)}},Fge={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 yt(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:wi},Nh=e=>typeof e=="bigint"||Number.isInteger(e);function Z0(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 Q_(e,t,n){const{value:r}=e;if(Nh(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return wi(e)}const Uge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Z0(e,2,2,n),stringify:e=>Q_(e,2,"0b")},$ge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Z0(e,1,8,n),stringify:e=>Q_(e,8,"0")},Hge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Z0(e,0,10,n),stringify:wi},zge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Z0(e,2,16,n),stringify:e=>Q_(e,16,"0x")};class Ic extends Ms{constructor(t){super(t),this.tag=Ic.tag}add(t){let n;zn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Fr(t.key,null):n=new Fr(t,null),Ko(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ko(this.items,t);return!n&&zn(r)?un(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=Ko(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Fr(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(K_(a,null,r));return i}}Ic.tag="tag:yaml.org,2002:set";const Z_={collection:"map",identify:e=>e instanceof Set,nodeClass:Ic,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Ic.from(e,t,n),resolve(e,t){if(_h(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ic,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function J_(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function T5(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return wi(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 A5={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})=>J_(e,n),stringify:T5},C5={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=>J_(e,!1),stringify:T5},J0={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(J0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=J_(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$/,""))??""},$C=[Au,Cu,q0,X0,N5,S5,Uge,$ge,Hge,zge,Pge,Bge,Fge,G_,ca,X_,q_,Z_,A5,C5,J0],HC=new Map([["core",Lge],["failsafe",[Au,Cu,q0]],["json",Dge],["yaml11",$C],["yaml-1.1",$C]]),zC={binary:G_,bool:Y_,float:y5,floatExp:g5,floatNaN:m5,floatTime:C5,int:x5,intHex:w5,intOct:E5,intTime:A5,map:Au,merge:ca,null:X0,omap:X_,pairs:q_,seq:Cu,set:Z_,timestamp:J0},Vge={"tag:yaml.org,2002:binary":G_,"tag:yaml.org,2002:merge":ca,"tag:yaml.org,2002:omap":X_,"tag:yaml.org,2002:pairs":q_,"tag:yaml.org,2002:set":Z_,"tag:yaml.org,2002:timestamp":J0};function zb(e,t,n){const r=HC.get(t);if(r&&!e)return n&&!r.includes(ca)?r.concat(ca):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(HC.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(ca)),s.reduce((i,a)=>{const l=typeof a=="string"?zC[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(zC).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const Kge=(e,t)=>e.keyt.key?1:0;class ek{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?zb(t,"compat"):t?zb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Vge:{},this.tags=zb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,io,{value:Au}),Object.defineProperty(this,Ui,{value:q0}),Object.defineProperty(this,Nu,{value:Cu}),this.sortMapEntries=typeof a=="function"?a:a===!0?Kge:null}clone(){const t=Object.create(ek.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Yge(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=c5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ia(u,""))}let a=!1,l=null;if(e.contents){if(Hn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ia(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=cu(e.contents,s,()=>l=null,u);l&&(d+=Vo(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(cu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +`)?(n.push("..."),n.push(ia(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(ia(i(u),"")))}return n.join(` +`)+` +`}class Sh{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,$s,{value:Tx});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 jr({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Sh.prototype,{[$s]:{value:Tx}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Hn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Dl(this.contents)&&this.contents.add(t)}addIn(t,n){Dl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=s5(this);t.anchor=!n||r.has(n)?i5(n||"a",r):n}return new z_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=xge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=Kf(t,d,m);return l&&$n(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Fr(s,i)}delete(t){return Dl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return kd(t)?this.contents==null?!1:(this.contents=null,!0):Dl(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 kd(t)?!n&&un(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 kd(t)?this.contents!==void 0:$n(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Rg(this.schema,[t],n):Dl(this.contents)&&this.contents.set(t,n)}setIn(t,n){kd(t)?this.contents=n:this.contents==null?this.contents=Rg(this.schema,Array.from(t),n):Dl(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 jr({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 jr({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 ek(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Bs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?pc(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 Yge(this,t)}}function Dl(e){if($n(e))return!0;throw new Error("Expected a YAML collection as document contents")}class I5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Nd extends I5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Wge extends I5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const VC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… +`),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(l=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`: + +${a} +${u} +`}};function uu(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",p=!1,m=!1,g=null,w=null,y=null,b=null,x=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),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(w||y)&&(b=S),d=!0;break;case"anchor":w&&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),w=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{y&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),y=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(w||y)&&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){x&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=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],T=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"),g&&(u&&g.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:_,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:y,newlineAfterProp:b,end:T,start:k??T}}function Yf(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(Yf(t.key)||Yf(t.value))return!0}return!1;default:return!0}}function Rx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Yf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function R5(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||un(i)&&un(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const KC="All mapping items must start at the same column";function Gge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Ms,l=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:g}=f,w=uu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",KC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` +`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||Yf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",KC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Rx(r.indent,p,s),n.atKey=!1,R5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=uu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Rx(r.indent,g,s),c=k.range[2];const N=new Fr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` +`+_.comment:x.comment=_.comment);const k=new Fr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function Xge({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Ms:pl),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 y=0;y0){const y=Th(m,g,n.options.strict,s);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Yb(e,t,n,r,s,i){const a=n.type==="block-map"?Gge(e,t,n,r,i):n.type==="block-seq"?qge(e,t,n,r,i):Xge(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function Qge(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Yb(e,t,n,s,a)}const u=Yb(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=Hn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function Zge(e,t,n){const r=t.offset,s=Jge(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?e0e(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` +`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let g=0;gc&&(c=w.length);else{w.length=l;--g)a[g][0].length>c&&(l=g+1);let f="",h="",p=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` +`:!p&&h===` +`&&(h=` + +`),f+=h+w.slice(c)+y,h=` +`,p=!0):y===""?h===` +`?f+=` +`:h=` +`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=l;gn(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=n0e(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=r0e(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=s0e(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=Th(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function n0e(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}`),O5(e)}function r0e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),O5(e.slice(1,-1)).replace(/''/g,"'")}function O5(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 i0e(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 a0e={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function o0e(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 l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function L5(e,t,n,r){const{value:s,type:i,comment:a,range:l}=t.type==="block-scalar"?Zge(e,t,r):t0e(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[Ui]:c?u=l0e(e.schema,s,c,n,r):t.type==="scalar"?u=c0e(e,s,t,r):u=e.schema[Ui];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=un(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function l0e(e,t,n,r,s){var l;if(n==="!")return e[Ui];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((l=c.test)!=null&&l.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[Ui])}function c0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[Ui];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[Ui];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function u0e(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 d0e={composeNode:M5,composeEmptyNode:tk};function M5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=f0e(e,t,r),(l||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=L5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Qge(d0e,e,t,n,r),l&&(u.anchor=l.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=tk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!un(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 tk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:u0e(t,n,r),indent:-1,source:""},f=L5(e,d,l,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 f0e({options:e},{offset:t,source:n,end:r},s){const i=new z_(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,l=Th(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function h0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new Sh(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=uu(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?M5(u,s,d,a):tk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Th(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function od(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 YC(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=od(n);i?this.warnings.push(new Wge(a,r,s)):this.errors.push(new Nd(a,r,s))},this.directives=new jr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=YC(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];zn(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${r} +${l}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} +${a}`:r}}if(n){for(let i=0;i{const i=od(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=h0e(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 Nd(od(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 Nd(od(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Th(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 Nd(od(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 Sh(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 j5="\uFEFF",D5="",P5="",Ox="";function m0e(e){switch(e){case j5:return"byte-order-mark";case D5:return"doc-mode";case P5:return"flow-error-end";case Ox: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 ti(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const WC=new Set("0123456789ABCDEFabcdef"),g0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Dp=new Set(",[]{}"),y0e=new Set(` ,[]{} +\r `),Wb=e=>!e||y0e.has(e);class b0e{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==="...")&&ti(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ti(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===":")&&ti(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(Wb),"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=>ti(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 l=i;for(;a===" ";)a=this.buffer[--i];if(a===` +`&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield Ox,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(ti(i)||t&&Dp.has(i))break;n=r}else if(ti(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`?(r+=1,s=` +`,i=this.buffer[r+1]):n=r),i==="#"||t&&Dp.has(i))break;if(s===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Dp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ox,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(Wb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ti(r)||n&&Dp.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(;!ti(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(g0e.has(n))n=this.buffer[++t];else if(n==="%"&&WC.has(this.buffer[t+1])&&WC.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 E0e{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 Lg(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"&&qC(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&&GC(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 l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(Ua(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(B5(n.key)&&!Ua(n.sep,"newline")){const l=Pl(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:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ua(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Pl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ua(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ua(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(l);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)){Lg(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||Ua(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=Pp(r),i=Pl(s);qC(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={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]=l}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=Pp(t),r=Pl(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=Pp(t),r=Pl(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 w0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new E0e||null,prettyErrors:t}}function v0e(e,t={}){const{lineCounter:n,prettyErrors:r}=w0e(t),s=new x0e(n==null?void 0:n.addNewLine),i=new p0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Nd(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(VC(e,n)),a.warnings.forEach(VC(e,n))),a}function _0e(e,t,n){let r;const s=v0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>u5(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 k0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return vh(e)&&!r?e.toString(n):new Sh(e,r,n).toString(n)}const F5=new Set(["local","sqlite","mysql","postgresql"]),U5=new Set(["local","opensearch","redis","viking","mem0"]),$5=new Set(["opensearch","viking","context_search"]),H5=new Set(["apmplus","cozeloop","tls"]),z5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),N0e=new Set(["llm","sequential","parallel","loop","a2a"]);function wt(e,t=""){return typeof e=="string"?e:t}function Ls(e){return e===!0}function tf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function V5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:wt(t.name),description:wt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Rc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function K5(e){return typeof e=="string"&&N0e.has(e)?e:"llm"}function Y5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function W5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Ls(t.enabled),registrySpaceId:wt(t.registrySpaceId),registryTopK:wt(t.registryTopK),registryRegion:wt(t.registryRegion),registryEndpoint:wt(t.registryEndpoint)}}function G5(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=W5(n.a2aRegistry),i=K5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Pr(),name:wt(n.name),description:wt(n.description),instruction:wt(n.instruction),agentType:a,maxIterations:Y5(n.maxIterations),a2aUrl:wt(n.a2aUrl),modelName:wt(n.modelName),modelProvider:wt(n.modelProvider),modelApiBase:wt(n.modelApiBase),builtinTools:tf(n.builtinTools).filter(l=>z5.has(l)),customTools:V5(n.customTools),memory:{shortTerm:Ls(r.shortTerm),longTerm:Ls(r.longTerm)},shortTermBackend:Rc(n.shortTermBackend,F5,"local"),longTermBackend:Rc(n.longTermBackend,U5,"local"),autoSaveSession:Ls(n.autoSaveSession),knowledgebase:Ls(n.knowledgebase),knowledgebaseBackend:Rc(n.knowledgebaseBackend,$5,Wc),knowledgebaseIndex:wt(n.knowledgebaseIndex),tracing:Ls(n.tracing),tracingExporters:tf(n.tracingExporters).filter(l=>H5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:G5(n.subAgents),selectedSkills:q5(n)}}):[]}function q5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=wt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=wt(r.name)||wt(r.slug)||wt(r.skillName)||wt(r.skillId)||"skill",l=wt(r.folder)||a,c=wt(r.description);if(i==="skillhub"){const f=wt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:wt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=wt(m.path),w=wt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=wt(r.skillSpaceId),d=wt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:wt(r.skillSpaceName),skillId:d,version:wt(r.version)})}return t}function nk(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=W5(t.a2aRegistry),i=K5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:wt(u.name),transport:d,url:wt(u.url),authToken:wt(u.authToken),command:wt(u.command),args:tf(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Pr(),name:wt(t.name)||"my_agent",description:wt(t.description),instruction:wt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:Y5(t.maxIterations),a2aUrl:wt(t.a2aUrl),modelName:wt(t.modelName),modelProvider:wt(t.modelProvider),modelApiBase:wt(t.modelApiBase),builtinTools:tf(t.builtinTools).filter(c=>z5.has(c)),customTools:V5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Ls(n.shortTerm),longTerm:Ls(n.longTerm)},shortTermBackend:Rc(t.shortTermBackend,F5,"local"),longTermBackend:Rc(t.longTermBackend,U5,"local"),autoSaveSession:Ls(t.autoSaveSession),knowledgebase:Ls(t.knowledgebase),knowledgebaseBackend:Rc(t.knowledgebaseBackend,$5,Wc),knowledgebaseIndex:wt(t.knowledgebaseIndex),tracing:Ls(t.tracing),tracingExporters:tf(t.tracingExporters).filter(c=>H5.has(c)),deployment:{feishuEnabled:Ls(r.feishuEnabled)},subAgents:G5(t.subAgents),selectedSkills:q5(t)}}function X5(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||mi.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||mi.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||mi.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),(l=e.modelName)!=null&&l.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,T,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(T=_.authToken)!=null&&T.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(X5)),t}function S0e(e){return`# VeADK Agent 结构配置 +# 可在「创建 Agent」页通过「导入 YAML」重新载入。 +`+k0e(X5(e))}function T0e(e){const t=_0e(e);return nk(t)}const A0e=[{kind:"custom",icon:vV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:aV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:tV,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:_V,title:"工作流",desc:"敬请期待",disabled:!0}];function C0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=A0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(T0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(e5,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(xV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const I0e="modulepreload",R0e=function(e){return"/"+e},XC={},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]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=R0e(c),c in XC)return;XC[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":I0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function Q5(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 O0e(e,t){return Q5([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function Z5(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 QC(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const L0e="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",M0e=(()=>{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 j0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Sn(e,t){e.push(t&255,t>>>8&255)}function is(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const ZC=2048,Gb=20,JC=0;function D0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=j0e(g),y=g.length,b=[];is(b,67324752),Sn(b,Gb),Sn(b,ZC),Sn(b,JC),Sn(b,0),Sn(b,0),is(b,w),is(b,y),is(b,y),Sn(b,m.length),Sn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];is(m,33639248),Sn(m,Gb),Sn(m,Gb),Sn(m,ZC),Sn(m,JC),Sn(m,0),Sn(m,0),is(m,p.crc),is(m,p.size),is(m,p.size),Sn(m,p.nameBytes.length),Sn(m,0),Sn(m,0),Sn(m,0),Sn(m,0),is(m,0),is(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];is(c,101010256),Sn(c,0),Sn(c,0),Sn(c,r.length),Sn(c,r.length),is(c,l),is(c,i),Sn(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 P0e=E.lazy(()=>Oc(()=>import("./CodeEditor-CTF8aHas.js"),[]));function B0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function F0e(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 J5({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>B0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return F0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(cT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx(Ds,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(AM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return ps.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(mv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(pr,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(cT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(P0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function U0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(mv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(J5,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Mg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx(Ft,{className:"spin"}):o.jsx(mV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(lV,{}):o.jsx(_c,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(zs,{}):o.jsx(c0,{})})]})]})}const $0e=5e4;function H0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` +`),r=t.split(` +`),s=Math.min(n.length,r.length,260);for(let i=s;i>0;i-=1){const a=n.slice(-i).join(` +`),l=r.slice(0,i).join(` +`);if(a===l){const c=r.slice(i).join(` +`);return c?`${e} +${c}`:e}}return`${e} +${t}`}function z0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` +`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function eI(e,t,n=$0e){const r=H0e((e==null?void 0:e.text)??"",t.text??""),s=z0e(r,n),i=s.text?s.text.split(` +`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}es.registerLanguage("python",aD);es.registerLanguage("typescript",bD);es.registerLanguage("javascript",eD);es.registerLanguage("json",tD);es.registerLanguage("yaml",ED);es.registerLanguage("markdown",iD);es.registerLanguage("bash",G3);es.registerLanguage("ini",q3);es.registerLanguage("dockerfile",hJ);es.registerLanguage("makefile",sD);const V0e=E.lazy(()=>Oc(()=>import("./CodeEditor-CTF8aHas.js"),[])),La=()=>{};function K0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?ps.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(EV,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(pr,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const Y0e={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"},tI={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function nI(e){return e.replace(/&/g,"&").replace(//g,">")}function W0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(tI[n])return tI[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 Y0e[s]??null}function G0e(e,t){try{const n=W0e(t);return n&&es.getLanguage(n)?es.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?es.highlightAuto(e).value:nI(e)}catch{return nI(e)}}const q0e=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],X0e=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function Q0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function Z0e(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 J0e(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function eye({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[ps.createPortal(e,n.left),ps.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function ey({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:T,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:D,deployDisabled:U=!1}){var Kn,vt,an;const W=typeof l=="function",M=f.includes("更新"),$=D?X0e:q0e,[C,j]=E.useState(((vt=(Kn=e==null?void 0:e.files)==null?void 0:Kn[0])==null?void 0:vt.path)??null),[L,P]=E.useState(new Set),[A,z]=E.useState(!1),[G,B]=E.useState(""),[re,Q]=E.useState(!1),[se,de]=E.useState(!1),[te,pe]=E.useState(!1),[ne,ye]=E.useState(!1),[ge,be]=E.useState(null),[xe,ke]=E.useState(null),[Ae,He]=E.useState({}),[Ce,gt]=E.useState(null),[Ge,ze]=E.useState(!1),[le,Ee]=E.useState([]),[ut,ft]=E.useState(!1),[X,ee]=E.useState(!1),me=E.useRef(!0),Le=ue=>o.jsxs("div",{className:"pp-network-region",onKeyDown:Se=>{Se.key==="Escape"&&ee(!1)},children:[ue&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":X,disabled:re||M||!T,onClick:()=>ee(Se=>!Se),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(pv,{className:`pp-region-chevron${X?" is-open":""}`})]}),X&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>ee(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(Se=>{const ve=Se.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":ve,className:`pp-region-option${ve?" is-selected":""}`,onClick:()=>{T==null||T(Se.value),ee(!1)},children:[o.jsx("span",{children:Se.label}),ve&&o.jsx(zs,{"aria-hidden":"true"})]},Se.value)})})]})]});E.useEffect(()=>(me.current=!0,()=>{me.current=!1}),[]),E.useEffect(()=>{if(!te)return;const ue=document.body.style.overflow;document.body.style.overflow="hidden";const Se=ve=>{ve.key==="Escape"&&pe(!1)};return window.addEventListener("keydown",Se),()=>{document.body.style.overflow=ue,window.removeEventListener("keydown",Se)}},[te]);const Ye=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:Q0e(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const Ze=e.files.find(ue=>ue.path===C)??null,Pt=(_==null?void 0:_.mode)??"public",bt=O0e(g?[...y,...Qu]:y,b),Bt=bt.length+le.length;function zt(ue){P(Se=>{const ve=new Set(Se);return ve.has(ue)?ve.delete(ue):ve.add(ue),ve})}function Nt(ue,Se){l&&(l({...e,files:ue}),Se!==void 0&&j(Se))}function Ut(ue){Ze&&Nt(e.files.map(Se=>Se.path===Ze.path?{...Se,content:ue}:Se))}function Be(){const ue=G.trim();if(z(!1),B(""),!!ue){if(e.files.some(Se=>Se.path===ue)){j(ue);return}Nt([...e.files,{path:ue,content:""}],ue)}}function pt(){if(!Ze)return;const ue=window.prompt("重命名文件",Ze.path),Se=ue==null?void 0:ue.trim();!Se||Se===Ze.path||e.files.some(ve=>ve.path===Se)||Nt(e.files.map(ve=>ve.path===Ze.path?{...ve,path:Se}:ve),Se)}function Je(){var Se;if(!Ze)return;const ue=e.files.filter(ve=>ve.path!==Ze.path);Nt(ue,((Se=ue[0])==null?void 0:Se.path)??null)}function Re(ue,Se){Ee(ve=>ve.map(Qe=>Qe.id===ue?{...Qe,...Se}:Qe))}function It(ue){Ee(Se=>Se.filter(ve=>ve.id!==ue))}function St(){Ee(ue=>[...ue,J0e()])}function ce(ue){k&&k(ue==="public"?void 0:{..._??{mode:ue},mode:ue})}function Ve(ue){k==null||k({..._??{mode:"private"},...ue})}function at(){const ue=new Map(le.map(ve=>({key:ve.key.trim(),value:ve.value})).filter(ve=>ve.key.length>0).map(ve=>[ve.key,ve.value])),Se=g?[...y,...Qu]:y;for(const ve of Z5(Se,b))ue.set(ve.key,ve.value);return[...ue].map(([ve,Qe])=>({key:ve,value:Qe}))}async function rn(){if(!(!w||re||ne)){be(null),ye(!0);try{await w(!g)}catch(ue){me.current&&be(`更新飞书配置失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{me.current&&ye(!1)}}}async function sn(){var Se;if(!c||re||U)return;if(Pt!=="public"&&!((Se=_==null?void 0:_.vpcId)!=null&&Se.trim())){be("使用 VPC 网络时,请填写 VPC ID。");return}const ue=QC(y,b);if(ue){const ve=y.find(Qe=>Qe.key===ue.key);be(`请返回配置页填写 ${(ve==null?void 0:ve.comment)||(ve==null?void 0:ve.key)}(${ve==null?void 0:ve.key})。`);return}if(g){const ve=QC(Qu,b);if(ve){const Qe=Qu.find(ot=>ot.key===ve.key);be(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}de(!0)}async function fn(){if(!c||re)return;de(!1);const ue=at();me.current&&(be(null),ke(null),He({}),gt(null),Q(!0));const Se=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ve=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ot={id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ot),p==null||p(ot);let et,lt=ot.phase??"prepare";const Vt=Ue=>et?{...et,status:Ue,updatedAt:Date.now()}:void 0,Kt=Ue=>{const qe=Vt(Ue);return qe?{buildLog:qe}:{}},J=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),rt=Ue=>{if(lt!=="build")return;const qe=["","----- 构建失败 -----",Ue].join(` +`);return et=eI(et,{source:"code-pipeline",status:"error",text:qe,lineCount:qe.split(` +`).length,truncated:!1,updatedAt:Date.now()}),et};try{const Ue=await c(e,qe=>{var Xe;qe.runtimeName&&(ve=qe.runtimeName),lt=qe.phase,qe.buildLog?et=eI(et,qe.buildLog):qe.phase==="build"&&!et&&(et=J()),me.current&&(He(Rt=>({...Rt,[qe.phase]:qe})),gt(qe.phase)),m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:qe.phase,label:((Xe=$.find(Rt=>Rt.phase===qe.phase))==null?void 0:Xe.label)??qe.phase,message:qe.message,pct:qe.pct,...et?{buildLog:et}:{}})},g?{taskId:Se,im:{feishu:{enabled:!0}},envs:ue}:{taskId:Se,envs:ue});me.current&&(ke(Ue),gt(null)),m==null||m({id:Se,runtimeName:Ue.agentName||ve,runtimeId:Ue.runtimeId||h,region:Ue.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...Kt("complete")});try{await(d==null?void 0:d(Ue))}catch(qe){if(!(qe instanceof Ya))throw qe;m==null||m({id:Se,runtimeName:Ue.agentName||ve,runtimeId:Ue.runtimeId||h,region:Ue.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:qe.message,...Kt("complete")})}}catch(Ue){const qe=Ue instanceof Error?Ue.message:String(Ue);if(Ue instanceof DOMException&&Ue.name==="AbortError"){me.current&&(be(null),gt(null)),m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...Kt("complete")});return}me.current&&be(qe);const Xe=rt(qe),Rt=!!Xe;m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:lt,label:"部署失败",message:Rt?"构建镜像失败,详见构建日志。":qe,...Xe?{buildLog:Xe}:Kt("complete"),retry:sn})}finally{me.current&&Q(!1)}}function Wt(){de(!1)}async function Jt(){if(!(!xe||Ge)){ze(!0),be(null);try{const{addConnection:ue,addRuntimeConnection:Se,remoteAppId:ve,loadConnections:Qe}=await Oc(async()=>{const{addConnection:lt,addRuntimeConnection:Vt,remoteAppId:Kt,loadConnections:J}=await Promise.resolve().then(()=>vT);return{addConnection:lt,addRuntimeConnection:Vt,remoteAppId:Kt,loadConnections:J}},void 0),{probeRuntimeApps:ot}=await Oc(async()=>{const{probeRuntimeApps:lt}=await Promise.resolve().then(()=>eK);return{probeRuntimeApps:lt}},void 0);let et;if(xe.runtimeId){const lt=xe.region??N,Vt=await ot(xe.runtimeId,lt)??[];et=Se(xe.runtimeId,xe.agentName,lt,Vt,Vt.length>0?{[Vt[0]]:xe.agentName}:void 0,xe.version)}else et=await ue(xe.agentName,xe.url,xe.apikey,"");if(et.apps.length===0)be("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const lt={[et.apps[0]]:xe.agentName},Vt={...et,appLabels:{...et.appLabels??{},...lt}},J=Qe().map(Ue=>Ue.id===et.id?Vt:Ue);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(J));const{registerConnections:rt}=await Oc(async()=>{const{registerConnections:Ue}=await Promise.resolve().then(()=>vT);return{registerConnections:Ue}},void 0);if(rt(J),u){const Ue=ve(et.id,et.apps[0]);u(Ue,xe.agentName)}else alert(`🎉 Agent "${xe.agentName}" 已添加到左上角下拉列表!`)}}catch(ue){be(`添加 Agent 失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ze(!1)}}}function Mn(){const ue=D0e(e.files),Se=URL.createObjectURL(ue),ve=document.createElement("a");ve.href=Se,ve.download=`${e.name||"project"}.zip`,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(Se)}function Vn(ue,Se,ve){return Z0e(ue).map(Qe=>{const ot=ve?`${ve}/${Qe.name}`:Qe.name,et=Qe.path!==void 0,lt={paddingLeft:8+Se*14};if(et){const Kt=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${Kt?" pp-active":""}`,style:lt,onClick:()=>j(Qe.path),title:Qe.path,children:[o.jsx(Wz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ot)}const Vt=L.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:lt,onClick:()=>zt(ot),children:[o.jsx(Ds,{className:`pp-ic pp-chevron${Vt?"":" pp-open"}`}),o.jsx(AM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Vt&&Vn(Qe,Se+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${D?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(eye,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(hv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!D&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Cg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>pe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(_c,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx(Vz,{className:"pp-ic"}),"导出配置文件"]}),W&&l&&o.jsx(U0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:Mn,children:[o.jsx(u0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),W&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{z(!0),B("")},children:o.jsx(Kz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[A&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:G,onChange:ue=>B(ue.target.value),onBlur:Be,onKeyDown:ue=>{ue.key==="Enter"&&Be(),ue.key==="Escape"&&(z(!1),B(""))}}),e.files.length===0&&!A?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):Vn(Ye,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:Ze==null?void 0:Ze.path,children:(Ze==null?void 0:Ze.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:W&&Ze&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:pt,children:o.jsx(fV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Je,children:o.jsx(Fi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:Ze==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):W?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(V0e,{value:Ze.content,path:Ze.path,onChange:Ut})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:G0e(Ze.content,Ze.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[D,!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),Le(!1)]}),!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void rn(),disabled:g||re||ne||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:L0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:ne?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void rn(),disabled:!g||re||ne||!w,children:ne?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:Qu.map(ue=>o.jsxs("label",{children:[o.jsxs("span",{children:[ue.comment||ue.key,ue.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:ue.key.includes("SECRET")?"password":"text",value:b[ue.key]??"",placeholder:ue.placeholder,tabIndex:g?0:-1,disabled:!g||re||!x,autoComplete:"off",onChange:Se=>x==null?void 0:x(ue.key,Se.currentTarget.value)})]},ue.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),D&&Le(!0),M&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ue=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:ue,checked:Pt===ue,onChange:()=>ce(ue),disabled:re||M||!k}),o.jsx("span",{children:ue==="public"?"公网":ue==="private"?"VPC":"公网 + VPC"})]},ue))}),Pt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:re||M,onChange:ue=>Ve({vpcId:ue.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:re||M,onChange:ue=>Ve({subnetIds:ue.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:re||M,onChange:ue=>Ve({enableSharedInternetAccess:ue.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Bt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:ut?"隐藏值":"显示值",onClick:()=>ft(ue=>!ue),children:ut?o.jsx(Hz,{className:"pp-ic"}):o.jsx(yv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:St,disabled:re,children:[o.jsx(dr,{className:"pp-ic"}),"添加变量"]}),(bt.length>0||le.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[bt.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[bt.length," 项"]})]}),bt.map(ue=>{const Se=ue.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:ue.key,readOnly:!0,disabled:re,"aria-label":`${ue.key} 环境变量名`}),o.jsx("input",{type:Se||ut?"text":"password",value:ue.value,placeholder:ue.required?"必填,尚未填写":"可选,尚未填写",readOnly:Se,disabled:re||!Se&&!x,autoComplete:"off","aria-label":`${ue.key} 环境变量值`,onChange:ve=>x==null?void 0:x(ue.key,ve.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:Se?"自动":"同步"})]},ue.key)})]}),le.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[le.length," 项"]})]}),le.map(ue=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:ue.key,placeholder:"名称",disabled:re,autoComplete:"off",onChange:Se=>Re(ue.id,{key:Se.currentTarget.value})}),o.jsx("input",{type:ut?"text":"password",value:ue.value,placeholder:"值",disabled:re,autoComplete:"off",onChange:Se=>Re(ue.id,{value:Se.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:re,onClick:()=>It(ue.id),children:o.jsx(pr,{className:"pp-ic"})})]},ue.id))]})]}),(re||xe||Object.keys(Ae).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:$.map((ue,Se)=>{const ve=Ce?$.findIndex(lt=>lt.phase===Ce):-1,Qe=!!ge&&(ve===-1?Se===0:Se===ve);let ot;xe?ot="done":Qe?ot="failed":ve===-1?ot=re?"active":"pending":Seue.phase===Ce))==null?void 0:an.label)??Ce}阶段):`:""}${ge}`,onRetry:sn,retryLabel:M?"重试更新":"重试部署"}),xe&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:M?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[xe.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:xe.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:xe.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:xe.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:Jt,disabled:Ge,children:[Ge?o.jsx(Ft,{className:"pp-ic spin"}):o.jsx(RM,{className:"pp-ic"}),Ge?"连接中…":"立即对话"]}),xe.consoleUrl&&o.jsxs("a",{href:xe.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(gv,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:sn,disabled:re||ne||U||!!n,title:n,children:re?`${f}中…`:ge?`重试${f}`:f})})]})]}),te&&r&&ps.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:ue=>{ue.target===ue.currentTarget&&pe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>pe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(pr,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Cg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(K0e,{open:se,isUpdate:M,onCancel:Wt,onConfirm:()=>void fn()})]})}const rI="dogfooding",qb="dogfooding",Xb="dogfooding_b";let tye=0;const Qb=()=>++tye;function sI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function nye(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function iI(e){const t=[],n=nye(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 Mv(nk(a))}catch{}return null}function rye({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Qb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[T,S]=E.useState(!1),[R,I]=E.useState({}),D=E.useRef(null),U=E.useRef(null),W=E.useRef(null),M=E.useRef(null),$=E.useRef(null);E.useEffect(()=>{const Q=M.current;Q&&Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const Q=$.current;Q&&(Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,160)+"px")},[l]);const C=Q=>a(se=>[...se,{id:Qb(),role:"assistant",text:Q}]);async function j(){if(D.current)return D.current;const Q=await ng(rI,e);return D.current=Q,Q}async function L(Q,se){if(se.current)return se.current;const de=await ng(Q,e);return se.current=de,de}async function P(Q,se){if(!R[Q])try{const de=await Rv(se);I(te=>({...te,[Q]:de.model||se}))}catch{I(de=>({...de,[Q]:se}))}}async function A(Q,se,de){const te=await L(Q,se);let pe=ci();for await(const ye of Tf({appName:Q,userId:e,sessionId:te,text:de}))pe=Vc(pe,ye);const ne=sI(pe).trim();return{project:await iI(ne),finalText:ne}}const z=async(Q,se,de)=>m0(Q.name,Q.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:se}),G=async()=>{const Q=l.trim();if(!(!Q||u)){if(a(se=>[...se,{id:Qb(),role:"user",text:Q}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),P("a",qb),P("b",Xb);const se=A(qb,U,Q).then(({project:te})=>(b(te),te)).catch(te=>{const pe=te instanceof Error?te.message:String(te);return h(pe),null}).finally(()=>N(!1)),de=A(Xb,W,Q).then(({project:te})=>(_(te),te)).catch(te=>{const pe=te instanceof Error?te.message:String(te);return h(pe),null}).finally(()=>S(!1));try{const[te,pe]=await Promise.all([se,de]),ne=[te?`方案 A:${te.name}`:null,pe?`方案 B:${pe.name}`:null].filter(Boolean);ne.length?C(`已生成两个方案(${ne.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const se=await j();let de=ci();for await(const ne of Tf({appName:rI,userId:e,sessionId:se,text:Q}))de=Vc(de,ne);const te=sI(de).trim(),pe=await iI(te);pe?(m(pe),C(`已生成项目:${pe.name}(${pe.files.length} 个文件),可在右侧预览和编辑。`)):C(te||"(助手没有返回内容,请再描述一下你的需求。)")}catch(se){const de=se instanceof Error?se.message:String(se);h(de),C(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},B=Q=>{const se=Q==="a"?y:x;if(!se)return;m(se),w(!1),b(null),_(null),N(!1),S(!1);const de=Q==="a"?"A":"B",te=Q==="a"?R.a:R.b;C(`已采用方案 ${de}(${te??(Q==="a"?qb:Xb)}),可继续编辑。`)},re=Q=>{Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),G())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:M,children:[o.jsx(oi,{initial:!1,children:i.map(Q=>o.jsxs(Zt.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"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:Q.role==="assistant"?o.jsx(ph,{text:Q.text}):Q.text})]},Q.id))}),u&&o.jsxs(Zt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(l0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:$,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:Q=>c(Q.target.value),onKeyDown:re,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(gV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:Q=>w(Q.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(aI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>B("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(aI,{side:"b",project:x,loading:T,model:R.b,onAdopt:()=>B("b")})]}):p?o.jsx(ey,{project:p,onChange:m,onDeploy:z,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(qz,{className:"ic-preview-empty-glyph"}),o.jsx(al,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function aI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx(Ft,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(ey,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const sye=/^[A-Za-z_][A-Za-z0-9_]*$/;function Lc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":sye.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function eB(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 iye({className:e,...t}){return o.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:[o.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"}),o.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 ld={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:iye},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:Xz},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:bV},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:wv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:d0}},aye=[ld.llm,ld.sequential,ld.parallel,ld.loop,ld.a2a],tB=e=>e==="sequential"||e==="parallel"||e==="loop",ty=e=>e==="a2a";function Hs(e){return e.trimEnd().replace(/[。.]+$/,"")}function jg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function To(e,t){return e[t]|e[t+1]<<8}function Bl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function oye(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 nB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Bl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=To(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=Bl(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=To(e,w+26),x=To(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await oye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const lye="/skillhub/v1/skills";async function cye(e,t="public"){const n=e.trim(),r=`${lye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:pi(void 0,gu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function uye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await cye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(Sf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx(Ft,{className:"cw-i cw-spin"}):o.jsx(Sf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const Lx=/(^|\/)skill\.md$/i;function dye(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 hye(...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 pye(e,t){return t.trim()||e}function rB(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 mye(e){const t=new Map,n=new Set;for(const r of e)if(Lx.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=Lx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function gye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>Lx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=dye(s.text),a=hye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:pye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function yye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await nB(t)).map(s=>({path:s.name,text:s.text}));return sB(rB(r),e.name)}async function bye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function xye(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 iB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Eye(e),path:n}];if(!e.isDirectory)return[];const r=await xye(e);return(await Promise.all(r.map(s=>iB(s,n)))).flat()}function wye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const T=[...x.errors];if(k.length>0&&T.push(`已跳过重复技能:${k.join("、")}`),r(T),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>iB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await yye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(k.map(({file:S,path:R})=>[S,R]));g(await bye(k.map(({file:S})=>S),T))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(Ev,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function vye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Tj();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Aj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=XK(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(Ft,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${Hs(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:QK(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(gv,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(Ft,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Bz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function _ye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 kye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await _ye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Nye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 Sye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Nye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const oI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function Zb(e){let t=0;for(let n=0;n>>0;return oI[t%oI.length]}function Tye(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)),l=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:l,total:c-l||1}}function Aye(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 lI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const Cye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function cI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:Cye(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function aB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=mj(t,n);else if(e)_=ZM(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,T)=>N.start_time<=T.start_time?N:T).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>Tye(i??[]),[i]),w=E.useMemo(()=>Aye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(pr,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,T=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx(Ds,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:Zb(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:lI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${T}%`,background:Zb(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:Zb(y.name)}}),lI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:cI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),cI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const Iye=E.lazy(()=>Oc(()=>import("./MarkdownPromptEditor-CD1RMBf6.js"),__vite__mapDeps([0,1]))),Mx="veadk.generatedAgentTestRuns";function rk(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Mx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function oB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Mx,JSON.stringify(t)):window.sessionStorage.removeItem(Mx)}catch{}}function Rye(e){oB([...rk(),e])}function cd(e){oB(rk().filter(t=>t!==e))}function Oye(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 uI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:yV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:mo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Uz},{id:"tools",label:"工具",hint:"可调用的能力",icon:MM},{id:"skills",label:"技能",hint:"声明式技能",icon:al},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:rm},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:CM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:NM},{id:"review",label:"完成",hint:"预览并创建",icon:pV}];function Lye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function lB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function cB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Mye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},dI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},fI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},uB="REGISTRY_SPACE_ID",jye=Cj.filter(e=>e.key!==uB);function dB(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())||mi.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||mi.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||mi.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function hI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(zs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:Hs(s.desc)})]})]},s.id)})})}function Jb({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Hs(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:Hs(r.desc)})]},r.id)})})}function Dye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function Fl({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:Dye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function e1(e){return e.name.trim()||"未命名智能体中心"}function t1(e){return e.name.trim()||e.id||"未命名知识库"}function Pye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||mi.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),kye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?e1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>jg(g,[e1(R),R.id,R.projectName])),[g,i]),T=!!(e&&!b&&jg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=D=>{const U=D.target;U instanceof Node&&y.current&&!y.current.contains(U)&&m(!1)},I=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(lB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=e1(R),D=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":D,className:`cw-a2a-space-option ${D?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!T&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(cB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Bye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),Sye().then(T=>{N||r(T)}).catch(T=>{N||(r([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?t1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>jg(h,[t1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&jg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},T=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(lB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const T=t1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${T} (${N.id})`,onClick:()=>k(N.id),children:T},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(cB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Fye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(oi,{initial:!1,children:e.map((i,a)=>o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(Fi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(dr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function fB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Uye({s:e,onRemove:t}){let n=al,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Ev,r="本地"):e.source==="skillspace"&&(n=fB,r="AgentKit Skills 中心"),o.jsxs(Zt.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Hs(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(pr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const n1=[{id:"local",label:"本地文件",icon:Ev},{id:"skillspace",label:"AgentKit Skills 中心",icon:fB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:d0}];function $ye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=n1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>r1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(dr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(oi,{initial:!1,children:e.map(c=>o.jsx(Uye,{s:c,onRemove:()=>l(r1(c))},r1(c)))})})]}),o.jsx(oi,{children:s&&o.jsx(Zt.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:o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(pr,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${n1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),n1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(uye,{selected:e,onChange:t}),n==="local"&&o.jsx(wye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(vye,{selected:e,onChange:t})]})]})]})})})]})}function r1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function ud({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:Hs(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(Zt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Hye(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 Bp(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Ah(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Ah(i[r],s,n),{...e,subAgents:i}}function zye(e,t){return Ah(e,t,n=>({...n,subAgents:[...n.subAgents,Pr()]}))}function Vye(e,t,n){return Ah(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Pr()),{...r,subAgents:s}})}function Kye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Ah(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const jx=e=>!ty(e.agentType),pI=3;function Yye(e,t,n=!1){var s;if(ty(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?"缺少描述":tB(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function hB(e,t,n=[]){const r=[],s=ty(e.agentType),i=Yye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),jx(e)&&e.subAgents.forEach((a,l)=>r.push(...hB(a,t,[...n,l]))),r}function pB(e){return 1+e.subAgents.reduce((t,n)=>t+pB(n),0)}function mB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=ol.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Cj}),Object.assign(n,dB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=PE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=BE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=FE.find(d=>d.id===(i.knowledgebaseBackend??Wc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=UE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=Q5(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function gB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Wye(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 yB(e){var r,s;const t=mB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...gB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(Z5(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Gye(e){return JSON.stringify(yB(e))}function Dg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function gc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function qye({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===Dg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),T=gc(b),S=!!(_&&k&&N&&n.findIndex(L=>gc(L)===T)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==Dg(r,b)),D=b.phase==="starting",U=b.phase==="ready"&&!I,W=D||b.phase==="sending",M=U&&b.phase!=="sending"&&b.messages.some(L=>L.role==="assistant"),$=W||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",j=D?"正在启动":I?"应用配置并重启":U||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||W,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||W,onClick:()=>d(b.id),children:o.jsx(Fi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Mg,{message:b.error,className:"cw-debug-error-detail"}):D?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(Ft,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:U?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((L,P)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${L.role}`,children:o.jsx("div",{className:"cw-debug-content",children:L.role==="user"?L.content:L.error?o.jsx(Mg,{message:L.error,className:"cw-debug-msg-error"}):L.blocks&&L.blocks.length>0?o.jsx(F_,{blocks:L.blocks,onAction:()=>{}}):L.content?L.content:P===b.messages.length-1&&b.phase==="sending"?o.jsx(Q6,{}):null})},P))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!M,title:M?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:$,title:C||void 0,onClick:()=>l(b.id),children:[U||I||b.phase==="error"?o.jsx(LM,{className:"cw-i"}):o.jsx(Lye,{className:"cw-i cw-debug-run-icon"}),j]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:W||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:L=>p(b.id,"modelName",L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:L=>p(b.id,"description",L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:L=>p(b.id,"instruction",L.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:bB.map(L=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(L.id),disabled:!0}),o.jsx("span",{children:L.label})]},L.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(dr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{Z6(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx(Ft,{className:"cw-i cw-spin"}):o.jsx(_M,{className:"cw-i"})})]})})]})}const mI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],bB=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Xye({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=mI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:mI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function Qye({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var wa,nr,va,Yi,Nl,Sl,_a,ka,Na,Tl,bo,Gs,_t,Eo,V;const[h,p]=E.useState(()=>r??Pr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),T=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var O;S!==T.current&&(T.current=S,(O=I.current)==null||O.call(I,h,R))},[h,R,S]);const[D,U]=E.useState("build"),[W,M]=E.useState(!1),[$,C]=E.useState(!1),[j,L]=E.useState(0),[P,A]=E.useState(null),[z,G]=E.useState(!1),[B,re]=E.useState((a==null?void 0:a.region)??l),Q=(s==null?void 0:s.generatedAgentTestRun)===!0,se=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[de,te]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Pr()).modelName??"",description:(r??Pr()).description,instruction:(r??Pr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[pe,ne]=E.useState("baseline"),ye=E.useRef(1),ge=E.useRef(new Map),[be,xe]=E.useState(0),[ke,Ae]=E.useState(""),[He,Ce]=E.useState(null),[gt,Ge]=E.useState("basic"),[ze,le]=E.useState(""),[Ee,ut]=E.useState(!1),[ft,X]=E.useState(!1),[ee,me]=E.useState(!1),[Le,Ye]=E.useState(!1),[Ze,Pt]=E.useState([]),bt=E.useRef(null),Bt=E.useRef({});async function zt(){const O=new Set([...ge.current.values()].map(({run:oe})=>oe.runId)),q=rk().filter(oe=>!O.has(oe));q.length&&await Promise.all(q.map(async oe=>{try{await $l(oe),cd(oe)}catch(Pe){console.warn("清理遗留调试运行失败",Pe)}}))}E.useEffect(()=>(zt(),()=>{for(const{run:O}of ge.current.values())$l(O.runId).then(()=>cd(O.runId)).catch(q=>console.warn("清理调试运行失败",q));ge.current.clear()}),[]);const Nt=E.useRef(null);Nt.current||(Nt.current=({meta:O,children:q})=>o.jsxs("section",{ref:oe=>{Bt.current[O.id]=oe},id:`cw-sec-${O.id}`,"data-step-id":O.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[O.label,O.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),q]}));const Ut=Hye(h,Ze)?Ze:[],Be=Bp(h,Ut),pt=Ut.length===0,Je=`cw-model-advanced-${Ut.join("-")||"root"}`,Re=`cw-a2a-registry-advanced-${Ut.join("-")||"root"}`,It=`cw-more-tool-types-${Ut.join("-")||"root"}`,St=`cw-advanced-config-${Ut.join("-")||"root"}`,ce=O=>p(q=>Ah(q,Ut,oe=>({...oe,...O}))),Ve=(O,q)=>p(oe=>{var Pe;return{...oe,deployment:{...oe.deployment??{feishuEnabled:!1},envValues:{...((Pe=oe.deployment)==null?void 0:Pe.envValues)??{},[O]:q}}}}),at=O=>ce({a2aRegistry:{...Be.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...O}}),rn=(O,q)=>{if(!(O in fI))return;const oe=fI[O];at({[oe]:q}),Ve(O,q)},sn=O=>{if(!(pt&&O==="a2a")){if(O==="a2a"){ce({agentType:O,a2aRegistry:{...Be.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}ce({agentType:O,a2aRegistry:Be.a2aRegistry?{...Be.a2aRegistry,enabled:!1}:void 0})}},fn=(O,q)=>{p(O),q&&Pt(q)},Wt=async()=>{const O=m.trim();if(!(!O||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),le("");try{const q=await fj(O);p(nk(q.draft)),Pt([]),A(null),C(!1),le(""),x(!0)}catch(q){k(q instanceof Error?q.message:"生成 Agent 配置失败")}finally{y(!1)}}},Jt=O=>{const q=Bp(h,O);if(!jx(q)||O.length>=pI)return;const oe=zye(h,O),Pe=Bp(oe,O).subAgents.length-1;fn(oe,[...O,Pe])},Mn=(O,q)=>{const oe=Bp(h,O);if(!jx(oe)||O.length>=pI)return;const Pe=Math.max(0,Math.min(q,oe.subAgents.length)),nt=Vye(h,O,Pe);fn(nt,[...O,Pe])},Vn=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Pr()),Pt([]),C(!1),Ye(!1))},Kn=O=>{if(O.length===0){Vn();return}fn(Kye(h,O),O.slice(0,-1))},vt=Be.builtinTools??[],an=Be.mcpTools??[],ue=Be.tracingExporters??[],Se=Be.selectedSkills??[],ve=[Be.memory.shortTerm,Be.memory.longTerm,Be.tracing].filter(Boolean).length,Qe=O=>ce({builtinTools:vt.includes(O)?vt.filter(q=>q!==O):[...vt,O]}),ot=O=>{const q=ue.includes(O)?ue.filter(oe=>oe!==O):[...ue,O];ce({tracingExporters:q,tracing:q.length>0?!0:Be.tracing})},et=tB(Be.agentType),lt=ty(Be.agentType),Vt=E.useMemo(()=>eB(h),[h]),Kt=lt?null:Lc(Be.name)??(Vt.has(Be.name)?"Agent 名称在当前结构中必须唯一":null),J=Kt!==null,rt=!lt&&Be.description.trim().length===0,Ue=Be.instruction.trim().length===0,qe=lt&&!((wa=Be.a2aRegistry)!=null&&wa.registrySpaceId.trim()),Xe=O=>$&&O?`is-error cw-error-shake-${j%2}`:"",Rt=E.useMemo(()=>hB(h,Vt),[h,Vt]),Yn=Rt.length===0,Wn=E.useMemo(()=>Gye(h),[h]),en=de.find(O=>O.id===pe)??de[0],vn=E.useMemo(()=>mB(h),[h]),Yt=E.useMemo(()=>{var O,q,oe,Pe;return{type:!0,basic:lt?!qe:!J&&(et||!Ue),model:!!((O=Be.modelName)!=null&&O.trim()||(q=Be.modelProvider)!=null&&q.trim()||(oe=Be.modelApiBase)!=null&&oe.trim()),tools:vt.length>0||an.length>0,skills:Se.length>0,knowledge:Be.knowledgebase,advanced:Be.memory.shortTerm||Be.memory.longTerm||Be.tracing,subagents:(((Pe=Be.subAgents)==null?void 0:Pe.length)??0)>0,review:Yn}},[Be,J,Ue,et,lt,Yn,vt,an,Se]),kn=et||lt?["type","basic"]:["type","basic","model","tools","skills","knowledge",...pt?["advanced"]:[]],Mt=uI.filter(O=>kn.includes(O.id)),Nn=kn.join("|"),mr=Ut.join("."),Lt=Mt.findIndex(O=>O.id===gt),jn=O=>{var q;(q=Bt.current[O])==null||q.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(P)return;const O=bt.current;if(!O)return;const q=Nn.split("|");let oe=0;const Pe=()=>{oe=0;const it=q[q.length-1];let tn=q[0];if(O.scrollTop+O.clientHeight>=O.scrollHeight-2)tn=it;else{const We=O.getBoundingClientRect().top+24;for(const Gt of q){const Et=Bt.current[Gt];if(!Et||Et.getBoundingClientRect().top>We)break;tn=Gt}}tn&&Ge(We=>We===tn?We:tn)},nt=()=>{oe||(oe=window.requestAnimationFrame(Pe))};return Pe(),O.addEventListener("scroll",nt,{passive:!0}),window.addEventListener("resize",nt),()=>{O.removeEventListener("scroll",nt),window.removeEventListener("resize",nt),oe&&window.cancelAnimationFrame(oe)}},[P,Nn,mr]);const lr=()=>Yn?!0:(C(!0),L(O=>O+1),Rt[0]&&(Pt(Rt[0].path),window.requestAnimationFrame(()=>jn("basic"))),!1),gr=async()=>{Ce(null);const O=[...ge.current.values()];ge.current.clear(),xe(0),te(q=>q.map(oe=>({...oe,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(O.map(async({run:q})=>{try{await $l(q.runId),cd(q.runId)}catch(oe){console.warn("清理调试运行失败",oe)}}))},Ar=async O=>{const q=ge.current.get(O);if(q){ge.current.delete(O),xe(ge.current.size);try{await $l(q.run.runId),cd(q.run.runId)}catch(oe){console.warn("清理调试运行失败",oe)}}},Ks=O=>{const q=ge.current.get(O),oe=de.find(Pe=>Pe.id===O);!q||!oe||Ce({runId:q.run.runId,sessionId:q.sessionId,variantName:oe.name})},Hr=async()=>D!=="validate"||be===0?!0:window.confirm("离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。")?(await gr(),!0):!1,ns=async O=>{if(await Hr()){if(le(""),!lr()){U("build");return}G(!0);try{const q=O?de.find(nt=>nt.id===O):en;q&&ne(q.id);const oe=q?{...h,modelName:q.modelName||h.modelName,description:q.description,instruction:q.instruction}:h,Pe=await Mv(gB(oe));oe!==h&&p(oe),A(Pe),U("publish")}catch(q){le(q instanceof Error?q.message:String(q))}finally{G(!1)}}},Ys=async O=>{if(!Q||z||!lr())return;const q=de.find(Dn=>Dn.id===O);if(!q||q.phase==="starting"||q.phase==="sending")return;const oe=q.modelName.trim(),Pe=q.description.trim(),nt=q.instruction.trim(),it=gc(q),tn=de.findIndex(Dn=>Dn.id===O),We=de.findIndex(Dn=>gc(Dn)===it);if(!oe||!Pe||!nt||We!==tn)return;const Gt=Dg(Wn,q);te(Dn=>Dn.map($t=>$t.id===O?{...$t,configOpen:!1,phase:"starting",messages:[],error:null}:$t)),Ae("");let Et=null;try{await Ar(O),await zt();const Dn={...h,modelName:q.modelName||h.modelName,description:q.description,instruction:q.instruction};Et=await hj(yB(Dn)),Rye(Et.runId);const $t=await pj(Et.runId,"test_user");ge.current.set(O,{run:Et,sessionId:$t}),xe(ge.current.size),te(vs=>vs.map(qs=>qs.id===O?{...qs,phase:"ready",runtimeSnapshot:Gt}:qs))}catch(Dn){if(Et)try{await $l(Et.runId),cd(Et.runId)}catch($t){console.warn("清理调试运行失败",$t)}te($t=>$t.map(vs=>vs.id===O?{...vs,phase:"error",runtimeSnapshot:"",error:Dn instanceof Error?Dn.message:String(Dn)}:vs))}},Es=async()=>{const O=ke.trim(),q=de.filter(Pe=>Pe.phase==="ready"&&Pe.runtimeSnapshot===Dg(Wn,Pe)&&ge.current.has(Pe.id));if(!O||q.length===0)return;Ae("");const oe=new Set(q.map(Pe=>Pe.id));te(Pe=>Pe.map(nt=>oe.has(nt.id)?{...nt,phase:"sending",messages:[...nt.messages,{role:"user",content:O},{role:"assistant",content:"",blocks:[]}]}:nt)),await Promise.all(q.map(async Pe=>{const nt=ge.current.get(Pe.id);if(nt)try{let it=ci();for await(const tn of gj({runId:nt.run.runId,userId:"test_user",sessionId:nt.sessionId,text:O})){const We=tn.error||tn.errorMessage||tn.error_message;if(te(Gt=>Gt.map(Et=>{if(Et.id!==Pe.id)return Et;const Dn=[...Et.messages],$t={...Dn[Dn.length-1]};return We?$t.error=String(We):(it=Vc(it,tn),$t.content=it.blocks.filter(vs=>vs.kind==="text").map(vs=>vs.text).join(""),$t.blocks=it.blocks),Dn[Dn.length-1]=$t,{...Et,messages:Dn}})),We)break}}catch(it){te(tn=>tn.map(We=>{if(We.id!==Pe.id)return We;const Gt=[...We.messages],Et={...Gt[Gt.length-1]};return Et.error=it instanceof Error?it.message:String(it),Gt[Gt.length-1]=Et,{...We,messages:Gt}}))}finally{te(it=>it.map(tn=>tn.id===Pe.id?{...tn,phase:"ready"}:tn))}}))},Vi=()=>{te(O=>{if(O.length>=3)return O;const q=ye.current++,oe=`variant-${q}`;return[...O,{id:oe,name:`对照组 ${q}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},Cr=async O=>{await Ar(O),te(q=>q.filter(oe=>oe.id!==O)),pe===O&&ne("baseline")},Ki=(O,q)=>te(oe=>oe.map(Pe=>Pe.id===O?{...Pe,...q}:Pe)),xa=(O,q,oe)=>{Ki(O,{[q]:oe}),!(pe!==O||O==="baseline")&&ne("baseline")},vi=O=>{const q=de.find(Gt=>Gt.id===O);if(!q)return;const oe=q.modelName.trim(),Pe=q.description.trim(),nt=q.instruction.trim(),it=gc(q),tn=de.findIndex(Gt=>Gt.id===O),We=de.findIndex(Gt=>gc(Gt)===it);if(!(!oe||!Pe||!nt||We!==tn)){if(O==="baseline"){Ki(O,{configOpen:!1});return}Ys(O)}},Iu=async(O,q,oe)=>{var it;const Pe=(it=h.deployment)==null?void 0:it.network,nt=Pe&&Pe.mode&&Pe.mode!=="public"?{mode:Pe.mode,vpc_id:Pe.vpcId,subnet_ids:Pe.subnetIds,enable_shared_internet_access:Pe.enableSharedInternetAccess}:void 0;return m0(O.name,O.files,{region:(a==null?void 0:a.region)??B,projectName:"default",network:nt},{...oe,onStage:q,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},Ws=()=>{lr()&&(te(O=>O.map(q=>q.id==="baseline"&&!ge.current.has(q.id)?{...q,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:q)),U("validate"))},Ru=async O=>{if(O==="publish"){P?U("publish"):ns();return}if(O==="validate"){Ws();return}await Hr()&&U(O)},xs=Nt.current,ws=O=>uI.find(q=>q.id===O);return o.jsxs("div",{className:"cw-root",children:[o.jsx(Xye,{mode:D,agentName:Wye(h),busy:z,onChange:Ru,onDiscard:f?()=>{R?M(!0):f()}:void 0}),ze&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:ze}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[D==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(oi,{initial:!1,mode:"wait",children:b?o.jsxs(Zt.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(Zt.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:O=>{O.preventDefault(),Wt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:O=>g(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),Wt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Cg,{draft:h,direction:"vertical",selectedPath:Ut,onSelect:Pt,onAdd:Jt,onInsert:Mn,onDelete:Kn}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:bt,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsx(xs,{meta:ws("type"),children:o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:aye.map(O=>{const q=(Be.agentType??"llm")===O.id,oe=pt&&O.id==="a2a",Pe=oe?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":O.id,className:`cw-agent-type-option ${q?"is-on":""} ${oe?"is-disabled":""}`,title:oe?void 0:dI[O.id],tabIndex:oe?0:void 0,"aria-describedby":Pe,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:q,disabled:oe,onChange:()=>sn(O.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Mye[O.id]}),o.jsx("small",{children:dI[O.id]})]}),oe&&o.jsx("span",{id:Pe,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},O.id)})})}),o.jsx(xs,{meta:ws("basic"),children:o.jsxs("div",{className:"cw-form",children:[!lt&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pt?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Xe(J)}`,value:Be.name,placeholder:"customer_service",onChange:O=>ce({name:O.target.value})}),$&&Kt?o.jsx("span",{className:"cw-error-text",children:Kt}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pt?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Xe(rt)}`,value:Be.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:O=>ce({description:O.target.value})}),$&&rt?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:pt?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),et?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Be.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:Be.maxIterations??3,onChange:O=>ce({maxIterations:Math.max(1,Number(O.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):lt?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(Pye,{value:((nr=Be.a2aRegistry)==null?void 0:nr.registrySpaceId)??"",region:((va=Be.a2aRegistry)==null?void 0:va.registryRegion)||mi.region,invalid:$&&qe,onChange:O=>rn(uB,O)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ft,"aria-controls":Re,onClick:()=>X(O=>!O),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${ft?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ft&&o.jsx(Zt.div,{id:Re,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:o.jsx(Fl,{env:jye,values:dB(Be.a2aRegistry,{includeDefaults:!1}),onChange:rn})})}),$&&qe&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(Iye,{value:Be.instruction,invalid:Ue,onChange:O=>ce({instruction:O})})}),$&&Ue?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!et&&!lt&&o.jsxs(o.Fragment,{children:[o.jsx(xs,{meta:ws("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:Be.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:O=>ce({modelName:O.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Ee,"aria-controls":Je,onClick:()=>ut(O=>!O),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${Ee?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:Ee&&o.jsxs(Zt.div,{id:Je,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:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:Be.modelProvider??"",placeholder:"openai",onChange:O=>ce({modelProvider:O.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:Be.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:O=>ce({modelApiBase:O.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(xs,{meta:ws("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(hI,{items:ol,selected:vt,onToggle:Qe,scrollRows:6})}),o.jsx(oi,{initial:!1,children:vt.includes("run_code")&&o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(Fl,{env:((Yi=ol.find(O=>O.id==="run_code"))==null?void 0:Yi.env)??[],values:((Nl=h.deployment)==null?void 0:Nl.envValues)??{},onChange:Ve})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ee,"aria-controls":It,onClick:()=>me(O=>!O),children:[o.jsx("span",{children:"更多类型工具"}),an.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",an.length]}),o.jsx(Ds,{className:`cw-more-options-chevron ${ee?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ee&&o.jsx(Zt.div,{id:It,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(Fye,{tools:an,onChange:O=>ce({mcpTools:O})})]})})})]})}),o.jsx(xs,{meta:ws("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx($ye,{selected:Se,onChange:O=>ce({selectedSkills:O})})})}),o.jsx(xs,{meta:ws("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.knowledgebase,onChange:O=>ce({knowledgebase:O}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:rm}),Be.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(Jb,{options:FE,value:Be.knowledgebaseBackend,onChange:O=>ce({knowledgebaseBackend:O,knowledgebaseIndex:O==="viking"?Be.knowledgebaseIndex:""})}),(Be.knowledgebaseBackend??Wc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(Bye,{value:Be.knowledgebaseIndex??"",onChange:O=>ce({knowledgebaseIndex:O})})]}),o.jsx(Fl,{env:((Sl=FE.find(O=>O.id===(Be.knowledgebaseBackend??Wc)))==null?void 0:Sl.env)??[],values:((_a=h.deployment)==null?void 0:_a.envValues)??{},onChange:Ve})]})]})}),pt&&o.jsxs("section",{ref:O=>{Bt.current.advanced=O},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Le,"aria-controls":St,onClick:()=>Ye(O=>!O),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx(Ds,{className:`cw-advanced-disclosure-chevron ${Le?"is-open":""}`,"aria-hidden":!0}),ve>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",ve]})]}),o.jsx(oi,{initial:!1,children:Le&&o.jsxs(Zt.div,{id:St,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.memory.shortTerm,onChange:O=>ce({memory:{...Be.memory,shortTerm:O}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:CM}),Be.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(Jb,{options:PE,value:Be.shortTermBackend,onChange:O=>ce({shortTermBackend:O})}),o.jsx(Fl,{env:((ka=PE.find(O=>O.id===(Be.shortTermBackend??"local")))==null?void 0:ka.env)??[],values:((Na=h.deployment)==null?void 0:Na.envValues)??{},onChange:Ve})]}),o.jsx(ud,{checked:Be.memory.longTerm,onChange:O=>ce({memory:{...Be.memory,longTerm:O}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:rm}),Be.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(Jb,{options:BE,value:Be.longTermBackend,onChange:O=>ce({longTermBackend:O})}),o.jsx(Fl,{env:((Tl=BE.find(O=>O.id===(Be.longTermBackend??"local")))==null?void 0:Tl.env)??[],values:((bo=h.deployment)==null?void 0:bo.envValues)??{},onChange:Ve}),o.jsx(ud,{checked:!!Be.autoSaveSession,onChange:O=>ce({autoSaveSession:O}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:rm})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.tracing,onChange:O=>ce({tracing:O}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:yv}),Be.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(hI,{items:UE,selected:ue,onToggle:ot}),o.jsx(Fl,{env:UE.filter(O=>ue.includes(O.id)).flatMap(O=>O.env),values:((Gs=h.deployment)==null?void 0:Gs.envValues)??{},onChange:Ve})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(Zt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Lt,0)/Math.max(Mt.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),Mt.map(O=>{const q=O.id===gt,oe=Yt[O.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${q?"is-active":""} ${oe?"is-done":""}`,onClick:()=>jn(O.id),"aria-current":q?"step":void 0,"aria-label":O.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:q?o.jsx("span",{className:"cw-dot"}):oe?o.jsx(zs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:O.label})]})},O.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Ws,children:o.jsx("span",{children:"开始调试"})})]})]})]}),D==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(qye,{enabled:Q,disabledReason:se,variants:de,draftSnapshot:Wn,input:ke,onInput:Ae,onSend:Es,onStartVariant:Ys,onDeployVariant:O=>void ns(O),onAddVariant:Vi,onRemoveVariant:Cr,onToggleConfig:O=>{const q=de.find(oe=>oe.id===O);q&&Ki(O,{configOpen:!q.configOpen})},onCompleteConfig:vi,onConfigChange:xa,onOpenTrace:Ks})})}),D==="publish"&&o.jsx("div",{className:"cw-preview-body",children:P?o.jsx(ey,{embedded:!0,project:P,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:pB(h),releaseConfiguration:en?{modelName:en.modelName||h.modelName||"默认模型",description:en.description,instruction:en.instruction,optimizations:en.optimizations.flatMap(O=>{const q=bB.find(oe=>oe.id===O);return q?[q.label]:[]})}:void 0,onChange:A,onDeploy:Iu,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((_t=h.deployment)!=null&&_t.feishuEnabled),onFeishuEnabledChange:O=>{const q={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:O}};p(q)},deploymentEnv:vn.specs,deploymentEnvValues:{...(Eo=h.deployment)==null?void 0:Eo.envValues,...vn.fixedValues},onDeploymentEnvChange:Ve,network:(V=h.deployment)==null?void 0:V.network,onNetworkChange:O=>p(q=>({...q,deployment:{...q.deployment??{feishuEnabled:!1},network:O}})),deployRegion:B,onDeployRegionChange:re,onExportYaml:()=>Oye(`${h.name||"agent"}.yaml`,S0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(Ft,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),He&&o.jsx(aB,{testRunId:He.runId,sessionId:He.sessionId,title:`调用链路 · ${He.variantName}`,onClose:()=>Ce(null)}),W&&o.jsx("div",{className:"confirm-scrim",onClick:()=>M(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:O=>O.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>M(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{M(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:O=>O.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function Xi(e){return{...Pr(),...e}}const Zye=[{id:"support",icon:Jz,draft:Xi({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Dz,draft:Xi({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:eV,draft:Xi({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:mv,draft:Xi({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:oV,draft:Xi({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:wV,draft:Xi({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Xi({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Xi({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Xi({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Jye(e){const t=[];return e.tools.length&&t.push({icon:MM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:jz,label:"记忆"}),e.knowledgebase&&t.push({icon:Mz,label:"知识库"}),e.tracing&&t.push({icon:Oz,label:"观测"}),e.subAgents.length&&t.push({icon:OM,label:`子Agent ${e.subAgents.length}`}),t}function ebe({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(nbe,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(tbe,{onPick:r})})}function tbe({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:Zye.map((t,n)=>o.jsxs(Zt.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:Hs(t.draft.description)})]},t.id))})]})}function nbe({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=Jye(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(hv,{className:"icon"})," 返回模板列表"]}),o.jsxs(Zt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:Hs(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:rbe(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:Hs(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx(Ds,{className:"icon"})]})]})]})}function rbe(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const sbe=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:IM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:vM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:wv}];let Dx=0;function s1(){return Dx+=1,`node_${Dx}`}function i1(e,t,n){const r=Pr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function ibe({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(kr,{type:"target",position:Fe.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(il,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(kr,{type:"source",position:Fe.Right,className:"wfb-handle"})]})}const abe={agentNode:ibe},gI={type:"smoothstep",markerEnd:{type:nu.ArrowClosed,width:16,height:16}};function obe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Dx=0;const C=s1();return i1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=r6([u]),[p,m,g]=s6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>eB({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Lc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Lc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=d.length>0&&k===null&&d.every(C=>Lc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(j=>R4({...C,...gI},j)),[m]),R=E.useCallback(()=>{const C=s1(),j=d.length*28,L=i1(C,{x:80+j,y:120+j});f(P=>P.concat(L)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},D=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),U=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const L=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),P=s1(),A=i1(P,L);f(z=>z.concat(A)),y(P)},[f]),W=E.useCallback(C=>{w&&f(j=>j.map(L=>L.id===w?{...L,data:{...L.data,agent:{...L.data.agent,...C}}}:L))},[w,f]),M=E.useCallback(()=>{w&&(f(C=>C.filter(j=>j.id!==w)),m(C=>C.filter(j=>j.source!==w&&j.target!==w)),y(null))},[w,f,m]),$=E.useCallback(()=>{if(!T)return;const C=d.map(L=>L.data.agent),j={...Pr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(L=>({id:L.id,agent:L.data.agent})),edges:p.map(L=>({from:L.source,to:L.target}))}};t(j)},[T,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:sbe.map(({type:C,label:j,desc:L,Icon:P})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(P,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:j}),o.jsx("span",{className:"wfb-type-desc",children:L})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(Zz,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(il,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(dr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:$,disabled:!T,type:"button",children:[o.jsx(al,{className:"icon"}),"创建工作流"]}),o.jsxs(n6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:abe,defaultEdgeOptions:gI,onDrop:U,onDragOver:D,onNodeClick:(C,j)=>y(j.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(a6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(l6,{showInteractive:!1}),o.jsx(ofe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:M,title:"删除节点",children:o.jsx(Fi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>W({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>W({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>W({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>W({tools:C.target.value.split(",").map(j=>j.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(il,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function lbe(e){return o.jsx(C_,{children:o.jsx(obe,{...e})})}const yI=50*1024*1024,Px=800,cbe={name:"code_package",files:[]};function ube(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 dbe(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 fbe(e){const t=e.flatMap(a=>{const l=dbe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Px)throw new Error(`代码包文件数不能超过 ${Px} 个。`);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 hbe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,T]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(U){const W=++l.current;if(x(""),!U.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(U.size>yI){x("代码包不能超过 50 MB。");return}g(!0);try{const M=await nB(new Uint8Array(await U.arrayBuffer()),{maxEntries:Px,maxUncompressedBytes:yI}),$=fbe(M);if(W!==l.current)return;f(U.name),u({name:ube(U.name),files:$})}catch(M){if(W!==l.current)return;f(""),u(null),x(M instanceof Error?M.message:String(M))}finally{W===l.current&&g(!1)}}function R(U){var M;const W=(M=U.currentTarget.files)==null?void 0:M[0];U.currentTarget.value="",W&&S(W)}function I(U){var M;U.preventDefault(),y(!1);const W=(M=U.dataTransfer.files)==null?void 0:M[0];W&&S(W)}async function D(U,W,M){const $=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return m0(U.name,U.files,{region:_,projectName:"default",network:$},{...M,onStage:W})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(ey,{project:c??cbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:D,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:T,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:U=>{U.preventDefault(),y(!0)},onDragOver:U=>U.preventDefault(),onDragLeave:U=>{U.currentTarget.contains(U.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var U;m||(U=a.current)==null||U.click()},onKeyDown:U=>{var W;!m&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),(W=a.current)==null||W.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:U=>{U.stopPropagation(),p(!0)},onKeyDown:U=>U.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(J5,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const pbe=3*60*1e3,mbe=3e3,gbe=10*60*1e3,Pg="veadk.studio.pending-update",bI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],ybe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function bbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function Ebe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function xbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Pg);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(Pg),null}function a1(e,t){window.localStorage.setItem(Pg,JSON.stringify({targetVersion:e,startedAt:t}))}function Fp(){window.localStorage.removeItem(Pg)}function EI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function wbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function vbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function xI({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function _be(){var W,M;const[e]=E.useState(xbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const $=j=>{var L;j.target instanceof Node&&!((L=y.current)!=null&&L.contains(j.target))&&h(!1)},C=j=>{j.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",$),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",$),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const $=await lj(b.current||void 0,x.current||void 0);return n($),$},[]);if(E.useEffect(()=>{let $=!0;const C=()=>{_().catch(()=>{$&&n(L=>L)})};C();const j=window.setInterval(C,pbe);return()=>{$=!1,window.clearInterval(j)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const $=window.setInterval(()=>{_().then(C=>{const j=b.current;if(j&&Ebe(C.currentVersion,j)||!j&&!C.available&&C.latestVersion){window.clearInterval($),Fp(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval($),Fp(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>gbe&&(window.clearInterval($),Fp(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},mbe);return()=>window.clearInterval($)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),a1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const $=()=>{const j=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-j)/1e3)))};$();const C=window.setInterval($,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],T=u||((W=N[0])==null?void 0:W.version)||t.latestVersion,S=N.find($=>$.version===T),R=async()=>{b.current=T,x.current=Date.now(),a1(T,x.current),s("submitting"),c(""),m("idle");try{const $=await cj(T);b.current=$.version,a1($.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch($){if($ instanceof TypeError){c("连接已切换,正在确认新版本状态");return}Fp(),s("error");const C=$ instanceof Error?$.message:"Studio 更新失败";try{const j=await _();c(j.message||C)}catch{c(C)}}},I=(M=t.updateLogs)!=null&&M.length?t.updateLogs:(t.errorLog||t.progressMessage||l).split(` +`).filter(Boolean),D=async()=>{try{await navigator.clipboard.writeText(I.join(` +`)),m("copied")}catch{m("error")}},U=()=>{var $;h(!1),m("idle"),c(""),d(b.current||(($=N[0])==null?void 0:$.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var $;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d((($=N[0])==null?void 0:$.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(EI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(ma,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(EI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:ybe[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(xI,{lines:I,phase:"error",copyState:p,onCopy:()=>void D()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":bbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:bI.map(($,C)=>{const j=bI.findIndex(A=>A.id===t.progressStage),L=r==="published"||Cvoid D()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h($=>!$),onKeyDown:$=>{($.key==="ArrowDown"||$.key==="ArrowUp")&&($.preventDefault(),h(!0))},children:[o.jsx("span",{children:T}),o.jsx(wbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map($=>{const C=$.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d($.version),h(!1)},children:[o.jsx("span",{children:$.version}),C&&o.jsx(vbe,{})]},$.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map($=>o.jsx("li",{children:$},$))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:U,children:"重新尝试"})]})]})})]})}const kbe="/web/skill-creator";class sk extends Error{constructor(n,r){super(n);Mk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function kl(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function bn(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function EB(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Ch(e,t){return fetch(Pi(`${kbe}${e}`),{...t,headers:f0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function ik(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=kl(await e.json(),"错误响应");return bn(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ak(e,t){if(!e.ok)throw new sk(await ik(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Nbe(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 Sbe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Tbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=kl(t,`文件 ${n+1}`),s=bn(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=EB(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Abe(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 Cbe(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=kl(t,`活动 ${n+1}`),s=bn(r,"id"),i=bn(r,"kind"),a=bn(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=bn(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 l=bn(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function Ibe(e,t){const n=kl(e,`候选方案 ${t+1}`),r=bn(n,"id","candidate_id","candidateId"),s=bn(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:bn(n,"modelLabel","model_label")??s,status:Nbe(n.status),stage:Sbe(n.stage),name:bn(n,"name","skill_name","skillName"),description:bn(n,"description"),skillMd:bn(n,"skillMd","skill_md"),files:Tbe(n.files),activities:Cbe(n.activities),validation:Abe(n.validation),durationMs:EB(n,"elapsedMs","elapsed_ms"),error:bn(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:bn(n,"skill_id","skillId"),version:bn(n,"version")}}function Bx(e,t=""){const n=kl(e,"Skill 创建任务"),r=bn(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Ibe):[],i=bn(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:bn(n,"prompt")??t,status:i,candidates:s}}async function Rbe(e,t){const n=await Ch("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new sk(await ik(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Bx(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="",l;const c=u=>{if(!u.trim())return;const d=kl(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(bn(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Bx(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Obe(e){const t=await Ch(`/jobs/${encodeURIComponent(e)}`);return Bx(await ak(t,"读取 Skill 任务失败"))}async function Lbe(e){const t=await Ch(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ak(t,"清理 Skill 任务失败")}async function Mbe(e,t){var l;const n=await Ch(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await ik(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 jbe(e,t,n){const r=await Ch(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=kl(await ak(r,"添加到 AgentKit 失败"),"发布结果"),i=bn(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:bn(s,"name"),version:bn(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:bn(s,"message")}}const Dbe=()=>{};function Pbe(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 Bbe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map(Pbe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(F_,{blocks:t,onAction:Dbe})})}const wI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},vI=12e4;function Fbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Ube(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function $be(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Hbe({candidate:e}){var c,u;const[t,n]=E.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,vI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>vI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function zbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),T=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",D=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(Fbe,{status:n.status})}),R?o.jsx(ma,{duration:2.2,spread:16,children:wI[n.stage]}):o.jsx("span",{children:wI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Bbe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var U;return(U=S.current)==null?void 0:U.focus()})},children:[o.jsx(Ube,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()})},children:[o.jsx($be,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(D==null?void 0:D.valid)===!1?"is-invalid":"is-valid",children:(D==null?void 0:D.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,D&&(D.errors.length>0||D.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...D.errors,...D.warnings].map((U,W)=>o.jsx("div",{children:U},`${U}-${W}`))]}):null,o.jsx(Hbe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Mbe(t,n.id).catch(U=>{w(U instanceof Error?U.message:String(U))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:U=>{U.preventDefault();const W=y.split(",").map(M=>M.trim()).filter(Boolean);c({skillSpaceIds:W,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:U=>b(U.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:U=>_(U.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:U=>N(U.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const _I=new Set(["completed"]),Up=1100,Vbe=3e4;function Kbe(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 Ybe({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(_I.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Vbe,_=async()=>{try{const k=await Obe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),_I.has(k.status)||(b=window.setTimeout(_,Up)))}catch(k){if(!y){const N=k instanceof sk?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=U_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??Kbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await jbe(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(zbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const o1="/web/sandbox/sessions",Wbe=33e4,Gbe=6e5,qbe=15e3;function l1(e){const t=f0(e);return t.set("Accept","application/json"),t}async function c1(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 Xbe(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 u1={async startSession(e={}){const t=await fetch(Pi(o1),{method:"POST",headers:l1({"Content-Type":"application/json"}),signal:pi(e.signal,Wbe)});if(!t.ok)throw await c1(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(Pi(`${o1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:l1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:pi(t.signal,Gbe)});if(!n.ok)throw await c1(n,"沙箱对话失败,请稍后重试。");return Xbe(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Pi(`${o1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:l1(),signal:pi(t.signal,qbe)});if(!n.ok&&n.status!==404)throw await c1(n,"无法清理 AgentKit 沙箱会话。")}},Qbe=1e4;async function xB(e){const t=await fetch(Pi(e),{headers:f0({Accept:"application/json"}),signal:pi(void 0,Qbe)});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 Zbe(){return xB("/web/sandbox/capabilities")}async function Jbe(){return xB("/web/skill-creator/capabilities")}function e1e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 t1e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return ps.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(e1e,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function n1e({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function r1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 s1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function i1e(e){return e.toLowerCase()==="github"?o.jsx(Qz,{className:"icon"}):o.jsx(rV,{className:"icon"})}function a1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),PM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=NV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(ma,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>TV(m.loginUrl),children:[i1e(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Fd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function o1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?ps.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(l0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function l1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}_l("Button",l1e);function c1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}_l("Card",c1e);const u1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},d1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function wB(e){return u1e[e]??"flex-start"}function vB(e){return d1e[e]??"stretch"}function f1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:wB(e.justify),alignItems:vB(e.align)},children:n.map(r=>t.render(r))})}_l("Column",f1e);function h1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}_l("Divider",h1e);const p1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function m1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:p1e[t]??"•"})}_l("Icon",m1e);function g1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:wB(e.justify),alignItems:vB(e.align??"center")},children:n.map(r=>t.render(r))})}_l("Row",g1e);const y1e=new Set(["h1","h2","h3","h4","h5"]);function b1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=y1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}_l("Text",b1e);async function $p(e){const[t,n,r]=await Promise.allSettled([Zbe(),Jbe(),Iv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const E1e="创建 Agent",x1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Mo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},w1e=new Set,v1e=[];function Qi(){return{skills:[]}}function Po(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function d1(e){return`${Po(e)}.active`}function Fx(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function _1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Po(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function k1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Fx(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ux(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Ux(n,t);if(r)return r}}function _B(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(..._B(n)));return t}function kI(){const e=typeof localStorage<"u"?localStorage.getItem(Mo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function N1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 S1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function kB(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 T1e(e){if(!e)return"";const t=[];return e.ts&&t.push(kB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function NI(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const A1e="send_a2ui_json_to_client";function C1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===A1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?H6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function I1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function R1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function O1e(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 SI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(zs,{className:"icon"}):o.jsx(c0,{className:"icon"})})}function L1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function M1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx(Ft,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(SM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(l0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(NE,{className:"global-deploy-task-icon"}):o.jsx(nV,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(pv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:L1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Mg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const TI=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],AI=()=>TI[Math.floor(Math.random()*TI.length)];function f1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function j1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function D1e(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 P1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[T,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[D,U]=E.useState({}),W=a?D[a]??[]:f,M=p?g:W,$=(F,K)=>U(ie=>({...ie,[F]:typeof K=="function"?K(ie[F]??[]):K})),[C,j]=E.useState(""),[L,P]=E.useState("agent"),[A,z]=E.useState(null),[G,B]=E.useState({}),re=E.useRef(new Map),Q=G.ready===!0&&G.agentId===n,[se,de]=E.useState(null),[te,pe]=E.useState(!1),ne=E.useRef(0),[ye,ge]=E.useState([]),[be,xe]=E.useState(Qi),[ke,Ae]=E.useState(null),[He,Ce]=E.useState(0),[gt,Ge]=E.useState(!1),[ze,le]=E.useState(null),[Ee,ut]=E.useState(!1),[ft,X]=E.useState([]),[ee,me]=E.useState(!1),Le=E.useRef(new Set),[Ye,Ze]=E.useState(()=>new Set),[Pt,bt]=E.useState(()=>new Set),Bt=E.useRef(new Map),zt=E.useRef(new Map),Nt=(F,K)=>Ze(ie=>{const fe=new Set(ie);return K?fe.add(F):fe.delete(F),fe}),Ut=F=>{const K=zt.current.get(F);K!==void 0&&window.clearTimeout(K),zt.current.delete(F),bt(ie=>new Set(ie).add(F))},Be=F=>{const K=zt.current.get(F);K!==void 0&&window.clearTimeout(K);const ie=window.setTimeout(()=>{zt.current.delete(F),bt(fe=>{const Te=new Set(fe);return Te.delete(F),Te})},2400);zt.current.set(F,ie)},pt=E.useRef(""),[Je,Re]=E.useState(""),[It,St]=E.useState(""),ce=E.useRef(null);E.useEffect(()=>()=>{ce.current!==null&&window.clearTimeout(ce.current)},[]);const[Ve,at]=E.useState(()=>new Set),[rn,sn]=E.useState(!1),[fn,Wt]=E.useState(!1),Jt=E.useRef(null),Mn=E.useCallback(()=>Wt(!1),[]),[Vn,Kn]=E.useState(AI),[vt,an]=E.useState(null),[ue,Se]=E.useState(!1),[ve,Qe]=E.useState(!1),[ot,et]=E.useState(""),lt=E.useRef(!1),[Vt,Kt]=E.useState(null),[J,rt]=E.useState(""),[Ue,qe]=E.useState(),[Xe,Rt]=E.useState(null),[Yn,Wn]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[en,vn]=E.useState("cloud"),[Yt,_n]=E.useState(Af),[kn,Mt]=E.useState(""),[Nn,mr]=E.useState("chat"),[Lt,jn]=E.useState(!1),[lr,gr]=E.useState(!1),[Ar,Ks]=E.useState(!1),[Hr,ns]=E.useState({}),[Ys,Es]=E.useState({}),[Vi,Cr]=E.useState({}),Ki=Ye.has(a),xa=Pt.has(a),vi=Ki||u,Iu=!!a&&Ee,Ws=p?y:vi,Ru=Ws||!p&&xa,xs=Hr[a]??"",ws=Ys[a]??w1e,wa=Vi[a]??v1e,nr=ke==null?void 0:ke.graph,va=[ke==null?void 0:ke.name,nr==null?void 0:nr.name,nr==null?void 0:nr.id].filter(F=>!!F),Yi=be.targetAgent&&nr?Ux(nr,be.targetAgent.name):nr,Nl=(Yi==null?void 0:Yi.skills)??(be.targetAgent?[]:(ke==null?void 0:ke.skills)??[]),Sl=nr?_B(nr):[];function _a(F){f1(F);for(const K of F)K.status==="uploading"?Le.current.add(K.id):K.uri&&im(n,K.uri).catch(ie=>Re(String(ie)))}function ka(){ne.current+=1;const F=se;de(null),pe(!1),F&&!F.id.startsWith("pending-")&&Lbe(F.id).catch(K=>{Re(K instanceof Error?K.message:String(K))})}async function Na(F){try{await IE(n,J,F),await CE(n,J,F),i(K=>K.filter(ie=>ie.id!==F)),U(K=>{const{[F]:ie,...fe}=K;return fe})}catch(K){Re(String(K))}}function Tl(F){const K=ye.find(Te=>Te.id===F);if(!K)return;const ie=ye.filter(Te=>Te.id!==F);f1([K]),K.status==="uploading"&&Le.current.add(F),ge(ie),ie.length===0&&!C.trim()&&!!a&&M.length===0?(pt.current="",l(""),Na(a)):K.uri&&im(n,K.uri).catch(Te=>Re(String(Te)))}const bo=(F,K)=>{var Me,tt,_e,$e,dt;const ie=K.author&&K.author!=="user"?K.author:void 0;ie&&(ns(je=>({...je,[F]:ie})),Es(je=>({...je,[F]:new Set(je[F]??[]).add(ie)})),Cr(je=>{var ht;return(ht=je[F])!=null&&ht.length?je:{...je,[F]:[ie]}}));const fe=((Me=K.actions)==null?void 0:Me.transferToAgent)??((tt=K.actions)==null?void 0:tt.transfer_to_agent);fe&&Cr(je=>{const ht=je[F]??[];return ht[ht.length-1]===fe?je:{...je,[F]:[...ht,fe]}}),(((_e=K.actions)==null?void 0:_e.endOfAgent)??(($e=K.actions)==null?void 0:$e.end_of_agent)??((dt=K.actions)==null?void 0:dt.escalate))&&Cr(je=>{const ht=je[F]??[];return ht.length<=1?je:{...je,[F]:ht.slice(0,-1)}})},[Gs,_t]=E.useState(kI),[Eo,V]=E.useState([]),O=E.useCallback(F=>{V(K=>{const ie=K.findIndex(Te=>Te.id===F.id);if(ie===-1)return[F,...K];const fe=[...K];return fe[ie]={...fe[ie],...F},fe})},[]),q=E.useCallback(async F=>{try{await sj(F.id),V(K=>K.map(ie=>ie.id===F.id?{...ie,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:ie))}catch(K){const ie=K instanceof Error?K.message:String(K);V(fe=>fe.map(Te=>Te.id===F.id?{...Te,message:`取消失败:${ie}`}:Te))}},[]),[oe,Pe]=E.useState(!0),[nt,it]=E.useState(!1),[tn,We]=E.useState(!1),[Gt,Et]=E.useState(!1),[Dn,$t]=E.useState(null),[vs,qs]=E.useState([]),[ok,Ih]=E.useState([]),[zr,Xs]=E.useState(""),_s=E.useRef(null),[Rh,Ir]=E.useState(!1),[Ou,on]=E.useState(!1),[lk,ny]=E.useState(""),[NB,SB]=E.useState("good"),[TB,Lu]=E.useState("basic"),[AB,CB]=E.useState("good"),[Oh,Lh]=E.useState(""),[Qs,yr]=E.useState(!1),ry=E.useRef(null),[xo,Al]=E.useState(()=>{const F=As();return yu(F),F}),[IB,ck]=E.useState(!1),[RB,uk]=E.useState(""),[dk,Mh]=E.useState(null),[OB,fk]=E.useState({}),[LB,hk]=E.useState(()=>new Set),[Cl,_i]=E.useState(null),[jh,sy]=E.useState("cn-beijing"),[pk,Vr]=E.useState(""),[iy,Rr]=E.useState(""),[Ht,ks]=E.useState(null),[MB,Dh]=E.useState(!1),ay=E.useRef(!1),Ph=E.useRef(!1),jB=E.useCallback((F,K,ie)=>{!F||!J||qs(fe=>{const Me=[{id:F,draft:K,updatedAt:Date.now(),deploymentTarget:ie},...fe.filter(tt=>tt.id!==F)];return localStorage.setItem(Po(J),JSON.stringify(Me)),Me})},[J]),oy=E.useCallback(F=>{!F||!J||qs(K=>{const ie=K.filter(fe=>fe.id!==F);return localStorage.setItem(Po(J),JSON.stringify(ie)),ie})},[J]),DB=E.useCallback(F=>{if(!J||F.length===0)return;const K=new Set(F.map(ie=>ie.id));qs(ie=>{const fe=ie.filter(Te=>!K.has(Te.id));return localStorage.setItem(Po(J),JSON.stringify(fe)),fe}),K.has(zr)&&(Xs(""),$t(null),_i(null),_s.current=null,localStorage.removeItem(d1(J)))},[zr,J]),mk=E.useCallback(F=>{if(!F||!J)return;const K=_s.current;qs(ie=>{const fe=ie.filter(Me=>Me.id!==F),Te=(K==null?void 0:K.id)===F?[K,...fe]:fe;return localStorage.setItem(Po(J),JSON.stringify(Te)),Te})},[J]);E.useEffect(()=>{if(!J){qs([]),Ih([]),Xs(""),_s.current=null;return}const F=_1e(J);qs(F),Ih(k1e(J));const K=localStorage.getItem(d1(J))||"",ie=F.find(fe=>fe.id===K);_s.current=ie??null,Gs==="custom"&&ie&&(Xs(ie.id),$t(ie.draft),_i(ie.deploymentTarget??null))},[J]),E.useEffect(()=>{if(!J)return;const F=d1(J);Gs==="custom"&&zr?localStorage.setItem(F,zr):localStorage.removeItem(F)},[Gs,zr,J]);const PB=E.useCallback(F=>{if(!J)return;const K=[...new Set(F.filter(Boolean))];Ih(K),localStorage.setItem(Fx(J),JSON.stringify(K))},[J]),BB=E.useCallback(async F=>{const K=F.filter(_e=>!!_e.runtimeId&&_e.canDelete===!0);if(K.length===0)return;const ie=new Set(K.map(_e=>_e.runtimeId));hk(_e=>{const $e=new Set(_e);for(const dt of ie)$e.add(dt);return $e}),MC(ie);const fe=new Set,Te=new Set,Me=new Set,tt=[];for(const _e of K)try{if(!_e.region)throw new Error("Runtime 缺少地域信息,无法删除");await dj(_e.runtimeId,_e.region),ag(_e.runtimeId),fe.add(_e.runtimeId),Te.add(_e.id)}catch($e){const dt=$e instanceof Error?$e.message:String($e);Me.add(_e.runtimeId),tt.push(`${_e.label}: ${dt}`)}if(fe.size>0&&(MC(fe),Al(As()),Mh(_e=>{if(!_e)return _e;const $e=new Set(_e);for(const dt of fe)$e.delete(dt);return $e}),fk(_e=>Object.fromEntries(Object.entries(_e).filter(([$e])=>!fe.has($e)))),Ih(_e=>{const $e=_e.filter(dt=>!Te.has(dt));return J&&localStorage.setItem(Fx(J),JSON.stringify($e)),$e}),qs(_e=>{const $e=_e.filter(dt=>{var je;return!((je=dt.deploymentTarget)!=null&&je.runtimeId)||!fe.has(dt.deploymentTarget.runtimeId)});return J&&localStorage.setItem(Po(J),JSON.stringify($e)),$e}),K.some(_e=>_e.id===n)&&(pt.current="",l(""),r("")),Ht!=null&&Ht.runtime&&fe.has(Ht.runtime.runtimeId)&&(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),Vr(""),Rr(""),yr(!0),Re(""))),Me.size>0&&hk(_e=>{const $e=new Set(_e);for(const dt of Me)$e.delete(dt);return $e}),tt.length>0){const _e=tt.slice(0,3).join(";"),$e=tt.length>3?`;另有 ${tt.length-3} 个失败`:"";throw new Error(`${tt.length} 个 Agent 删除失败:${_e}${$e}`)}},[Ht,n,J]),ly=E.useCallback(async()=>{ck(!0),uk("");try{const F=[];let K="";do{const ie=await kc({scope:"mine",region:"all",pageSize:100,nextToken:K});F.push(...ie.runtimes),K=ie.nextToken}while(K&&F.length<2e3);Mh(new Set(F.map(ie=>ie.runtimeId))),fk(Object.fromEntries(F.map(ie=>[ie.runtimeId,{canDelete:ie.canDelete}])))}catch(F){uk(F instanceof Error?F.message:String(F))}finally{ck(!1)}},[]);function Bh(F){console.log("create agent draft:",F),_t(null),ko()}function cy(F,K){console.log("Agent added, navigating to:",F,K),Al(As()),Mh(null),oy(zr),Xs(""),_s.current=null,_i(null),Vr(""),Rr(F),Lu("basic"),_t(null),on(!0),r(F)}const gk=E.useCallback(F=>{_t(null),Et(!1),ks(null),on(!0),Rr(""),Lu("basic"),Vr(F.id),Re("")},[]),yk=E.useCallback(async F=>{if(!F.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const K=(Cl==null?void 0:Cl.region)??jh,ie=await ig(F.runtimeId,F.agentName,F.region??K,F.version);Al(As()),Ce(Te=>Te+1);const fe=await $p(ie);re.current.set(ie,fe),B(fe),Mh(Te=>{const Me=new Set(Te??[]);return Me.add(F.runtimeId),Me}),_i(null),oy(zr),Xs(""),_s.current=null,Rr(ie),Lu("basic"),_t(null),on(!0),r(ie)},[zr,jh,oy,Cl]),Mu=E.useRef(null),uy=E.useRef(new Map),wo=E.useRef(!0),Sa=E.useRef(!1),vo=E.useRef(null),bk=E.useRef({key:"",turnCount:0}),dy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const F=Mu.current,K=bk.current,ie=K.key!==dy,fe=!ie&&M.length>K.turnCount;if(bk.current={key:dy,turnCount:M.length},!F||M.length===0||!ie&&!fe)return;wo.current=!0,Sa.current=!1,vo.current!==null&&(window.clearTimeout(vo.current),vo.current=null);const Te=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(ie||Te){F.scrollTop=F.scrollHeight;return}Sa.current=!0,F.scrollTo({top:F.scrollHeight,behavior:"smooth"}),vo.current=window.setTimeout(()=>{Sa.current=!1,vo.current=null},450)},[dy,M.length]),E.useLayoutEffect(()=>{const F=Mu.current;!F||!wo.current||Sa.current||(F.scrollTop=F.scrollHeight)},[Ws,M]),E.useEffect(()=>{if(!Oh||Ou||M.length===0)return;const F=uy.current.get(Oh);if(!F)return;wo.current=!1,F.scrollIntoView({behavior:"smooth",block:"center"});const K=window.setTimeout(()=>{Lh("")},2600);return()=>window.clearTimeout(K)},[Oh,Ou,M]),E.useEffect(()=>()=>{vo.current!==null&&window.clearTimeout(vo.current)},[]);const FB=E.useCallback(()=>{const F=Mu.current;!F||Sa.current||(wo.current=F.scrollHeight-F.scrollTop-F.clientHeight<32)},[]),UB=E.useCallback(F=>{F.deltaY<0&&(Sa.current=!1,wo.current=!1)},[]),$B=E.useCallback(()=>{Sa.current=!1,wo.current=!1},[]),HB=E.useCallback(()=>{const F=Mu.current;!F||!wo.current||Sa.current||(F.scrollTop=F.scrollHeight)},[]),fy=E.useCallback(()=>{Kt(null),SE().then(F=>{rt(F.userId),qe(F.info),gr(!!F.local),an(F.status),F.status==="authenticated"&&(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),yr(!0))}).catch(F=>{Kt(F instanceof Error?F.message:String(F))})},[]);E.useEffect(()=>{fy()},[fy]),E.useEffect(()=>{const F=()=>{et(""),Se(!0)};return window.addEventListener(TE,F),jV()&&F(),()=>window.removeEventListener(TE,F)},[]);const zB=E.useCallback(async()=>{if(lt.current)return;lt.current=!0;const F=AV();if(!F){lt.current=!1,et("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),et("");try{for(;;){await new Promise(K=>window.setTimeout(K,1e3));try{const K=await SE();if(K.status==="authenticated"){rt(K.userId),qe(K.info),gr(!!K.local),an(K.status),Se(!1),DV(),F.close();return}}catch{}if(F.closed){et("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{lt.current=!1,Qe(!1)}},[]);E.useEffect(()=>{lr&&J&&fT(J)},[lr,J]),E.useEffect(()=>{if(vt!=="authenticated"||!J||!n){B({});return}const F=re.current.get(n);if(F){B(F);return}let K=!1;return B({}),$p(n).then(ie=>{K||(re.current.set(n,ie),B(ie))}),()=>{K=!0}},[n,vt,J]),E.useEffect(()=>{if(vt!=="authenticated"||!J){Rt(null);return}let F=!1;return Rt(null),oj().then(K=>{F||Rt(K)}).catch(K=>{console.warn("[app] /web/access failed; using ordinary-user access:",K),F||Rt(aj)}),()=>{F=!0}},[vt,J]),E.useEffect(()=>{ij().then(F=>{Wn(F.features),vn(F.agentsSource),_n(F.branding),Mt(F.version),mr(F.defaultView),jn(!0)})},[]),E.useEffect(()=>{!Xe||!Lt||Ph.current||Qs||(Ph.current=!0,Nn==="addAgent"&&Xe.capabilities.createAgents&&(_t(null),it(!1),Ir(!1),on(!1),We(!1),Et(!0)))},[Xe,Nn,Qs,Lt]),E.useEffect(()=>{Xe&&(Xe.capabilities.createAgents||(_t(null),$t(null),We(!1),Et(!1),V([])),Xe.capabilities.manageAgents||on(!1))},[Xe]),E.useEffect(()=>{vt!=="authenticated"||en!=="cloud"||!Lt||!Ou||Ht||ly()},[Ht,en,vt,Ou,ly,Lt]),E.useEffect(()=>{document.title=Yt.title;let F=document.querySelector('link[rel~="icon"]');F||(F=document.createElement("link"),F.rel="icon",document.head.appendChild(F)),F.removeAttribute("type"),F.href=Yt.logoUrl||jv},[Yt]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(F=>F.ok?F.json():null).then(F=>{F&&Pe(!!F.credentials)}).catch(F=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",F)})},[]);function VB(F){fT(F),ay.current=!0,Ph.current=!1,Rt(null),_t(null),$t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ko(),yr(!0),rt(F),qe({name:F}),gr(!0),an("authenticated")}function KB(){Ph.current=!1,Rt(null),lr?(SV(),rt(""),qe(void 0),an("unauthenticated")):IV()}E.useEffect(()=>{if(vt==="authenticated"){if(en==="cloud"){const F=localStorage.getItem(Mo.app),K=xo.flatMap(ie=>ie.apps.map(fe=>ro(ie.id,fe)));r(ie=>ie&&K.includes(ie)?ie:F&&K.includes(F)?F:K[0]??"");return}$M().then(F=>{t(F);const K=localStorage.getItem(Mo.app),ie=xo.flatMap(Me=>Me.apps.map(tt=>ro(Me.id,tt))),fe=K&&(F.includes(K)||ie.includes(K)),Te=["web_search_agent","web_demo"].find(Me=>F.includes(Me))??F.find(Me=>!/^\d/.test(Me))??F[0];r(fe?K:Te||"")}).catch(F=>Re(String(F)))}},[vt,en,xo]),E.useEffect(()=>{n&&localStorage.setItem(Mo.app,n)},[n]),E.useEffect(()=>{let F=!1;if(le(null),X([]),Qs||Ht||!n||!J||!a){ut(!1);return}return ut(!0),RE(n,J,a).then(K=>{F||(le(K),Iv(n).then(ie=>{F||X(ie)}).catch(()=>{F||X([])}))}).catch(()=>{F||le(null)}).finally(()=>{F||ut(!1)}),()=>{F=!0}},[Ht,n,Qs,J,a]),E.useEffect(()=>{let F=!1;if(Ae(null),xe(Qi()),vt!=="authenticated"||Qs||Ht||!n){Ge(!1);return}return Ge(!0),Rv(n).then(K=>{F||Ae(K)}).catch(()=>{F||Ae(null)}).finally(()=>{F||Ge(!1)}),()=>{F=!0}},[Ht,n,He,vt,Qs]),E.useEffect(()=>{Xe&&localStorage.setItem(Mo.view,Xe.capabilities.createAgents?Gs??"chat":"chat")},[Xe,Gs]),E.useEffect(()=>{localStorage.setItem(Mo.session,a),pt.current=a},[a]),E.useEffect(()=>()=>Bt.current.forEach(F=>F.abort()),[]),E.useEffect(()=>()=>zt.current.forEach(F=>{window.clearTimeout(F)}),[]),E.useEffect(()=>()=>{var F,K;(F=R.current)==null||F.abort(),(K=I.current)==null||K.abort()},[]),E.useEffect(()=>{if(Qs||Ht||p||!n||!J)return;let F=!1;return(async()=>{const K=await Fh(n);if(!F){if(!ay.current){ay.current=!0;const ie=localStorage.getItem(Mo.session)||"";if(kI()===null&&ie&&K.some(fe=>fe.id===ie)){ju(ie);return}}ko()}})(),()=>{F=!0}},[Ht,n,Qs,p,J]),E.useEffect(()=>{const F=ry.current;F&&F.app===n&&(ry.current=null,ju(F.sid))},[n]);function YB(F,K){Ir(!1),F===n?ju(K):(ry.current={app:F,sid:K},r(F))}async function Fh(F){try{const K=await Tv(F,J),ie=await Promise.all(K.map(fe=>{var Te;return(Te=fe.events)!=null&&Te.length?Promise.resolve(fe):rg(F,J,fe.id)}));return i(ie),ie}catch(K){return Re(String(K)),[]}}function Ek(){p||(Re(""),S(""),N("confirm"),_(!0))}function WB(){var F;(F=R.current)==null||F.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&L==="temporary"&&P("agent")}async function GB(){var K;(K=R.current)==null||K.abort();const F=new AbortController;R.current=F,N("loading"),S("");try{const ie=await u1.startSession({signal:F.signal});if(R.current!==F)return;pt.current="",l(""),h([]),j(""),xe(Qi()),P("temporary"),ka(),pe(!1),_a(ye),ge([]),w([]),m(ie),_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),_(!1),N("confirm")}catch(ie){if((ie==null?void 0:ie.name)==="AbortError"||R.current!==F)return;S(ie instanceof Error?ie.message:String(ie)),N("error")}finally{R.current===F&&(R.current=null)}}function _o(){var K;(K=I.current)==null||K.abort(),I.current=null,b(!1),w([]),j(""),Re(""),P("agent");const F=p;m(null),F&&u1.closeSession(F.id).catch(ie=>Re(String(ie)))}async function qB(F){var Te;const K=p;if(!K||y||!F.trim())return;Re("");const ie=new AbortController;(Te=I.current)==null||Te.abort(),I.current=ie;const fe=[{role:"user",blocks:[{kind:"text",text:F}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Me=>[...Me,...fe]),b(!0);try{const Me=await u1.sendMessage({sessionId:K.id,text:F},{signal:ie.signal,onBlocks:tt=>{I.current===ie&&w(_e=>{const $e=_e.slice(),dt=$e[$e.length-1];return(dt==null?void 0:dt.role)==="assistant"&&($e[$e.length-1]={...dt,blocks:tt}),$e})}});if(I.current!==ie)return;w(tt=>{const _e=tt.slice(),$e=_e[_e.length-1];return($e==null?void 0:$e.role)==="assistant"&&(_e[_e.length-1]={...$e,blocks:Me.blocks,meta:{ts:Date.now()/1e3}}),_e})}catch(Me){if((Me==null?void 0:Me.name)==="AbortError"||I.current!==ie)return;w(tt=>tt.slice(0,-2)),j(F),Re(`内置智能体发送失败:${Me instanceof Error?Me.message:String(Me)}`)}finally{I.current===ie&&(I.current=null,b(!1))}}function ko(){_o(),Re(""),Wt(!1),Kn(AI()),P("agent"),z(null),ka(),pe(!1);const F=a&&W.length===0&&ye.length>0?a:"";pt.current="",l(""),le(null),X([]),d(!1),h([]),xe(Qi()),_a(ye),ge([]),F&&Na(F)}function XB(F){ce.current!==null&&window.clearTimeout(ce.current),St(F),ce.current=window.setTimeout(()=>{St(""),ce.current=null},3e3)}function QB(){if(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),!n&&!p){yr(!0),XB("请先选择 agent");return}yr(!1),ko()}async function ZB(F){var K;try{(K=Bt.current.get(F))==null||K.abort(),await IE(n,J,F),await CE(n,J,F);const ie=zt.current.get(F);ie!==void 0&&window.clearTimeout(ie),zt.current.delete(F),bt(fe=>{if(!fe.has(F))return fe;const Te=new Set(fe);return Te.delete(F),Te}),U(fe=>{const{[F]:Te,...Me}=fe;return Me}),F===a&&ko(),await Fh(n)}catch(ie){Re(String(ie))}}async function ju(F){if(p&&_o(),F!==a&&(pt.current=F,Re(""),d(!1),h([]),P("agent"),z(null),ka(),xe(Qi()),le(null),X([]),l(F),D[F]===void 0)){Ks(!0);try{const K=await rg(n,J,F);$(F,uK(K.events??[],K.state))}catch(K){Re(String(K))}finally{Ks(!1)}}}async function JB(F){if(!F.sessionId||!F.messageId){Re("这条案例缺少会话定位信息,无法跳转。");return}Ir(!1),_t(null),We(!1),Et(!1),it(!1),on(!1),ny(n),SB(F.kind),Lh(F.messageId),await ju(F.sessionId)}function e8(){const F=lk||n;Ir(!1),_t(null),We(!1),Et(!1),it(!1),Vr(""),Rr(F),Lu("evaluations"),CB(NB),on(!0),ny(""),Lh("")}function t8(F){const K=new Map,ie=new Map;for(const fe of F){if(!fe.sessionId||!fe.messageId)continue;const Te=K.get(fe.sessionId)??new Set;if(Te.add(fe.messageId),K.set(fe.sessionId,Te),fe.runtimeId&&fe.userId){const Me=[fe.runtimeId,n,fe.userId,fe.sessionId].join(":"),tt=ie.get(Me)??{runtimeId:fe.runtimeId,appName:n,userId:fe.userId,sessionId:fe.sessionId,eventIds:new Set};tt.eventIds.add(fe.messageId),ie.set(Me,tt)}}if(K.size!==0){U(fe=>{const Te={...fe};for(const[Me,tt]of K){const _e=Te[Me];_e&&(Te[Me]=_e.map($e=>{var dt;return(dt=$e.meta)!=null&&dt.eventId&&tt.has($e.meta.eventId)?{...$e,meta:{...$e.meta,feedback:void 0}}:$e}))}return Te}),i(fe=>fe.map(Te=>{const Me=K.get(Te.id);if(!Me||!Te.state)return Te;const tt={...Te.state};for(const _e of Me)delete tt[`veadk_feedback:${_e}`];return{...Te,state:tt}})),at(fe=>{const Te=new Set(fe);for(const Me of K.values())for(const tt of Me)Te.delete(tt);return Te});for(const fe of ie.values())BM({runtimeId:fe.runtimeId,appName:fe.appName,userId:fe.userId,sessionId:fe.sessionId,eventIds:[...fe.eventIds]})}}async function xk(F=!0){if(a)return a;c.current||(c.current=ng(n,J));const K=c.current;try{const ie=await K;F&&l(ie);const fe=Date.now()/1e3,Te={id:ie,lastUpdateTime:fe,events:[]};return i(Me=>[Te,...Me.filter(tt=>tt.id!==ie)]),ie}finally{c.current===K&&(c.current=null)}}async function wk(F){if(!n||!J||!a||!ze)return!1;me(!0),Re("");try{const K=await OE(n,J,a,F,ze.revision);return le(K),!0}catch(K){return Re(String(K)),!1}finally{me(!1)}}async function vk(F){if(!(!n||!J||!a||!ze)){me(!0),Re("");try{const K=await ej(n,J,a,F,ze.revision);le(K)}catch(K){Re(String(K))}finally{me(!1)}}}async function n8(F){Re("");let K;try{K=await xk()}catch(fe){Re(String(fe));return}const ie=Array.from(F).map(fe=>({file:fe,attachment:{id:j1e(),mimeType:D1e(fe),name:fe.name,sizeBytes:fe.size,status:"uploading"}}));ge(fe=>[...fe,...ie.map(Te=>Te.attachment)]),await Promise.all(ie.map(async({file:fe,attachment:Te})=>{try{const Me=await qM(n,J,K,fe);if(Le.current.delete(Te.id)){Me.uri&&await im(n,Me.uri);return}ge(tt=>tt.map(_e=>_e.id===Te.id?Me:_e))}catch(Me){if(Le.current.delete(Te.id))return;const tt=Me instanceof Error?Me.message:String(Me);ge(_e=>_e.map($e=>$e.id===Te.id?{...$e,status:"error",error:tt}:$e)),Re(tt)}}))}async function _k(F,K=[],ie=Qi()){if(!F.trim()&&K.length===0||vi||Iu||!n||!J)return;Re("");const fe=[];(ie.skills.length>0||ie.targetAgent)&&fe.push({kind:"invocation",value:ie}),K.length&&fe.push({kind:"attachment",files:K.map(je=>({id:je.id,mimeType:je.mimeType,data:je.data,uri:je.uri,name:je.name,sizeBytes:je.sizeBytes}))}),F.trim()&&fe.push({kind:"text",text:F});const Te=[{role:"user",blocks:fe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Me=!a;Me&&(h(Te),d(!0));const tt=A;let _e;try{_e=await xk(!Me)}catch(je){Me&&(h([]),d(!1),j(F),xe(ie)),Re(String(je));return}let $e=ze!==null;if(tt)try{let je=await RE(n,J,_e);const ht=lge[tt].filter(Xt=>{var rr;return(rr=G.builtinTools)==null?void 0:rr.includes(Xt)});for(const Xt of[...J6[tt],...ht])je.tools.some(rr=>rr.name===Xt)||(je=await OE(n,J,_e,{kind:"tool",name:Xt},je.revision));le(je),$e=!0}catch(je){Me&&(h([]),d(!1),j(F),xe(ie)),Re(`任务能力挂载失败:${String(je)}`);return}$(_e,je=>Me?Te:[...je,...Te]),Me&&(pt.current=_e,l(_e),h([]),d(!1));const dt=new AbortController;Bt.current.set(_e,dt),Nt(_e,!0),Ut(_e),pt.current=_e,ns(je=>({...je,[_e]:""})),Es(je=>({...je,[_e]:new Set})),Cr(je=>({...je,[_e]:[]}));try{let je=ci(),ht="",Xt=0,rr=Date.now()/1e3,Ta="",Aa="";for await(const Rn of Tf({appName:n,userId:J,sessionId:_e,text:F,attachments:K,invocation:ie,signal:dt.signal,sessionCapabilities:$e})){if(dt.signal.aborted)break;const Gi=Rn.error??Rn.errorMessage??Rn.error_message;if(typeof Gi=="string"&&Gi){pt.current===_e&&Re(Gi);break}bo(_e,Rn);const Gn=Rn.author&&Rn.author!=="user"?Rn.author:"";Gn&&Gn!==ht&&(ht=Gn,je=ci()),je=Vc(je,Rn);const Pn=Rn.usageMetadata??Rn.usage_metadata;Pn!=null&&Pn.totalTokenCount&&(Xt=Pn.totalTokenCount),Rn.timestamp&&(rr=Rn.timestamp),Rn.id&&(Ta=Rn.id);const Kr=Rn.invocationId??Rn.invocation_id;Kr&&(Aa=Kr);const ki=je.blocks,rs={author:ht||void 0,tokens:Xt||void 0,ts:rr,eventId:Ta||void 0,invocationId:Aa||void 0};$(_e,py=>{var Uu;const ss=py.slice(),hn=ss[ss.length-1];return(hn==null?void 0:hn.role)==="assistant"&&(!((Uu=hn.meta)!=null&&Uu.author)||hn.meta.author===ht)?ss[ss.length-1]={...hn,blocks:ki,meta:rs}:ss.push({role:"assistant",blocks:ki,meta:rs}),ss})}Fh(n)}catch(je){(je==null?void 0:je.name)!=="AbortError"&&!dt.signal.aborted&&pt.current===_e&&Re(String(je))}finally{Bt.current.get(_e)===dt&&Bt.current.delete(_e),Nt(_e,!1),Be(_e),ns(je=>({...je,[_e]:""})),Cr(je=>({...je,[_e]:[]}))}}function r8(F,K){var Te,Me;const ie=((Te=F==null?void 0:F.event)==null?void 0:Te.name)??K.id,fe=((Me=F==null?void 0:F.event)==null?void 0:Me.context)??{};_k(`[ui-action] ${ie}: ${JSON.stringify(fe)}`)}async function s8(F){var $e,dt,je;if(!F.authUri)throw new Error("事件中没有授权地址。");if(!n||!J||!a)throw new Error("会话尚未就绪。");const K=a,ie=await R1e(F.authUri),fe=O1e(F.authConfig,ie),Te=ht=>ht.map(Xt=>Xt.kind==="auth"&&!Xt.done?{...Xt,done:!0}:Xt);$(K,ht=>{const Xt=ht.slice(),rr=Xt[Xt.length-1];return(rr==null?void 0:rr.role)==="assistant"&&(Xt[Xt.length-1]={...rr,blocks:Te(rr.blocks)}),Xt});const Me=M[M.length-1],tt=Te(Me&&Me.role==="assistant"?Me.blocks:[]),_e=new AbortController;Bt.current.set(K,_e),Nt(K,!0),Ut(K);try{let ht=ci(),Xt=(($e=Me==null?void 0:Me.meta)==null?void 0:$e.author)??"",rr=tt,Ta=0,Aa=Date.now()/1e3,Rn=((dt=Me==null?void 0:Me.meta)==null?void 0:dt.eventId)??"",Gi=((je=Me==null?void 0:Me.meta)==null?void 0:je.invocationId)??"";for await(const Gn of Tf({appName:n,userId:J,sessionId:a,text:"",functionResponses:[{id:F.callId,name:"adk_request_credential",response:fe}],signal:_e.signal,sessionCapabilities:ze!==null})){if(_e.signal.aborted)break;bo(K,Gn);const Pn=Gn.author&&Gn.author!=="user"?Gn.author:"";Pn&&Pn!==Xt&&(Xt=Pn,rr=[],ht=ci()),ht=Vc(ht,Gn);const Kr=Gn.usageMetadata??Gn.usage_metadata;Kr!=null&&Kr.totalTokenCount&&(Ta=Kr.totalTokenCount),Gn.timestamp&&(Aa=Gn.timestamp),Gn.id&&(Rn=Gn.id);const ki=Gn.invocationId??Gn.invocation_id;ki&&(Gi=ki);const rs=[...rr,...ht.blocks];$(K,py=>{var Ck,Ik,Rk,Ok,Lk;const ss=py.slice(),hn=ss[ss.length-1],Uu={author:Xt||((Ck=hn==null?void 0:hn.meta)==null?void 0:Ck.author),tokens:Ta||((Ik=hn==null?void 0:hn.meta)==null?void 0:Ik.tokens),ts:Aa,eventId:Rn||((Rk=hn==null?void 0:hn.meta)==null?void 0:Rk.eventId),invocationId:Gi||((Ok=hn==null?void 0:hn.meta)==null?void 0:Ok.invocationId)};return(hn==null?void 0:hn.role)==="assistant"&&(!((Lk=hn.meta)!=null&&Lk.author)||hn.meta.author===Xt)?ss[ss.length-1]={...hn,blocks:rs,meta:Uu}:ss.push({role:"assistant",blocks:rs,meta:Uu}),ss})}Fh(n)}catch(ht){(ht==null?void 0:ht.name)!=="AbortError"&&!_e.signal.aborted&&pt.current===K&&Re(String(ht))}finally{Bt.current.get(K)===_e&&Bt.current.delete(K),Nt(K,!1),Be(K),ns(ht=>({...ht,[K]:""})),Cr(ht=>({...ht,[K]:[]}))}}if(Vt)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Vt}),o.jsx("button",{type:"button",onClick:fy,children:"重试"})]});if(vt===null)return o.jsx("div",{className:"boot"});if(vt==="unauthenticated")return o.jsx(a1e,{branding:Yt,onUsername:VB});if(!Xe)return o.jsx("div",{className:"boot"});const Zs=Xe.capabilities.createAgents,kk=Xe.capabilities.manageAgents,Ns=Zs?Gs:null,Du=Zs&&Gt,Pu=Zs&&tn,Bu=Ou,Nk=_j(e,xo),Fu=Nk.filter(F=>F.runtimeId&&(dk===null||dk.has(F.runtimeId))).map(F=>{var K;return{...F,canDelete:F.runtimeId?((K=OB[F.runtimeId])==null?void 0:K.canDelete)===!0:!1}}),i8=(()=>{if(Fu.length===0)return Fu;const F=new Map(ok.map((K,ie)=>[K,ie]));return[...Fu].sort((K,ie)=>{const fe=F.get(K.id),Te=F.get(ie.id);return fe!=null&&Te!=null?fe-Te:fe!=null?-1:Te!=null?1:Fu.indexOf(K)-Fu.indexOf(ie)})})(),Uh=F=>{var K;return((K=Nk.find(ie=>ie.id===F))==null?void 0:K.label)??F},Or=xo.find(F=>F.runtimeId&&F.apps.some(K=>ro(F.id,K)===n)),Il=Or&&Or.runtimeId&&Or.region?{runtimeId:Or.runtimeId,name:Or.name,region:Or.region}:void 0,a8=(Il==null?void 0:Il.runtimeId)??xo.reduce((F,K)=>K.runtimeId??F,""),Sk=async(F,K)=>{var tt,_e;const ie=(tt=F.meta)==null?void 0:tt.eventId,fe=a;if(!ie||!fe||!Il)return;const Te=(_e=F.meta)==null?void 0:_e.feedback,Me={...Te,rating:K,syncStatus:"syncing",updatedAt:Date.now()/1e3};$(fe,$e=>$e.map(dt=>{var je;return((je=dt.meta)==null?void 0:je.eventId)===ie?{...dt,meta:{...dt.meta,feedback:Me}}:dt})),at($e=>new Set($e).add(ie));try{const $e=await zM({appName:n,userId:J,sessionId:fe,eventId:ie,rating:K});$(fe,dt=>dt.map(je=>{var ht;return((ht=je.meta)==null?void 0:ht.eventId)===ie?{...je,meta:{...je.meta,feedback:$e}}:je})),i(dt=>dt.map(je=>je.id===fe?{...je,state:{...je.state??{},[`veadk_feedback:${ie}`]:$e}}:je))}catch($e){$(fe,dt=>dt.map(je=>{var ht;return((ht=je.meta)==null?void 0:ht.eventId)===ie?{...je,meta:{...je.meta,feedback:Te}}:je})),pt.current===fe&&Re($e instanceof Error?$e.message:String($e))}finally{at($e=>{const dt=new Set($e);return dt.delete(ie),dt})}},$h=async F=>{Al(As());let K=re.current.get(F);K||(K=await $p(F),re.current.set(F,K)),B(K),F===n&&Ce(ie=>ie+1),pt.current="",l(""),yr(!1),r(F)},o8=F=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}yr(!1),on(!1),sy(F),$t(null),_t(null),Et(!0),Re("")},Tk=async F=>{if(F.runtime)try{const K=await ig(F.runtime.runtimeId,F.name,F.runtime.region,F.runtime.currentVersion);Al(As()),Ce(fe=>fe+1);const ie=await $p(K);re.current.set(K,ie),B(ie),ks(null),yr(!1),on(!1),ko(),r(K)}catch(K){Re(K instanceof Error?K.message:String(K))}},l8=F=>{F.runtime&&(ks(F),Vr(""),Rr(""),yr(!1),on(!0),Re(""))},Ak=()=>{p&&_o(),pt.current="",l(""),_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),Vr(""),Rr(""),yr(!0),Re("")},c8=F=>{if(ny(""),Lh(""),Ht){Tk(Ht);return}Vr(""),Rr(""),on(!1),$h(F)},u8=F=>(Vr(""),Rr(F),Lu("basic"),$h(F)),hy=Ht!=null&&Ht.runtime?xo.find(F=>{var K;return F.runtimeId===((K=Ht.runtime)==null?void 0:K.runtimeId)}):void 0,Wi=Ht!=null&&Ht.runtime?{id:`detail:${Ht.runtime.runtimeId}`,label:Ht.name,app:Ht.name,remote:!0,runtimeApp:hy==null?void 0:hy.apps[0],runtimeId:Ht.runtime.runtimeId,region:Ht.runtime.region,currentVersion:Ht.runtime.currentVersion,canDelete:Ht.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(IK,{branding:Yt,access:Xe,features:Yn,sessions:s,currentSessionId:a,streamingSids:Ye,onNewChat:QB,onSearch:()=>{p&&_o(),_t(null),it(!1),We(!1),Et(!1),on(!1),ks(null),yr(!1),Ir(!0),Re("")},onQuickCreate:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}p&&_o(),pt.current="",l(""),it(!1),We(!1),Ir(!1),on(!1),ks(null),yr(!1),_t(null),$t(null),sy("cn-beijing"),Et(!0),Re("")},onSkillCenter:()=>{p&&_o(),_t(null),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),it(!0),Re("")},onAddAgent:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}p&&_o(),pt.current="",_t(null),it(!1),Ir(!1),on(!1),ks(null),yr(!1),l(""),Et(!1),We(!0),Re("")},onMyAgents:Ak,onPickSession:F=>{_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),Re(""),ju(F)},onDeleteSession:ZB,userInfo:Ue,version:kn,onLogout:KB}),(()=>{const F=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(n1e,{onExit:ko}),o.jsx(hge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Uh(n):"Agent",value:C,onChange:j,onSubmit:()=>{if(!p&&L==="skill-create"){const Te=C.trim();if(!Te||te)return;const Me={id:`pending-${Date.now()}`,prompt:Te,status:"provisioning",candidates:U_.map((_e,$e)=>({id:`pending-${$e}`,model:_e,modelLabel:_e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};pe(!0);const tt=++ne.current;Re(""),de(Me),j(""),Rbe(Te,_e=>{ne.current===tt&&de(_e)}).then(_e=>{ne.current===tt&&de(_e)}).catch(_e=>{ne.current===tt&&(de(null),j(Te),Re(_e instanceof Error?_e.message:String(_e)))}).finally(()=>{ne.current===tt&&pe(!1)});return}const K=C;if(j(""),p){qB(K);return}const ie=ye,fe=be;ge([]),xe(Qi()),_k(K,ie,fe),f1(ie)},disabled:p?!1:!J||L==="temporary"||L==="agent"&&!n,busy:p?y:L==="skill-create"?te:vi,showMeta:M.length>0&&!p,attachments:p?[]:ye,skills:p?[]:Nl,agents:p?[]:Sl,invocation:p?Qi():be,capabilitiesLoading:!p&>,allowAttachments:!p,onInvocationChange:xe,onAddFiles:n8,onRemoveAttachment:Tl,newChatMode:p?"agent":L,newChatTask:p?null:A,newChatLayout:!p&&M.length===0&&se===null,showModeSelector:!1,temporaryEnabled:Q&&G.temporaryEnabled,skillCreateEnabled:Q&&G.skillCreateEnabled,harnessEnabled:Q&&G.harnessEnabled,builtinTools:Q?G.builtinTools:[],onModeChange:K=>{if(!(K==="temporary"&&!G.temporaryEnabled||K==="skill-create"&&!G.skillCreateEnabled)){if(K==="temporary"){z(null),P(K),Ek();return}if(P(K),K!=="agent"&&z(null),Re(""),K==="skill-create"){xe(Qi());const ie=a&&W.length===0&&ye.length>0?a:"";_a(ye),ge([]),ie&&(pt.current="",l(""),Na(ie))}}},onTaskChange:z})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(KK,{appName:n,onAppChange:Bu?u8:$h,agentLabel:Uh,agentsSource:en,localApps:e,currentRuntime:Il,runtimeScope:Xe.capabilities.runtimeScope,onBrowseAgents:Ak,title:p?"Codex 智能体":Qs?"智能体":Du?"添加 Agent":Pu?"添加 AgentKit 智能体":Bu?Ht?Ht.name:iy?Uh(iy):"智能体详情":void 0,titleLeading:M.length>0&&!p&&L==="agent"&&!Du&&!Pu&&!nt&&!Rh&&!Bu&&!Qs&&Ns===null&&n?o.jsx("button",{ref:Jt,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":fn,onClick:()=>Wt(!0),children:o.jsx(Kc,{})}):void 0,crumbs:nt?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Rh||Pu||Du||!Ns?void 0:Ns==="menu"?[{label:E1e,onClick:()=>{_t(null),$t(null),Et(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Dh(!0)},{label:x1e[Ns]}],rightContent:o.jsxs(o.Fragment,{children:[Xe.role==="admin"&&o.jsx(_be,{}),o.jsx(M1e,{tasks:Zs?Eo:[],onCancel:q})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[Je&&o.jsx("div",{className:"error",children:Je}),Ar&&o.jsxs("div",{className:"session-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载会话…"]}),lk&&!Bu&&!Du&&!Pu&&!Rh&&!nt&&Ns===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:e8,children:[o.jsx(hv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),Qs?o.jsx(_me,{onCreateAgent:o8,onCreateCodexAgent:Ek,onUseAgent:Tk,onViewAgentDetails:l8,connectedRuntimeId:a8,hiddenRuntimeIds:LB}):Bu?o.jsx(ume,{agents:Wi?[Wi]:i8,drafts:vs,agentOrder:ok,selectedAgentId:n,agentInfo:ke,agentInfoAgentId:n,loadingAgentInfo:gt,canCreate:Zs,canUpdate:Zs||kk,loadingAgents:IB,agentsError:RB,deploymentTasks:Eo,focusedDeploymentTaskId:pk,focusedAgentId:(Wi==null?void 0:Wi.id)??iy,focusedAgentSection:TB,focusedCaseKind:AB,detailOnly:!!Wi||!!pk,onRetryAgents:()=>void ly(),onAgentOrderChange:PB,onDeleteAgents:BB,onDeleteDrafts:DB,onSelectAgent:$h,onTalkAgent:c8,onOpenFeedbackCase:K=>void JB(K),onFeedbackCasesDeleted:t8,onCreateAgent:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}on(!1),Et(!0),_t(null),$t(null),_i(null),sy("cn-beijing"),Xs(""),_s.current=null,Vr(""),Rr(""),Re("")},onUpdateAgent:K=>{if(!kk&&!Zs){Re("当前账号没有管理 Agent 的权限。");return}if(!(Or!=null&&Or.runtimeId)){Re("仅支持更新已部署的云端智能体。");return}if(!Or.region){Re("Runtime 缺少地域信息,无法更新。");return}on(!1),$t(K);const ie=`runtime-${Or.runtimeId}`;Xs(ie),_s.current=vs.find(fe=>fe.id===ie)??null,Vr(""),Rr(""),_i({runtimeId:Or.runtimeId,name:Or.name,region:Or.region,currentVersion:Or.currentVersion}),_t("custom"),Re("")},onEditDraft:K=>{on(!1),$t(K.draft),Xs(K.id),_s.current=K,_i(K.deploymentTarget??null),Vr(""),Rr(""),_t("custom"),Re("")}},(Wi==null?void 0:Wi.id)??"workspace"):Du?o.jsx(e5,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:N1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{Et(!1),$t(null),_t("menu")}},{key:"package",icon:zz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{Et(!1),$t(null),_t("package")}}]}):Rh?o.jsx(_K,{userId:J,appId:n,agentInfo:ke,capabilitiesLoading:gt,agentLabel:Uh,onOpenSession:YB}):Pu?o.jsx(Kse,{onAdded:K=>{Al(As()),We(!1),r(K)},onCancel:()=>We(!1)}):nt?o.jsx(Vse,{}):Ns!==null&&!oe?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Ns==="menu"?o.jsx(C0e,{onSelect:K=>{$t(null),_i(null),Vr(""),Rr(""),Xs(K==="custom"?`draft-${Date.now().toString(36)}`:""),_s.current=null,_t(K)},onImport:K=>{$t(K),_i(null),Vr(""),Rr(""),Xs(`draft-${Date.now().toString(36)}`),_s.current=null,_t("custom")}}):Ns==="intelligent"?o.jsx(rye,{userId:J,onBack:()=>_t("menu"),onCreate:Bh,onAgentAdded:cy,onDeploymentTaskChange:O}):Ns==="custom"?o.jsx(Qye,{initialDraft:Dn??void 0,onBack:()=>_t("menu"),onCreate:Bh,onAgentAdded:cy,features:Yn,onDeploymentTaskChange:O,deploymentTarget:Cl??void 0,initialDeployRegion:jh,onDraftChange:(K,ie)=>{zr&&(ie?jB(zr,K,Cl??void 0):mk(zr))},onDiscard:zr?()=>{mk(zr),Xs(""),_s.current=null,$t(null),_i(null),Vr(""),Rr(n),_t(null),Et(!1),on(!0),Re("")}:void 0,onDeploymentStarted:gk,onDeploymentComplete:yk},zr||"custom"):Ns==="template"?o.jsx(ebe,{onBack:()=>_t("menu"),onCreate:Bh}):Ns==="workflow"?o.jsx(lbe,{onBack:()=>_t("menu"),onCreate:Bh}):Ns==="package"?o.jsx(hbe,{onBack:()=>{_t(null),Et(!0)},onAgentAdded:cy,onDeploymentTaskChange:O,onDeploymentStarted:gk,onDeploymentComplete:yk,initialDeployRegion:jh}):M.length===0&&se?o.jsx(Ybe,{initialJob:se}):M.length===0&&!Q?o.jsxs("div",{className:"session-loading",children:[o.jsx(Ft,{className:"icon spin"})," 正在检查 Agent 能力…"]}):M.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(ma,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":L==="skill-create"?"想创建一个什么 Skill?":Vn}),F]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Ru?" is-streaming":""}`,ref:Mu,onScroll:FB,onWheel:UB,onTouchMove:$B,children:M.map((K,ie)=>{var Ta,Aa,Rn,Gi,Gn;const fe=ie===M.length-1;if(K.role==="user"){const Pn=K.blocks.map(rs=>rs.kind==="text"?rs.text:"").join(""),Kr=K.blocks.flatMap(rs=>rs.kind==="attachment"?rs.files:[]),ki=K.blocks.find(rs=>rs.kind==="invocation");return o.jsxs(Zt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(ki==null?void 0:ki.kind)==="invocation"&&o.jsx(D_,{value:ki.value}),Kr.length>0&&o.jsx(B_,{appName:n,items:Kr}),Pn&&o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:Pn})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ta=K.meta)==null?void 0:Ta.ts)&&o.jsx("span",{className:"meta-text",children:kB(K.meta.ts)}),o.jsx(SI,{text:Pn})]})]},ie)}const Te=((Aa=K.meta)==null?void 0:Aa.author)??"",Me=Te&&nr?Ux(nr,Te):void 0,tt=!!(Te&&va.length>0&&!va.includes(Te)),_e=(Me==null?void 0:Me.name)||Te,$e=(Me==null?void 0:Me.description)||(tt?"正在执行主 Agent 移交的任务。":"");if(K.blocks.length>0&&K.blocks.every(Pn=>Pn.kind==="agent-transfer"))return null;const dt=K.blocks.length===0,je=((Gi=(Rn=K.meta)==null?void 0:Rn.feedback)==null?void 0:Gi.rating)??null,ht=((Gn=K.meta)==null?void 0:Gn.eventId)??"",Xt=Ve.has(ht),rr=!!(Il&&ht&&NI(K));return o.jsxs(Zt.div,{ref:Pn=>{ht&&(Pn?uy.current.set(ht,Pn):uy.current.delete(ht))},className:["turn turn--assistant",tt?"turn--subagent":"",Oh===ht?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[tt&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(Fz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:_e})]}),o.jsx("p",{className:"subagent-run-description",title:$e,children:$e})]}),dt?fe&&Ws?o.jsx(Q6,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(F_,{appName:n,blocks:K.blocks,streaming:fe&&(Ws||xa),onStreamFrame:fe?HB:void 0,onAction:r8,onAuth:s8,onArtifactDownload:(Pn,Kr)=>YM(n,J,a,Pn,Kr),onArtifactPreview:(Pn,Kr)=>GM(n,J,a,Pn,Kr)}),!(fe&&Ws)&&!C1e(K)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(fe&&Ws)&&!I1e(K)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[rr&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${je==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":je==="good","aria-busy":Xt,title:je==="good"?"取消点赞":"赞",disabled:Xt,onClick:()=>void Sk(K,je==="good"?null:"good"),children:o.jsx(r1e,{className:"icon",filled:je==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${je==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":je==="bad","aria-busy":Xt,title:je==="bad"?"取消点踩":"踩",disabled:Xt,onClick:()=>void Sk(K,je==="bad"?null:"bad"),children:o.jsx(s1e,{className:"icon",filled:je==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>sn(!0),children:o.jsx(S1e,{})}),o.jsx(SI,{text:NI(K)})]}),K.meta&&o.jsx("span",{className:"meta-text",children:T1e(K.meta)})]})]})]},ie)})}),!p&&o.jsx(jj,{appName:n,info:ke,loading:gt,activeAgent:xs,seenAgents:ws,execPath:wa,capabilities:ze,capabilityLoading:Ee,capabilityMutating:ee,builtinTools:ft,onAddCapability:wk,onRemoveCapability:K=>void vk(K)}),o.jsx("div",{className:"conversation-composer-slot",children:F})]})]})]})})(),rn&&a&&o.jsx(aB,{appName:n,sessionId:a,onClose:()=>sn(!1)}),fn&&M.length>0&&o.jsx(cY,{appName:n,info:ke,loading:gt,activeAgent:xs,seenAgents:ws,execPath:wa,capabilities:ze,capabilityLoading:Ee,capabilityMutating:ee,builtinTools:ft,onAddCapability:wk,onRemoveCapability:F=>void vk(F),onClose:Mn,returnFocusRef:Jt}),o.jsx(t1e,{open:x,state:k,error:T,onCancel:WB,onConfirm:()=>void GB()}),It&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:It}),o.jsx(o1e,{open:ue,checking:ve,error:ot,onLogin:()=>void zB()}),MB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Dh(!1),children:o.jsxs("div",{className:"confirm-box",onClick:F=>F.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Dh(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{$t(null),_t("menu"),Dh(!1)},children:"确定返回"})]})]})})]})}const CI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(CI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(CI,String(t))}catch{}window.location.reload()}});(()=>{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})()||h1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(q9,{reducedMotion:"user",children:o.jsx(Az,{maskOpacity:.9,children:o.jsx(P1e,{})})})}));export{E as A,w0 as B,fs as C,H1e as D,Hd as E,ll as F,k3 as G,F1e as R,Sr as V,kt as a,qc as b,y2 as c,z1e as d,Hv as e,gq as f,Rf as g,jt as h,LQ as i,UQ as j,bq as k,Wf as l,UZ as m,wQ as n,vQ as o,GZ as p,pZ as q,mZ as r,j3 as s,o as t,st as u,nn as v,At as w,$1e as x,RQ as y,ps as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index 59b24b8d..d48e2225 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +
From 2988cf5f13494d6a965d8745de14e6bc16a5bd75 Mon Sep 17 00:00:00 2001 From: zhengchuyi Date: Thu, 30 Jul 2026 15:14:54 +0800 Subject: [PATCH 2/3] fix(frontend): require explicit agent selection --- frontend/src/App.tsx | 97 ++- frontend/src/create/CustomCreate.tsx | 59 +- frontend/src/styles.css | 5 + frontend/src/ui/AgentWorkspace.tsx | 133 +--- frontend/src/ui/StudioConfirmDialog.tsx | 162 ++++ frontend/tests/agentWorkspace.test.mjs | 45 +- frontend/tests/markdownPromptEditor.test.mjs | 19 + frontend/tests/myAgents.test.mjs | 7 +- frontend/tests/sessionHeader.test.mjs | 6 +- ...tor-CTF8aHas.js => CodeEditor-DdBhy0vU.js} | 2 +- ...f6.js => MarkdownPromptEditor-CV6FT_vP.js} | 2 +- veadk/webui/assets/index-DsGJ5Unm.js | 736 ++++++++++++++++++ veadk/webui/assets/index-Mps5FwwT.js | 736 ------------------ ...{index-ClNM_Oc4.css => index-Tf-_sqTv.css} | 2 +- veadk/webui/index.html | 4 +- 15 files changed, 1112 insertions(+), 903 deletions(-) create mode 100644 frontend/src/ui/StudioConfirmDialog.tsx rename veadk/webui/assets/{CodeEditor-CTF8aHas.js => CodeEditor-DdBhy0vU.js} (99%) rename veadk/webui/assets/{MarkdownPromptEditor-CD1RMBf6.js => MarkdownPromptEditor-CV6FT_vP.js} (99%) create mode 100644 veadk/webui/assets/index-DsGJ5Unm.js delete mode 100644 veadk/webui/assets/index-Mps5FwwT.js rename veadk/webui/assets/{index-ClNM_Oc4.css => index-Tf-_sqTv.css} (99%) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 54fbdcee..15bfabe4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -655,6 +655,37 @@ function browserMimeType(file: File) { return "application/octet-stream"; } +function remoteSelectionIds(connections: RemoteConnection[]) { + return connections.flatMap((connection) => + connection.apps.map((app) => remoteAppId(connection.id, app)), + ); +} + +function runtimeIdForSelection( + connections: RemoteConnection[], + selectedAppName: string, +) { + return connections.find( + (connection) => + connection.runtimeId && + connection.apps.some( + (app) => remoteAppId(connection.id, app) === selectedAppName, + ), + )?.runtimeId ?? ""; +} + +function hasAgentSelection( + selectedAppName: string, + localApps: string[], + connections: RemoteConnection[], +) { + if (!selectedAppName) return false; + return ( + localApps.includes(selectedAppName) || + remoteSelectionIds(connections).includes(selectedAppName) + ); +} + export default function App() { const [apps, setApps] = useState([]); const [appName, setAppName] = useState(""); @@ -1045,6 +1076,7 @@ export default function App() { // Restore the previously-open session only once, after apps/user resolve. const restoredRef = useRef(false); const defaultViewAppliedRef = useRef(false); + const agentSelectionClearedRef = useRef(false); const saveWorkspaceDraft = useCallback( ( @@ -1152,6 +1184,7 @@ export default function App() { ); if (targets.length === 0) return; + const selectedRuntimeId = runtimeIdForSelection(connections, appName); const pendingRuntimeIds = new Set(targets.map((agent) => agent.runtimeId)); setHiddenRuntimeIds((current) => { const next = new Set(current); @@ -1210,10 +1243,22 @@ export default function App() { } return next; }); - if (targets.some((agent) => agent.id === appName)) { - viewSidRef.current = ""; - setSessionId(""); - setAppName(""); + const deletedCurrentSelection = selectedRuntimeId + ? deletedRuntimeIds.has(selectedRuntimeId) + : targets.some((agent) => agent.id === appName); + if (deletedCurrentSelection) { + clearSelectedAgentAfterRemoval(); + setCreateView(null); + setSkillCenter(false); + setAddAgent(false); + setAddMenu(false); + setSearchView(false); + setManageAgents(false); + setAgentDetailTarget(null); + setFocusedDeploymentTaskId(""); + setFocusedWorkspaceAgentId(""); + setMyAgents(true); + setError(""); } if ( agentDetailTarget?.runtime && @@ -1246,7 +1291,7 @@ export default function App() { const suffix = failures.length > 3 ? `;另有 ${failures.length - 3} 个失败` : ""; throw new Error(`${failures.length} 个 Agent 删除失败:${shown}${suffix}`); } - }, [agentDetailTarget, appName, userId]); + }, [agentDetailTarget, appName, connections, userId]); const refreshAgentLibrary = useCallback(async () => { setAgentLibraryLoading(true); @@ -1679,13 +1724,17 @@ export default function App() { if (authStatus !== "authenticated") return; if (agentsSource === "cloud") { const saved = localStorage.getItem(LS.app); - const remoteIds = connections.flatMap((c) => - c.apps.map((a) => remoteAppId(c.id, a)), - ); + const remoteIds = remoteSelectionIds(connections); setAppName((current) => { if (current && remoteIds.includes(current)) return current; + if (current) { + agentSelectionClearedRef.current = true; + localStorage.removeItem(LS.app); + return ""; + } + if (agentSelectionClearedRef.current) return ""; if (saved && remoteIds.includes(saved)) return saved; - return remoteIds[0] ?? ""; + return ""; }); return; } @@ -1699,7 +1748,7 @@ export default function App() { // (prefer a servable, conversational agent — numbered examples like // 01_quickstart are standalone scripts with no root_agent and can't load). const saved = localStorage.getItem(LS.app); - const remoteIds = connections.flatMap((c) => c.apps.map((a) => remoteAppId(c.id, a))); + const remoteIds = remoteSelectionIds(connections); const valid = saved && (list.includes(saved) || remoteIds.includes(saved)); const fallback = ["web_search_agent", "web_demo"].find((a) => list.includes(a)) ?? @@ -1712,7 +1761,12 @@ export default function App() { // Persist the current view/agent/session so a refresh restores them. useEffect(() => { - if (appName) localStorage.setItem(LS.app, appName); + if (appName) { + agentSelectionClearedRef.current = false; + localStorage.setItem(LS.app, appName); + } else { + localStorage.removeItem(LS.app); + } }, [appName]); useEffect(() => { let cancelled = false; @@ -2046,6 +2100,17 @@ export default function App() { if (abandonedSession) void abandonDraftSession(abandonedSession); } + function clearSelectedAgentAfterRemoval() { + agentSelectionClearedRef.current = true; + localStorage.removeItem(LS.app); + if (sessionId) streamAbortsRef.current.get(sessionId)?.abort(); + creatingSessionRef.current = null; + startNewChat(); + setAppName(""); + setNewChatCapabilities({}); + setAgentInfo(null); + } + function showToast(message: string) { if (toastTimerRef.current !== null) window.clearTimeout(toastTimerRef.current); setToast(message); @@ -2063,7 +2128,8 @@ export default function App() { setSearchView(false); setManageAgents(false); setAgentDetailTarget(null); - if (!appName && !sandboxSession) { + if (!sandboxSession && !hasAgentSelection(appName, apps, connections)) { + if (appName) clearSelectedAgentAfterRemoval(); setMyAgents(true); showToast("请先选择 agent"); return; @@ -2719,12 +2785,7 @@ export default function App() { region: currentConn.region, } : undefined; - const connectedRuntimeId = - currentRuntime?.runtimeId ?? - connections.reduce( - (runtimeId, connection) => connection.runtimeId ?? runtimeId, - "", - ); + const connectedRuntimeId = currentRuntime?.runtimeId ?? ""; const rateAssistantTurn = async ( turn: Turn, diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index ab975c24..0465670e 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -89,6 +89,7 @@ import { } from "../ui/ProjectPreview"; import { Blocks, ThinkingPlaceholder } from "../ui/Blocks"; import { DeploymentErrorMessage } from "../ui/DeploymentErrorMessage"; +import { StudioConfirmDialog } from "../ui/StudioConfirmDialog"; import { TraceDrawer } from "../ui/TraceDrawer"; import { isImeCompositionEvent } from "../ui/composerKeyboard"; import { @@ -2400,6 +2401,10 @@ export function CustomCreate({ const [debugInput, setDebugInput] = useState(""); const [debugTraceTarget, setDebugTraceTarget] = useState(null); + const [debugLeaveConfirmOpen, setDebugLeaveConfirmOpen] = useState(false); + const [debugLeaveCleaning, setDebugLeaveCleaning] = useState(false); + const debugLeaveConfirmResolverRef = + useRef<((confirmed: boolean) => void) | null>(null); // The section nearest the top of the scroll container (scroll-spy) — drives // the right-hand step nav highlight. const [activeId, setActiveId] = useState("basic"); @@ -2448,6 +2453,13 @@ export function CustomCreate({ }; }, []); + useEffect(() => { + return () => { + debugLeaveConfirmResolverRef.current?.(false); + debugLeaveConfirmResolverRef.current = null; + }; + }, []); + // Section wrapper: registers a ref for scroll-spy + renders the heading. // IMPORTANT: keep a STABLE identity (stored in a ref). If this were declared // as a fresh function each render, React would remount every section on every @@ -2856,14 +2868,37 @@ export function CustomCreate({ }); }; + const resolveDebugLeaveConfirm = (confirmed: boolean) => { + const resolve = debugLeaveConfirmResolverRef.current; + debugLeaveConfirmResolverRef.current = null; + resolve?.(confirmed); + }; + + const cancelDebugLeaveConfirm = () => { + if (debugLeaveCleaning) return; + setDebugLeaveConfirmOpen(false); + resolveDebugLeaveConfirm(false); + }; + + const acceptDebugLeaveConfirm = async () => { + if (debugLeaveCleaning) return; + setDebugLeaveCleaning(true); + try { + await cleanupDebugRuns(); + setDebugLeaveConfirmOpen(false); + resolveDebugLeaveConfirm(true); + } finally { + setDebugLeaveCleaning(false); + } + }; + const confirmLeaveDebug = async () => { if (workspaceMode !== "validate" || activeDebugRunCount === 0) return true; - const confirmed = window.confirm( - "离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。", - ); - if (!confirmed) return false; - await cleanupDebugRuns(); - return true; + if (debugLeaveConfirmResolverRef.current) return false; + return new Promise((resolve) => { + debugLeaveConfirmResolverRef.current = resolve; + setDebugLeaveConfirmOpen(true); + }); }; const openPublishPreview = async (variantId?: string) => { @@ -4183,6 +4218,18 @@ export function CustomCreate({ onClose={() => setDebugTraceTarget(null)} /> )} + {debugLeaveConfirmOpen && ( + void acceptDebugLeaveConfirm()} + /> + )} {discardConfirmOpen && (
setDiscardConfirmOpen(false)}>
) { - return ( - - ); -} - -function DialogCloseIcon(props: SVGProps) { - return ( - - ); -} - interface EvaluationGroup { id: string; name: string; @@ -657,7 +620,6 @@ export function AgentWorkspace({ const [focusedCaseId, setFocusedCaseId] = useState(""); const [expandedCaseIds, setExpandedCaseIds] = useState>(() => new Set()); const suppressAgentClickRef = useRef(false); - const deleteCancelButtonRef = useRef(null); const appliedFocusKeyRef = useRef(""); const caseTableRef = useRef(null); const [evaluationGroups, setEvaluationGroups] = useState(DEFAULT_EVALUATION_GROUPS); @@ -1064,23 +1026,6 @@ export function AgentWorkspace({ }); }, [filteredDrafts]); - useEffect(() => { - if (!deleteConfirmTarget) return; - const previousOverflow = document.body.style.overflow; - document.body.style.overflow = "hidden"; - deleteCancelButtonRef.current?.focus(); - const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === "Escape" && !deletingAgents) { - setDeleteConfirmTarget(null); - } - }; - window.addEventListener("keydown", handleKeyDown); - return () => { - document.body.style.overflow = previousOverflow; - window.removeEventListener("keydown", handleKeyDown); - }; - }, [deleteConfirmTarget, deletingAgents]); - const cases = selectedAgent?.runtimeId ? feedbackCases : DEFAULT_CASES; const visibleCases = cases.filter((item) => { if (item.kind !== caseFilter) return false; @@ -2130,71 +2075,19 @@ export function AgentWorkspace({ )}
- {deleteConfirmTarget && createPortal( -
{ - if (event.target === event.currentTarget && !deletingAgents) { - setDeleteConfirmTarget(null); - } - }} - > -
-
-
- -

{deleteConfirmTarget.title}

-
- -
-
-

- {deleteConfirmTarget.description} -

-
-
- - -
-
-
, - document.body, + {deleteConfirmTarget && ( + setDeleteConfirmTarget(null)} + onConfirm={() => void confirmDeleteTarget()} + /> )} - + ); } diff --git a/frontend/src/ui/StudioConfirmDialog.tsx b/frontend/src/ui/StudioConfirmDialog.tsx new file mode 100644 index 00000000..43750883 --- /dev/null +++ b/frontend/src/ui/StudioConfirmDialog.tsx @@ -0,0 +1,162 @@ +import { + useEffect, + useId, + useRef, + type SVGProps, + type ReactNode, +} from "react"; +import { createPortal } from "react-dom"; + +type StudioConfirmVariant = "warning" | "danger"; + +interface StudioConfirmDialogProps { + title: string; + description: ReactNode; + confirmLabel: string; + cancelLabel?: string; + closeLabel?: string; + variant?: StudioConfirmVariant; + busy?: boolean; + onCancel: () => void; + onConfirm: () => void; +} + +function ConfirmWarningIcon(props: SVGProps) { + return ( + + ); +} + +function ConfirmCloseIcon(props: SVGProps) { + return ( + + ); +} + +export function StudioConfirmDialog({ + title, + description, + confirmLabel, + cancelLabel = "取消", + closeLabel = "关闭确认框", + variant = "warning", + busy = false, + onCancel, + onConfirm, +}: StudioConfirmDialogProps) { + const titleId = useId(); + const descriptionId = useId(); + const cancelButtonRef = useRef(null); + const busyRef = useRef(busy); + const onCancelRef = useRef(onCancel); + + useEffect(() => { + busyRef.current = busy; + onCancelRef.current = onCancel; + }, [busy, onCancel]); + + useEffect(() => { + const previousOverflow = document.body.style.overflow; + const previousFocus = + document.activeElement instanceof HTMLElement + ? document.activeElement + : null; + document.body.style.overflow = "hidden"; + cancelButtonRef.current?.focus(); + + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === "Escape" && !busyRef.current) { + onCancelRef.current(); + } + }; + window.addEventListener("keydown", handleKeyDown); + + return () => { + document.body.style.overflow = previousOverflow; + window.removeEventListener("keydown", handleKeyDown); + if (previousFocus?.isConnected) previousFocus.focus(); + }; + }, []); + + return createPortal( +
{ + if (event.target === event.currentTarget && !busy) onCancel(); + }} + > +
+
+
+ +

{title}

+
+ +
+
+

{description}

+
+
+ + +
+
+
, + document.body, + ); +} diff --git a/frontend/tests/agentWorkspace.test.mjs b/frontend/tests/agentWorkspace.test.mjs index 1c8f0ddb..26dccae7 100644 --- a/frontend/tests/agentWorkspace.test.mjs +++ b/frontend/tests/agentWorkspace.test.mjs @@ -19,6 +19,10 @@ const customCreateSource = readFileSync( new URL("../src/create/CustomCreate.tsx", import.meta.url), "utf8", ); +const studioConfirmSource = readFileSync( + new URL("../src/ui/StudioConfirmDialog.tsx", import.meta.url), + "utf8", +); const projectPreviewSource = readFileSync( new URL("../src/ui/ProjectPreview.tsx", import.meta.url), "utf8", @@ -314,6 +318,12 @@ test("workspace keeps agent deletion in selection mode and the floating detail a assert.match(appSource, /const deleteWorkspaceAgents = useCallback/); assert.match(appSource, /await deleteRuntime\(agent\.runtimeId, agent\.region\)/); assert.doesNotMatch(appSource, /agent\.region \?\? "cn-beijing"/); + assert.match(appSource, /const selectedRuntimeId = runtimeIdForSelection\(connections, appName\)/); + assert.match(appSource, /deletedCurrentSelection[\s\S]*?deletedRuntimeIds\.has\(selectedRuntimeId\)/); + assert.doesNotMatch( + appSource, + /if \(targets\.some\(\(agent\) => agent\.id === appName\)\) \{[\s\S]*?setAppName\(""\)[\s\S]*?\}/, + ); assert.match( appSource, /deletedRuntimeIds\.has\(agentDetailTarget\.runtime\.runtimeId\)[\s\S]*?setManageAgents\(false\)[\s\S]*?setAgentDetailTarget\(null\)[\s\S]*?setMyAgents\(true\)/, @@ -341,31 +351,36 @@ test("workspace keeps agent deletion in selection mode and the floating detail a /window\.confirm/, ); assert.match(workspaceSource, /const \[deleteConfirmTarget, setDeleteConfirmTarget\]/); - assert.match(workspaceSource, /createPortal\(/); - assert.match(workspaceSource, /function DeleteWarningIcon\(props: SVGProps\)/); - assert.match(workspaceSource, /function DialogCloseIcon\(props: SVGProps\)/); + assert.match(workspaceSource, /import \{ StudioConfirmDialog \} from "\.\/StudioConfirmDialog"/); + assert.match(workspaceSource, /\)/); + assert.match(studioConfirmSource, /function ConfirmCloseIcon\(props: SVGProps\)/); assert.doesNotMatch( workspaceSource.slice(0, workspaceSource.indexOf("} from \"lucide-react\"")), /\bAlertTriangle\b|^\s*X,\s*$/m, ); - assert.match(workspaceSource, /role="alertdialog"/); - assert.match(workspaceSource, /aria-modal="true"/); - assert.match(workspaceSource, /aria-labelledby="aw-delete-confirm-title"/); - assert.match(workspaceSource, /aria-describedby="aw-delete-confirm-description"/); - assert.match(workspaceSource, /className="studio-confirm-backdrop"/); - assert.match(workspaceSource, /className="studio-confirm-dialog studio-confirm-dialog--danger"/); - assert.match(workspaceSource, /className="studio-confirm-head"/); - assert.match(workspaceSource, /className="studio-confirm-body"/); - assert.match(workspaceSource, /className="studio-confirm-actions"/); - assert.match(workspaceSource, /className="studio-confirm-primary"/); + assert.match(studioConfirmSource, /role="alertdialog"/); + assert.match(studioConfirmSource, /aria-modal="true"/); + assert.match(studioConfirmSource, /aria-labelledby=\{titleId\}/); + assert.match(studioConfirmSource, /aria-describedby=\{descriptionId\}/); + assert.match(studioConfirmSource, /className="studio-confirm-backdrop"/); + assert.match(studioConfirmSource, /studio-confirm-dialog--\$\{variant\}/); + assert.match(studioConfirmSource, /className="studio-confirm-head"/); + assert.match(studioConfirmSource, /className="studio-confirm-body"/); + assert.match(studioConfirmSource, /className="studio-confirm-actions"/); + assert.match(studioConfirmSource, /className="studio-confirm-primary"/); + assert.match(appStyles, /\.studio-confirm-dialog--warning \.studio-confirm-title-icon/); + assert.match(appStyles, /\.studio-confirm-dialog--danger \.studio-confirm-title-icon/); assert.doesNotMatch( - workspaceSource.slice(workspaceSource.indexOf("deleteConfirmTarget && createPortal")), + studioConfirmSource, /pp-confirm|code-browser/, ); assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "selection"/); assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "agent"/); assert.match(workspaceSource, /setDeleteConfirmTarget\(\{[\s\S]*?kind: "draft"/); - assert.match(workspaceSource, /onClick=\{\(\) => void confirmDeleteTarget\(\)\}/); + assert.match(workspaceSource, /onConfirm=\{\(\) => void confirmDeleteTarget\(\)\}/); assert.match(workspaceSource, /await onDeleteAgents\(agentsToDelete\)/); assert.match(workspaceSource, /onDeleteDrafts\?\.\(draftsToDelete\)/); assert.match(workspaceSource, /aria-pressed=\{selectionMode \? isSelectedForDelete : undefined\}/); diff --git a/frontend/tests/markdownPromptEditor.test.mjs b/frontend/tests/markdownPromptEditor.test.mjs index 419fa781..2be1d4f9 100644 --- a/frontend/tests/markdownPromptEditor.test.mjs +++ b/frontend/tests/markdownPromptEditor.test.mjs @@ -196,6 +196,25 @@ test("debug comparison keeps equal spacing above cards and composer", () => { ); }); +test("leaving debug mode uses the shared Studio confirm dialog", () => { + const confirmStart = createSource.indexOf("const confirmLeaveDebug = async () =>"); + const publishStart = createSource.indexOf("const openPublishPreview = async", confirmStart); + assert.ok(confirmStart >= 0 && publishStart > confirmStart); + assert.match(createSource, /import \{ StudioConfirmDialog \} from "\.\.\/ui\/StudioConfirmDialog"/); + assert.match(createSource, /const \[debugLeaveConfirmOpen, setDebugLeaveConfirmOpen\] = useState\(false\)/); + assert.match(createSource, /debugLeaveConfirmResolverRef/); + assert.doesNotMatch( + createSource.slice(confirmStart, publishStart), + /window\.confirm/, + ); + assert.match( + createSource, + /debugLeaveConfirmOpen && \([\s\S]*? void acceptDebugLeaveConfirm\(\)\}/); +}); + test("agent type is a form section with radio choices", () => { assert.match(createSource, /
/); assert.match(createSource, /role="radiogroup" aria-label="Agent 类型"/); diff --git a/frontend/tests/myAgents.test.mjs b/frontend/tests/myAgents.test.mjs index 39ac1f1f..59524ead 100644 --- a/frontend/tests/myAgents.test.mjs +++ b/frontend/tests/myAgents.test.mjs @@ -141,6 +141,10 @@ test("hides deleted Runtime cards and invalidates stale Runtime pages", () => { assert.match(appSource, /const \[hiddenRuntimeIds, setHiddenRuntimeIds\] = useState>/); assert.match(appSource, /invalidateRuntimeAgentCache\(pendingRuntimeIds\)/); assert.match(appSource, /invalidateRuntimeAgentCache\(deletedRuntimeIds\)/); + assert.match(appSource, /const selectedRuntimeId = runtimeIdForSelection\(connections, appName\)/); + assert.match(appSource, /deletedCurrentSelection[\s\S]*?deletedRuntimeIds\.has\(selectedRuntimeId\)/); + assert.match(appSource, /clearSelectedAgentAfterRemoval\(\)/); + assert.match(appSource, /agentSelectionClearedRef\.current = true/); assert.match(appSource, /hiddenRuntimeIds=\{hiddenRuntimeIds\}/); }); @@ -274,7 +278,8 @@ test("uses connected Runtime state only for the card action", () => { assert.match(pageSource, /agent\.runtime\?\.runtimeId === connectedRuntimeId/); assert.match(pageSource, /const connectedIndex = availableAgents\.findIndex/); assert.match(pageSource, /availableAgents\[connectedIndex\][\s\S]*?availableAgents\.slice\(0, connectedIndex\)/); - assert.match(appSource, /const connectedRuntimeId =[\s\S]*?currentRuntime\?\.runtimeId \?\?[\s\S]*?connections\.reduce/); + assert.match(appSource, /const connectedRuntimeId = currentRuntime\?\.runtimeId \?\? ""/); + assert.doesNotMatch(appSource, /const connectedRuntimeId =[\s\S]*?connections\.reduce/); assert.match(appSource, /connectedRuntimeId=\{connectedRuntimeId\}/); }); diff --git a/frontend/tests/sessionHeader.test.mjs b/frontend/tests/sessionHeader.test.mjs index b5d686e3..d86f2323 100644 --- a/frontend/tests/sessionHeader.test.mjs +++ b/frontend/tests/sessionHeader.test.mjs @@ -19,8 +19,9 @@ test("uses the selected Agent in new-chat, search, and conversation headers", () assert.match(appSource, /void refreshAgentLibrary\(\)/); assert.match( appSource, - /if \(agentsSource === "cloud"\) \{[\s\S]*?remoteIds[\s\S]*?remoteIds\.includes\(saved\)[\s\S]*?remoteIds\[0\] \?\? ""/, + /if \(agentsSource === "cloud"\) \{[\s\S]*?remoteSelectionIds\(connections\)[\s\S]*?if \(saved && remoteIds\.includes\(saved\)\) return saved;[\s\S]*?return "";/, ); + assert.doesNotMatch(appSource, /remoteIds\[0\] \?\? ""/); assert.doesNotMatch(appSource, /if \(agentsSource === "cloud"\) \{\s*setAppName\(""\)/); assert.match(navbarSource, /appName \? label\(appName\) : "选择 Agent"/); assert.match(navbarSource, /agentsSource === "cloud"[\s\S]*?aria-label="切换智能体"/); @@ -38,8 +39,9 @@ test("shows the Codex identity instead of the Agent picker in sandbox sessions", test("redirects new chat to Agent selection when no Agent is active", () => { assert.match( appSource, - /function openNewChat\(\)[\s\S]*?if \(!appName && !sandboxSession\)[\s\S]*?setMyAgents\(true\)[\s\S]*?showToast\("请先选择 agent"\)[\s\S]*?return;/, + /function openNewChat\(\)[\s\S]*?!hasAgentSelection\(appName, apps, connections\)[\s\S]*?setMyAgents\(true\)[\s\S]*?showToast\("请先选择 agent"\)[\s\S]*?return;/, ); + assert.match(appSource, /if \(appName\) clearSelectedAgentAfterRemoval\(\)/); assert.match(appSource, /onNewChat=\{openNewChat\}/); assert.match(appSource, /className="app-toast" role="status" aria-live="polite"/); assert.match(stylesSource, /\.app-toast\s*\{[\s\S]*?position:\s*fixed;/); diff --git a/veadk/webui/assets/CodeEditor-CTF8aHas.js b/veadk/webui/assets/CodeEditor-DdBhy0vU.js similarity index 99% rename from veadk/webui/assets/CodeEditor-CTF8aHas.js rename to veadk/webui/assets/CodeEditor-DdBhy0vU.js index 37b01a62..6f85afc0 100644 --- a/veadk/webui/assets/CodeEditor-CTF8aHas.js +++ b/veadk/webui/assets/CodeEditor-DdBhy0vU.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-Mps5FwwT.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-DsGJ5Unm.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-CD1RMBf6.js b/veadk/webui/assets/MarkdownPromptEditor-CV6FT_vP.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-CD1RMBf6.js rename to veadk/webui/assets/MarkdownPromptEditor-CV6FT_vP.js index 528b4e1a..4cdafb0e 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-CD1RMBf6.js +++ b/veadk/webui/assets/MarkdownPromptEditor-CV6FT_vP.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-Mps5FwwT.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-DsGJ5Unm.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ni.map(i=>d[i]); +var m8=Object.defineProperty;var g8=(e,t,n)=>t in e?m8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pk=(e,t,n)=>g8(e,typeof t!="symbol"?t+"":t,n);function y8(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 _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var LI={exports:{}},Ug={},MI={exports:{}},At={};/** + * @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 Qf=Symbol.for("react.element"),b8=Symbol.for("react.portal"),E8=Symbol.for("react.fragment"),x8=Symbol.for("react.strict_mode"),w8=Symbol.for("react.profiler"),v8=Symbol.for("react.provider"),_8=Symbol.for("react.context"),k8=Symbol.for("react.forward_ref"),N8=Symbol.for("react.suspense"),S8=Symbol.for("react.memo"),T8=Symbol.for("react.lazy"),Bk=Symbol.iterator;function A8(e){return e===null||typeof e!="object"?null:(e=Bk&&e[Bk]||e["@@iterator"],typeof e=="function"?e:null)}var jI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},DI=Object.assign,PI={};function gu(e,t,n){this.props=e,this.context=t,this.refs=PI,this.updater=n||jI}gu.prototype.isReactComponent={};gu.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")};gu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function BI(){}BI.prototype=gu.prototype;function Vx(e,t,n){this.props=e,this.context=t,this.refs=PI,this.updater=n||jI}var Kx=Vx.prototype=new BI;Kx.constructor=Vx;DI(Kx,gu.prototype);Kx.isPureReactComponent=!0;var Fk=Array.isArray,FI=Object.prototype.hasOwnProperty,Yx={current:null},UI={key:!0,ref:!0,__self:!0,__source:!0};function $I(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)FI.call(t,r)&&!UI.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,W=O[H];if(0>>1;Hs(X,A))nes(ce,X)?(O[H]=ce,O[ne]=A,H=ne):(O[H]=X,O[te]=A,H=te);else if(nes(ce,A))O[H]=ce,O[ne]=A,H=ne;else break e}}return D}function s(O,D){var A=O.sortIndex-D.sortIndex;return A!==0?A:O.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=O)r(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function _(O){if(g=!1,x(O),!m)if(n(c)!==null)m=!0,C(k);else{var D=n(u);D!==null&&M(_,D.startTime-O)}}function k(O,D){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var A=h;try{for(x(D),f=n(c);f!==null&&(!(f.expirationTime>D)||O&&!j());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var W=H(f.expirationTime<=D);D=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(c)&&r(c),x(D)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var te=n(u);te!==null&&M(_,te.startTime-D),P=!1}return P}finally{f=null,h=A,p=!1}}var N=!1,T=null,S=-1,R=5,I=-1;function j(){return!(e.unstable_now()-IO||125H?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(g?(y(S),S=-1):g=!0,M(_,A-H))):(O.sortIndex=W,t(c,O),m||p||(m=!0,C(k))),O},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(O){var D=h;return function(){var A=h;h=D;try{return O.apply(this,arguments)}finally{h=A}}}})(YI);KI.exports=YI;var F8=KI.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 U8=E,ws=F8;function Me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g1=Object.prototype.hasOwnProperty,$8=/^[: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]*$/,$k={},Hk={};function H8(e){return g1.call(Hk,e)?!0:g1.call($k,e)?!1:$8.test(e)?Hk[e]=!0:($k[e]=!0,!1)}function z8(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 V8(e,t,n,r){if(t===null||typeof t>"u"||z8(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 Qr(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 Sr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Sr[e]=new Qr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Sr[t]=new Qr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Sr[e]=new Qr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Sr[e]=new Qr(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){Sr[e]=new Qr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Sr[e]=new Qr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Sr[e]=new Qr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Sr[e]=new Qr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Sr[e]=new Qr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gx=/[\-:]([a-z])/g;function qx(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(Gx,qx);Sr[t]=new Qr(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(Gx,qx);Sr[t]=new Qr(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(Gx,qx);Sr[t]=new Qr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Sr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!1,!1)});Sr.xlinkHref=new Qr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Sr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xx(e,t,n,r){var s=Sr.hasOwnProperty(t)?Sr[t]:null;(s!==null?s.type!==0:r||!(2l||s[a]!==i[l]){var c=` +`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Ey=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pd(e):""}function K8(e){switch(e.tag){case 5:return pd(e.type);case 16:return pd("Lazy");case 13:return pd("Suspense");case 19:return pd("SuspenseList");case 0:case 2:case 15:return e=xy(e.type,!1),e;case 11:return e=xy(e.type.render,!1),e;case 1:return e=xy(e.type,!0),e;default:return""}}function x1(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 Ql:return"Fragment";case Xl:return"Portal";case y1:return"Profiler";case Qx:return"StrictMode";case b1:return"Suspense";case E1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qI:return(e.displayName||"Context")+".Consumer";case GI:return(e._context.displayName||"Context")+".Provider";case Zx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jx:return t=e.displayName||null,t!==null?t:x1(e.type)||"Memo";case Ua:t=e._payload,e=e._init;try{return x1(e(t))}catch{}}return null}function Y8(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 x1(t);case 8:return t===Qx?"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 lo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function W8(e){var t=QI(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 Yh(e){e._valueTracker||(e._valueTracker=W8(e))}function ZI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=QI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function km(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 w1(e,t){var n=t.checked;return Un({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=lo(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 JI(e,t){t=t.checked,t!=null&&Xx(e,"checked",t,!1)}function v1(e,t){JI(e,t);var n=lo(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")?_1(e,t.type,n):t.hasOwnProperty("defaultValue")&&_1(e,t.type,lo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kk(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 _1(e,t,n){(t!=="number"||km(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var md=Array.isArray;function vc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Wh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function of(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cd={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},G8=["Webkit","ms","Moz","O"];Object.keys(Cd).forEach(function(e){G8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cd[t]=Cd[e]})});function rR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cd.hasOwnProperty(e)&&Cd[e]?(""+t).trim():t+"px"}function sR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=rR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var q8=Un({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 S1(e,t){if(t){if(q8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Me(62))}}function T1(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 A1=null;function ew(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var C1=null,_c=null,kc=null;function Gk(e){if(e=eh(e)){if(typeof C1!="function")throw Error(Me(280));var t=e.stateNode;t&&(t=Kg(t),C1(e.stateNode,e.type,t))}}function iR(e){_c?kc?kc.push(e):kc=[e]:_c=e}function aR(){if(_c){var e=_c,t=kc;if(kc=_c=null,Gk(e),t)for(e=0;e>>=0,e===0?32:31-(aF(e)/oF|0)|0}var Gh=64,qh=4194304;function gd(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 Am(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 l=a&~s;l!==0?r=gd(l):(i&=a,i!==0&&(r=gd(i)))}else a=n&~s,a!==0?r=gd(a):i!==0&&(r=gd(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 Zf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gi(t),e[t]=n}function dF(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=Rd),rN=" ",sN=!1;function SR(e,t){switch(e){case"keyup":return FF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zl=!1;function $F(e,t){switch(e){case"compositionend":return TR(t);case"keypress":return t.which!==32?null:(sN=!0,rN);case"textInput":return e=t.data,e===rN&&sN?null:e;default:return null}}function HF(e,t){if(Zl)return e==="compositionend"||!lw&&SR(e,t)?(e=kR(),Wp=iw=Wa=null,Zl=!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=lN(n)}}function RR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function OR(){for(var e=window,t=km();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=km(e.document)}return t}function cw(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 QF(e){var t=OR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&RR(n.ownerDocument.documentElement,n)){if(r!==null&&cw(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=cN(n,i);var a=cN(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,Jl=null,j1=null,Ld=null,D1=!1;function uN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;D1||Jl==null||Jl!==km(r)||(r=Jl,"selectionStart"in r&&cw(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}),Ld&&hf(Ld,r)||(Ld=r,r=Rm(j1,"onSelect"),0nc||(e.current=H1[nc],H1[nc]=null,nc--)}function yn(e,t){nc++,H1[nc]=e.current,e.current=t}var co={},Pr=po(co),is=po(!1),sl=co;function Uc(e,t){var n=e.type.contextTypes;if(!n)return co;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 as(e){return e=e.childContextTypes,e!=null}function Lm(){vn(is),vn(Pr)}function yN(e,t,n){if(Pr.current!==co)throw Error(Me(168));yn(Pr,t),yn(is,n)}function $R(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Me(108,Y8(e)||"Unknown",s));return Un({},n,r)}function Mm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||co,sl=Pr.current,yn(Pr,e),yn(is,is.current),!0}function bN(e,t,n){var r=e.stateNode;if(!r)throw Error(Me(169));n?(e=$R(e,t,sl),r.__reactInternalMemoizedMergedChildContext=e,vn(is),vn(Pr),yn(Pr,e)):vn(is),yn(is,n)}var sa=null,Yg=!1,My=!1;function HR(e){sa===null?sa=[e]:sa.push(e)}function c9(e){Yg=!0,HR(e)}function mo(){if(!My&&sa!==null){My=!0;var e=0,t=Zt;try{var n=sa;for(Zt=1;e>=a,s-=a,aa=1<<32-gi(t)+s|n<S?(R=T,T=null):R=T.sibling;var I=h(y,T,x[S],_);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(y,T),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,T=R}if(S===x.length)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;SS?(R=T,T=null):R=T.sibling;var j=h(y,T,I.value,_);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(y,T),b=i(j,b,S),N===null?k=j:N.sibling=j,N=j,T=R}if(I.done)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return Cn&&Lo(y,S),k}for(T=r(y,T);!I.done;S++,I=x.next())I=p(T,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&T.forEach(function(F){return t(y,F)}),Cn&&Lo(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Ql&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Kh:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Ql){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ua&&wN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=qu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Ql?(b=Qo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=tm(x.type,x.key,x.props,null,y.mode,_),_.ref=qu(y,b,x),_.return=y,y=_)}return a(y);case Xl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Hy(x,y.mode,_),b.return=y,y=b}return a(y);case Ua:return N=x._init,w(y,b,N(x._payload),_)}if(md(x))return m(y,b,x,_);if(Vu(x))return g(y,b,x,_);np(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=$y(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var Hc=YR(!0),WR=YR(!1),Pm=po(null),Bm=null,ic=null,hw=null;function pw(){hw=ic=Bm=null}function mw(e){var t=Pm.current;vn(Pm),e._currentValue=t}function K1(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 Sc(e,t){Bm=e,hw=ic=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rs=!0),e.firstContext=null)}function Vs(e){var t=e._currentValue;if(hw!==e)if(e={context:e,memoizedValue:t,next:null},ic===null){if(Bm===null)throw Error(Me(308));ic=e,Bm.dependencies={lanes:0,firstContext:e}}else ic=ic.next=e;return t}var zo=null;function gw(e){zo===null?zo=[e]:zo.push(e)}function GR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gw(t)):(n.next=s.next,s.next=n),t.interleaved=n,ga(e,r)}function ga(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 $a=!1;function yw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qR(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 ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function no(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ga(e,n)}return s=r.interleaved,s===null?(t.next=t,gw(r)):(t.next=s.next,s.next=t),r.interleaved=t,ga(e,n)}function qp(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,nw(e,n)}}function vN(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 Fm(e,t,n,r){var s=e.updateQueue;$a=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Un({},f,h);break e;case 2:$a=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);ol|=a,e.lanes=a,e.memoizedState=f}}function _N(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Dy.transition;Dy.transition={};try{e(!1),t()}finally{Zt=n,Dy.transition=r}}function fO(){return Ks().memoizedState}function h9(e,t,n){var r=so(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hO(e))pO(t,n);else if(n=GR(e,t,n,r),n!==null){var s=Gr();yi(n,e,r,s),mO(n,t,r)}}function p9(e,t,n){var r=so(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hO(e))pO(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,wi(l,a)){var c=t.interleaved;c===null?(s.next=s,gw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=GR(e,t,s,r),n!==null&&(s=Gr(),yi(n,e,r,s),mO(n,t,r))}}function hO(e){var t=e.alternate;return e===Fn||t!==null&&t===Fn}function pO(e,t){Md=$m=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nw(e,n)}}var Hm={readContext:Vs,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},m9={readContext:Vs,useCallback:function(e,t){return Oi().memoizedState=[e,t===void 0?null:t],e},useContext:Vs,useEffect:NN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qp(4194308,4,oO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qp(4,2,e,t)},useMemo:function(e,t){var n=Oi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oi();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=h9.bind(null,Fn,e),[r.memoizedState,e]},useRef:function(e){var t=Oi();return e={current:e},t.memoizedState=e},useState:kN,useDebugValue:Nw,useDeferredValue:function(e){return Oi().memoizedState=e},useTransition:function(){var e=kN(!1),t=e[0];return e=f9.bind(null,e[1]),Oi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fn,s=Oi();if(Cn){if(n===void 0)throw Error(Me(407));n=n()}else{if(n=t(),xr===null)throw Error(Me(349));al&30||JR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,NN(tO.bind(null,r,i,e),[e]),r.flags|=2048,wf(9,eO.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Oi(),t=xr.identifierPrefix;if(Cn){var n=oa,r=aa;n=(r&~(1<<32-gi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ef++,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[Di]=t,e[gf]=r,NO(e,t,!1,!1),t.stateNode=e;e:{switch(a=T1(n,r),n){case"dialog":wn("cancel",e),wn("close",e),s=r;break;case"iframe":case"object":case"embed":wn("load",e),s=r;break;case"video":case"audio":for(s=0;sKc&&(t.flags|=128,r=!0,Xu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Um(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Cn)return Rr(t),null}else 2*Xn()-i.renderingStartTime>Kc&&n!==1073741824&&(t.flags|=128,r=!0,Xu(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=Xn(),t.sibling=null,n=Pn.current,yn(Pn,r?n&1|2:n&1),t):(Rr(t),null);case 22:case 23:return Rw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ms&1073741824&&(Rr(t),t.subtreeFlags&6&&(t.flags|=8192)):Rr(t),null;case 24:return null;case 25:return null}throw Error(Me(156,t.tag))}function _9(e,t){switch(dw(t),t.tag){case 1:return as(t.type)&&Lm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zc(),vn(is),vn(Pr),xw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ew(t),null;case 13:if(vn(Pn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Me(340));$c()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vn(Pn),null;case 4:return zc(),null;case 10:return mw(t.type._context),null;case 22:case 23:return Rw(),null;case 24:return null;default:return null}}var sp=!1,Lr=!1,k9=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function ac(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vn(e,t,r)}else n.current=null}function eE(e,t,n){try{n()}catch(r){Vn(e,t,r)}}var DN=!1;function N9(e,t){if(P1=Cm,e=OR(),cw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(B1={focusedElem:e,selectionRange:n},Cm=!1,Xe=t;Xe!==null;)if(t=Xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xe=e;else for(;Xe!==null;){t=Xe;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:oi(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(_){Vn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Xe=e;break}Xe=t.return}return m=DN,DN=!1,m}function jd(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&&eE(t,n,i)}s=s.next}while(s!==r)}}function qg(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 tE(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 AO(e){var t=e.alternate;t!==null&&(e.alternate=null,AO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[gf],delete t[$1],delete t[o9],delete t[l9])),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 CO(e){return e.tag===5||e.tag===3||e.tag===4}function PN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CO(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 nE(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=Om));else if(r!==4&&(e=e.child,e!==null))for(nE(e,t,n),e=e.sibling;e!==null;)nE(e,t,n),e=e.sibling}function rE(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(rE(e,t,n),e=e.sibling;e!==null;)rE(e,t,n),e=e.sibling}var vr=null,li=!1;function Oa(e,t,n){for(n=n.child;n!==null;)IO(e,t,n),n=n.sibling}function IO(e,t,n){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount($g,n)}catch{}switch(n.tag){case 5:Lr||ac(n,t);case 6:var r=vr,s=li;vr=null,Oa(e,t,n),vr=r,li=s,vr!==null&&(li?(e=vr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):vr.removeChild(n.stateNode));break;case 18:vr!==null&&(li?(e=vr,n=n.stateNode,e.nodeType===8?Ly(e.parentNode,n):e.nodeType===1&&Ly(e,n),df(e)):Ly(vr,n.stateNode));break;case 4:r=vr,s=li,vr=n.stateNode.containerInfo,li=!0,Oa(e,t,n),vr=r,li=s;break;case 0:case 11:case 14:case 15:if(!Lr&&(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)&&eE(n,t,a),s=s.next}while(s!==r)}Oa(e,t,n);break;case 1:if(!Lr&&(ac(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Vn(n,t,l)}Oa(e,t,n);break;case 21:Oa(e,t,n);break;case 22:n.mode&1?(Lr=(r=Lr)||n.memoizedState!==null,Oa(e,t,n),Lr=r):Oa(e,t,n);break;default:Oa(e,t,n)}}function BN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new k9),t.forEach(function(r){var s=M9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ri(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Xn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*T9(r/1960))-r,10e?16:e,Ga===null)var r=!1;else{if(e=Ga,Ga=null,Km=0,Dt&6)throw Error(Me(331));var s=Dt;for(Dt|=4,Xe=e.current;Xe!==null;){var i=Xe,a=i.child;if(Xe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cXn()-Cw?Xo(e,0):Aw|=n),os(e,t)}function BO(e,t){t===0&&(e.mode&1?(t=qh,qh<<=1,!(qh&130023424)&&(qh=4194304)):t=1);var n=Gr();e=ga(e,t),e!==null&&(Zf(e,t,n),os(e,n))}function L9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BO(e,n)}function M9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Me(314))}r!==null&&r.delete(t),BO(e,n)}var FO;FO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||is.current)rs=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rs=!1,w9(e,t,n);rs=!!(e.flags&131072)}else rs=!1,Cn&&t.flags&1048576&&zR(t,Dm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zp(e,t),e=t.pendingProps;var s=Uc(t,Pr.current);Sc(t,n),s=vw(null,t,r,e,s,n);var i=_w();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,as(r)?(i=!0,Mm(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,yw(t),s.updater=Gg,t.stateNode=s,s._reactInternals=t,W1(t,r,e,n),t=X1(null,t,r,!0,i,n)):(t.tag=0,Cn&&i&&uw(t),Vr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=D9(r),e=oi(r,e),s){case 0:t=q1(null,t,r,e,n);break e;case 1:t=LN(null,t,r,e,n);break e;case 11:t=RN(null,t,r,e,n);break e;case 14:t=ON(null,t,r,oi(r.type,e),n);break e}throw Error(Me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),q1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),LN(e,t,r,s,n);case 3:e:{if(vO(t),e===null)throw Error(Me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,qR(e,t),Fm(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=Vc(Error(Me(423)),t),t=MN(e,t,r,n,s);break e}else if(r!==s){s=Vc(Error(Me(424)),t),t=MN(e,t,r,n,s);break e}else for(ys=to(t.stateNode.containerInfo.firstChild),bs=t,Cn=!0,ui=null,n=WR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($c(),r===s){t=ya(e,t,n);break e}Vr(e,t,r,n)}t=t.child}return t;case 5:return XR(t),e===null&&V1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,F1(r,s)?a=null:i!==null&&F1(r,i)&&(t.flags|=32),wO(e,t),Vr(e,t,a,n),t.child;case 6:return e===null&&V1(t),null;case 13:return _O(e,t,n);case 4:return bw(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:oi(r,s),RN(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,yn(Pm,r._currentValue),r._currentValue=a,i!==null)if(wi(i.value,a)){if(i.children===s.children&&!is.current){t=ya(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ua(-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),K1(i.return,n,t),l.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(Me(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),K1(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,Sc(t,n),s=Vs(s),r=r(s),t.flags|=1,Vr(e,t,r,n),t.child;case 14:return r=t.type,s=oi(r,t.pendingProps),s=oi(r.type,s),ON(e,t,r,s,n);case 15:return EO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),Zp(e,t),t.tag=1,as(r)?(e=!0,Mm(t)):e=!1,Sc(t,n),gO(t,r,s),W1(t,r,s,n),X1(null,t,r,!0,e,n);case 19:return kO(e,t,n);case 22:return xO(e,t,n)}throw Error(Me(156,t.tag))};function UO(e,t){return hR(e,t)}function j9(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 Us(e,t,n,r){return new j9(e,t,n,r)}function Lw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function D9(e){if(typeof e=="function")return Lw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zx)return 11;if(e===Jx)return 14}return 2}function io(e,t){var n=e.alternate;return n===null?(n=Us(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 tm(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Lw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ql:return Qo(n.children,s,i,t);case Qx:a=8,s|=8;break;case y1:return e=Us(12,n,t,s|2),e.elementType=y1,e.lanes=i,e;case b1:return e=Us(13,n,t,s),e.elementType=b1,e.lanes=i,e;case E1:return e=Us(19,n,t,s),e.elementType=E1,e.lanes=i,e;case XI:return Qg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case GI:a=10;break e;case qI:a=9;break e;case Zx:a=11;break e;case Jx:a=14;break e;case Ua:a=16,r=null;break e}throw Error(Me(130,e==null?e:typeof e,""))}return t=Us(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Qo(e,t,n,r){return e=Us(7,e,r,t),e.lanes=n,e}function Qg(e,t,n,r){return e=Us(22,e,r,t),e.elementType=XI,e.lanes=n,e.stateNode={isHidden:!1},e}function $y(e,t,n){return e=Us(6,e,null,t),e.lanes=n,e}function Hy(e,t,n){return t=Us(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function P9(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=vy(0),this.expirationTimes=vy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Mw(e,t,n,r,s,i,a,l,c){return e=new P9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Us(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yw(i),e}function B9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VO)}catch(e){console.error(e)}}VO(),VI.exports=Ns;var vs=VI.exports,YN=vs;m1.createRoot=YN.createRoot,m1.hydrateRoot=YN.hydrateRoot;const Bw=E.createContext({});function n0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const r0=E.createContext(null),_f=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class z9 extends E.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 V9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(_f);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)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: ${l}px !important; + top: ${c}px !important; + left: ${u}px !important; + } + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(z9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const K9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=n0(Y9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(V9,{isPresent:n,children:e})),o.jsx(r0.Provider,{value:d,children:e})};function Y9(){return new Map}function KO(e=!0){const t=E.useContext(r0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const op=e=>e.key||"";function WN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Fw=typeof window<"u",YO=Fw?E.useLayoutEffect:E.useEffect,di=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=KO(a),u=E.useMemo(()=>WN(e),[e]),d=a&&!l?[]:u.map(op),f=E.useRef(!0),h=E.useRef(u),p=n0(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);YO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=op(_),N=a&&!l?!1:u===w||d.includes(k),T=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx(K9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:T,children:_},k)})})},Es=e=>e;let WO=Es;const W9={useManualTiming:!1};function G9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const lp=["read","resolveKeyframes","update","preRender","render","postRender"],q9=40;function GO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=lp.reduce((y,b)=>(y[b]=G9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,q9),1),s.timestamp=y,s.isProcessing=!0,l.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:lp.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bGN[e].some(n=>!!t[n])};function X9(e){for(const t in e)Yc[t]={...Yc[t],...e[t]}}const Q9=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")||Q9.has(e)}let XO=e=>!Gm(e);function QO(e){e&&(XO=t=>t.startsWith("on")?!Gm(t):e(t))}try{QO(require("@emotion/is-prop-valid").default)}catch{}function Z9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(XO(s)||n===!0&&Gm(s)||!t&&!Gm(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function J9({children:e,isValidProp:t,...n}){t&&QO(t),n={...E.useContext(_f),...n},n.isStatic=n0(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(_f.Provider,{value:r,children:e})}function eU(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 s0=E.createContext({});function kf(e){return typeof e=="string"||Array.isArray(e)}function i0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Uw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$w=["initial",...Uw];function a0(e){return i0(e.animate)||$w.some(t=>kf(e[t]))}function ZO(e){return!!(a0(e)||e.variants)}function tU(e,t){if(a0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kf(n)?n:void 0,animate:kf(r)?r:void 0}}return e.inherit!==!1?t:{}}function nU(e){const{initial:t,animate:n}=tU(e,E.useContext(s0));return E.useMemo(()=>({initial:t,animate:n}),[qN(t),qN(n)])}function qN(e){return Array.isArray(e)?e.join(" "):e}const rU=Symbol.for("motionComponentSymbol");function lc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sU(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):lc(n)&&(n.current=r))},[t])}const Hw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),iU="framerAppearId",JO="data-"+Hw(iU),{schedule:zw}=GO(queueMicrotask,!1),eL=E.createContext({});function aU(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(s0),c=E.useContext(qO),u=E.useContext(r0),d=E.useContext(_f).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(eL);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&oU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[JO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return YO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),zw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function oU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tL(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&lc(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function tL(e){if(e)return e.options.allowProjection!==!1?e.projection:tL(e.parent)}function lU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&X9(e);function l(u,d){let f;const h={...E.useContext(_f),...u,layoutId:cU(u)},{isStatic:p}=h,m=nU(u),g=r(u,p);if(!p&&Fw){uU();const w=dU(h);f=w.MeasureLayout,m.visualElement=aU(s,g,h,t,w.ProjectionNode)}return o.jsxs(s0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,sU(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[rU]=s,c}function cU({layoutId:e}){const t=E.useContext(Bw).id;return t&&e!==void 0?t+"-"+e:e}function uU(e,t){E.useContext(qO).strict}function dU(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 fU=["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 Vw(e){return typeof e!="string"||e.includes("-")?!1:!!(fU.indexOf(e)>-1||/[A-Z]/u.test(e))}function XN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kw(e,t,n,r){if(typeof t=="function"){const[s,i]=XN(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]=XN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const lE=e=>Array.isArray(e),hU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),pU=e=>lE(e)?e[e.length-1]||0:e,Mr=e=>!!(e&&e.getVelocity);function nm(e){const t=Mr(e)?e.get():e;return hU(t)?t.toValue():t}function mU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:gU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const nL=e=>(t,n)=>{const r=E.useContext(s0),s=E.useContext(r0),i=()=>mU(e,t,r,s);return n?i():n0(i)};function gU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=nm(i[h]);let{initial:a,animate:l}=e;const c=a0(e),u=ZO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!i0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),sL=rL("--"),yU=rL("var(--"),Yw=e=>yU(e)?bU.test(e.split("/*")[0].trim()):!1,bU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,iL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ba=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Nf={...xu,transform:e=>ba(0,1,e)},cp={...xu,default:1},nh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pa=nh("deg"),Ui=nh("%"),lt=nh("px"),EU=nh("vh"),xU=nh("vw"),QN={...Ui,parse:e=>Ui.parse(e)/100,transform:e=>Ui.transform(e*100)},wU={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,backgroundPositionX:lt,backgroundPositionY:lt},vU={rotate:Pa,rotateX:Pa,rotateY:Pa,rotateZ:Pa,scale:cp,scaleX:cp,scaleY:cp,scaleZ:cp,skew:Pa,skewX:Pa,skewY:Pa,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:Nf,originX:QN,originY:QN,originZ:lt},ZN={...xu,transform:Math.round},Ww={...wU,...vU,zIndex:ZN,size:lt,fillOpacity:Nf,strokeOpacity:Nf,numOctaves:ZN},_U={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kU=Eu.length;function NU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),aL=()=>({...Xw(),attrs:{}}),Qw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oL(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 lL=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 cL(e,t,n,r){oL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(lL.has(s)?s:Hw(s),t.attrs[s])}const qm={};function IU(e){Object.assign(qm,e)}function uL(e,{layout:t,layoutId:n}){return wl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qm[e]||e==="opacity")}function Zw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(Mr(s[a])||t.style&&Mr(t.style[a])||uL(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 dL(e,t,n){const r=Zw(e,t,n);for(const s in e)if(Mr(e[s])||Mr(t[s])){const i=Eu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function RU(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 eS=["x","y","width","height","cx","cy","r"],OU={useVisualState:nL({scrapeMotionValuesFromProps:dL,createRenderState:aL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(wl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{RU(n,r),_n.render(()=>{qw(r,s,Qw(n.tagName),e.transformTemplate),cL(n,r)})})}})},LU={useVisualState:nL({scrapeMotionValuesFromProps:Zw,createRenderState:Xw})};function fL(e,t,n){for(const r in t)!Mr(t[r])&&!uL(r,n)&&(e[r]=t[r])}function MU({transformTemplate:e},t){return E.useMemo(()=>{const n=Xw();return Gw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function jU(e,t){const n=e.style||{},r={};return fL(r,n,e),Object.assign(r,MU(e,t)),r}function DU(e,t){const n={},r=jU(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 PU(e,t,n,r){const s=E.useMemo(()=>{const i=aL();return qw(i,t,Qw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};fL(i,e.style,e),s.style={...i,...s.style}}return s}function BU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=(Vw(n)?PU:DU)(r,i,a,n),u=Z9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>Mr(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function FU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Vw(r)?OU:LU,preloadedFeatures:e,useRender:BU(s),createVisualElement:t,Component:r};return lU(a)}}function hL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(rm===void 0&&$i.set(_r.isProcessing||W9.useManualTiming?_r.timestamp:performance.now()),rm),set:e=>{rm=e,queueMicrotask(UU)}};function ev(e,t){e.indexOf(t)===-1&&e.push(t)}function tv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class nv{constructor(){this.subscriptions=[]}add(t){return ev(this.subscriptions,t),()=>tv(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 HU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=$i.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=$i.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$U(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 nv);const r=this.events[t].add(n);return t==="change"?()=>{r(),_n.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=$i.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tS)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tS);return mL(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 Sf(e,t){return new HU(e,t)}function zU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Sf(n))}function VU(e,t){const n=o0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=pU(i[a]);zU(e,a,l)}}function KU(e){return!!(Mr(e)&&e.add)}function cE(e,t){const n=e.getValue("willChange");if(KU(n))return n.add(t)}function gL(e){return e.props[JO]}function rv(e){let t;return()=>(t===void 0&&(t=e()),t)}const YU=rv(()=>window.ScrollTimeline!==void 0);class WU{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(YU()&&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 GU extends WU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const da=e=>e*1e3,fa=e=>e/1e3;function sv(e){return typeof e=="function"}function nS(e,t){e.timeline=t,e.onfinish=null}const iv=e=>Array.isArray(e)&&typeof e[0]=="number",qU={linearEasing:void 0};function XU(e,t){const n=rv(e);return()=>{var r;return(r=qU[t])!==null&&r!==void 0?r:n()}}const Xm=XU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yL=(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})`,uE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bd([0,.65,.55,1]),circOut:bd([.55,0,1,.45]),backIn:bd([.31,.01,.66,-.59]),backOut:bd([.33,1.53,.69,.99])};function EL(e,t){if(e)return typeof e=="function"&&Xm()?yL(e,t):iv(e)?bd(e):Array.isArray(e)?e.map(n=>EL(n,t)||uE.easeOut):uE[e]}const xL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,QU=1e-7,ZU=12;function JU(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=xL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>QU&&++lJU(i,0,1,e,n);return i=>i===0||i===1?i:xL(s(i),t,r)}const wL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vL=e=>t=>1-e(1-t),_L=rh(.33,1.53,.69,.99),av=vL(_L),kL=wL(av),NL=e=>(e*=2)<1?.5*av(e):.5*(2-Math.pow(2,-10*(e-1))),ov=e=>1-Math.sin(Math.acos(e)),SL=vL(ov),TL=wL(ov),AL=e=>/^0[^.\s]+$/u.test(e);function e$(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||AL(e):!0}const Bd=e=>Math.round(e*1e5)/1e5,lv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function t$(e){return e==null}const n$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,cv=(e,t)=>n=>!!(typeof n=="string"&&n$.test(n)&&n.startsWith(e)||t&&!t$(n)&&Object.prototype.hasOwnProperty.call(n,t)),CL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(lv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},r$=e=>ba(0,255,e),Vy={...xu,transform:e=>Math.round(r$(e))},Ko={test:cv("rgb","red"),parse:CL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vy.transform(e)+", "+Vy.transform(t)+", "+Vy.transform(n)+", "+Bd(Nf.transform(r))+")"};function s$(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 dE={test:cv("#"),parse:s$,transform:Ko.transform},cc={test:cv("hsl","hue"),parse:CL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ui.transform(Bd(t))+", "+Ui.transform(Bd(n))+", "+Bd(Nf.transform(r))+")"},Or={test:e=>Ko.test(e)||dE.test(e)||cc.test(e),parse:e=>Ko.test(e)?Ko.parse(e):cc.test(e)?cc.parse(e):dE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ko.transform(e):cc.transform(e)},i$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function a$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(lv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(i$))===null||n===void 0?void 0:n.length)||0)>0}const IL="number",RL="color",o$="var",l$="var(",rS="${}",c$=/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 Tf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(c$,c=>(Or.test(c)?(r.color.push(i),s.push(RL),n.push(Or.parse(c))):c.startsWith(l$)?(r.var.push(i),s.push(o$),n.push(c)):(r.number.push(i),s.push(IL),n.push(parseFloat(c))),++i,rS)).split(rS);return{values:n,split:l,indexes:r,types:s}}function OL(e){return Tf(e).values}function LL(e){const{split:t,types:n}=Tf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function d$(e){const t=OL(e);return LL(e)(t.map(u$))}const fo={test:a$,parse:OL,createTransformer:LL,getAnimatableNone:d$},f$=new Set(["brightness","contrast","saturate","opacity"]);function h$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(lv)||[];if(!r)return e;const s=n.replace(r,"");let i=f$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const p$=/\b([a-z-]*)\(.*?\)/gu,fE={...fo,getAnimatableNone:e=>{const t=e.match(p$);return t?t.map(h$).join(" "):e}},m$={...Ww,color:Or,backgroundColor:Or,outlineColor:Or,fill:Or,stroke:Or,borderColor:Or,borderTopColor:Or,borderRightColor:Or,borderBottomColor:Or,borderLeftColor:Or,filter:fE,WebkitFilter:fE},uv=e=>m$[e];function ML(e,t){let n=uv(e);return n!==fE&&(n=fo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const g$=new Set(["auto","none","0"]);function y$(e,t,n){let r=0,s;for(;re===xu||e===lt,iS=(e,t)=>parseFloat(e.split(", ")[t]),aS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return iS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?iS(i[1],e):0}},b$=new Set(["x","y","z"]),E$=Eu.filter(e=>!b$.has(e));function x$(e){const t=[];return E$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Gc={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:aS(4,13),y:aS(5,14)};Gc.translateX=Gc.x;Gc.translateY=Gc.y;const Zo=new Set;let hE=!1,pE=!1;function jL(){if(pE){const e=Array.from(Zo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=x$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pE=!1,hE=!1,Zo.forEach(e=>e.complete()),Zo.clear()}function DL(){Zo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pE=!0)})}function w$(){DL(),jL()}class dv{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?(Zo.add(this),hE||(hE=!0,_n.read(DL),_n.resolveKeyframes(jL))):(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),v$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _$(e){const t=v$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function BL(e,t,n=1){const[r,s]=_$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return PL(a)?parseFloat(a):a}return Yw(s)?BL(s,t,n+1):s}const FL=e=>t=>t.test(e),k$={test:e=>e==="auto",parse:e=>e},UL=[xu,lt,Ui,Pa,xU,EU,k$],oS=e=>UL.find(FL(e));class $L extends dv{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 lS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fo.test(e)||e==="0")&&!e.startsWith("url("));function N$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function l0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(T$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const A$=40;class HL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$i.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>A$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&w$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=$i.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!S$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(l0(t,this.options,n)),l&&l(),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 mE=2e4;function zL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=mE?1/0:t}const Bn=(e,t,n)=>e+(t-e)*n;function Ky(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 C$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Ky(c,l,e+1/3),i=Ky(c,l,e),a=Ky(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Qm(e,t){return n=>n>0?t:e}const Yy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},I$=[dE,Ko,cc],R$=e=>I$.find(t=>t.test(e));function cS(e){const t=R$(e);if(!t)return!1;let n=t.parse(e);return t===cc&&(n=C$(n)),n}const uS=(e,t)=>{const n=cS(e),r=cS(t);if(!n||!r)return Qm(e,t);const s={...n};return i=>(s.red=Yy(n.red,r.red,i),s.green=Yy(n.green,r.green,i),s.blue=Yy(n.blue,r.blue,i),s.alpha=Bn(n.alpha,r.alpha,i),Ko.transform(s))},O$=(e,t)=>n=>t(e(n)),sh=(...e)=>e.reduce(O$),gE=new Set(["none","hidden"]);function L$(e,t){return gE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function M$(e,t){return n=>Bn(e,t,n)}function fv(e){return typeof e=="number"?M$:typeof e=="string"?Yw(e)?Qm:Or.test(e)?uS:P$:Array.isArray(e)?VL:typeof e=="object"?Or.test(e)?uS:j$:Qm}function VL(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>fv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function D$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=fo.createTransformer(t),r=Tf(e),s=Tf(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?gE.has(e)&&!s.values.length||gE.has(t)&&!r.values.length?L$(e,t):sh(VL(D$(r,s),s.values),n):Qm(e,t)};function KL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Bn(e,t,n):fv(e)(e,t)}const B$=5;function YL(e,t,n){const r=Math.max(t-B$,0);return mL(n-e(r),t-r)}const zn={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},Wy=.001;function F$({duration:e=zn.duration,bounce:t=zn.bounce,velocity:n=zn.velocity,mass:r=zn.mass}){let s,i,a=1-t;a=ba(zn.minDamping,zn.maxDamping,a),e=ba(zn.minDuration,zn.maxDuration,fa(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=yE(u,a),m=Math.exp(-f);return Wy-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),g=yE(Math.pow(u,2),a);return(-s(u)+Wy>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Wy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=$$(s,i,l);if(e=da(e),isNaN(c))return{stiffness:zn.stiffness,damping:zn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const U$=12;function $$(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function V$(e){let t={velocity:zn.velocity,stiffness:zn.stiffness,damping:zn.damping,mass:zn.mass,isResolvedFromDuration:!1,...e};if(!dS(e,z$)&&dS(e,H$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ba(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:zn.mass,stiffness:s,damping:i}}else{const n=F$(e);t={...t,...n,mass:zn.mass},t.isResolvedFromDuration=!0}return t}function WL(e=zn.visualDuration,t=zn.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],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=V$({...n,velocity:-fa(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=fa(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?zn.restSpeed.granular:zn.restSpeed.default),s||(s=b?zn.restDelta.granular:zn.restDelta.default);let x;if(g<1){const k=yE(y,g);x=N=>{const T=Math.exp(-g*y*N);return a-T*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const T=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-T*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let T=0;g<1&&(T=k===0?da(m):YL(x,k,N));const S=Math.abs(T)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(zL(_),mE),N=yL(T=>_.next(k*T).value,k,30);return k+"ms "+N}};return _}function fS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const T=S=>{p(h.value)&&(k=S,N=WL({keyframes:[h.value,m(h.value)],velocity:YL(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),T(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const K$=rh(.42,0,1,1),Y$=rh(0,0,.58,1),GL=rh(.42,0,.58,1),W$=e=>Array.isArray(e)&&typeof e[0]!="number",G$={linear:Es,easeIn:K$,easeInOut:GL,easeOut:Y$,circIn:ov,circInOut:TL,circOut:SL,backIn:av,backInOut:kL,backOut:_L,anticipate:NL},hS=e=>{if(iv(e)){WO(e.length===4);const[t,n,r,s]=e;return rh(t,n,r,s)}else if(typeof e=="string")return G$[e];return e};function q$(e,t,n){const r=[],s=n||KL,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 l=q$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(ba(e[0],e[i-1],d)):u}function Q$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Wc(0,t,r);e.push(Bn(n,1,s))}}function Z$(e){const t=[0];return Q$(t,e.length-1),t}function J$(e,t){return e.map(n=>n*t)}function e7(e,t){return e.map(()=>t||GL).splice(0,e.length-1)}function Zm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=W$(r)?r.map(hS):hS(r),i={done:!1,value:t[0]},a=J$(n&&n.length===t.length?n:Z$(t),e),l=X$(a,t,{ease:Array.isArray(s)?s:e7(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const t7=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_n.update(t,!0),stop:()=>uo(t),now:()=>_r.isProcessing?_r.timestamp:$i.now()}},n7={decay:fS,inertia:fS,tween:Zm,keyframes:Zm,spring:WL},r7=e=>e/100;class hv extends HL{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)||dv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=sv(n)?n:n7[n]||Zm;let c,u;l!==Zm&&typeof t[0]!="number"&&(c=sh(r7,KL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=zL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=ba(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return T&&s!==void 0&&(k.value=l0(c,this.options,s)),w&&w(k.value),T&&this.finish(),k}get duration(){const{resolved:t}=this;return t?fa(t.calculatedDuration):0}get time(){return fa(this.currentTime)}set time(t){t=da(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=fa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=t7,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 s7=new Set(["opacity","clipPath","filter","transform"]);function i7(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=EL(l,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 a7=rv(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jm=10,o7=2e4;function l7(e){return sv(e.type)||e.type==="spring"||!bL(e.ease)}function c7(e,t){const n=new hv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Xm()&&u7(i)&&(i=qL[i]),l7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=c7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=i7(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(nS(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(l0(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 fa(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return fa(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=da(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;nS(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:l}=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 hv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=da(this.time);u.setWithVelocity(m.sample(g-Jm).value,m.sample(g).value,Jm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return a7()&&r&&s7.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const d7={type:"spring",stiffness:500,damping:25,restSpeed:10},f7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),h7={type:"keyframes",duration:.8},p7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},m7=(e,{keyframes:t})=>t.length>2?h7:wl.has(e)?e.startsWith("scale")?f7(t[1]):d7:p7;function g7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const pv=(e,t,n,r={},s,i)=>a=>{const l=Jw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-da(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};g7(l)||(d={...d,...m7(e,d)}),d.duration&&(d.duration=da(d.duration)),d.repeatDelay&&(d.repeatDelay=da(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=l0(d.keyframes,l);if(h!==void 0)return _n.update(()=>{d.onUpdate(h),d.onComplete()}),new GU([])}return!i&&pS.supports(d)?new pS(d):new hv(d)};function y7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function XL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&y7(d,f))continue;const m={delay:n,...Jw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=gL(e);if(y){const b=window.MotionHandoffAnimation(y,f,_n);b!==null&&(m.startTime=b,g=!0)}}cE(e,f),h.start(pv(f,h,p,e.shouldReduceMotion&&pL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{_n.update(()=>{l&&VU(e,l)})}),u}function bE(e,t,n={}){var r;const s=o0(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(XL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return b7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function b7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(E7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(bE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function E7(e,t){return e.sortNodePosition(t)}function x7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>bE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=bE(e,t,n);else{const s=typeof t=="function"?o0(e,t,n.custom):t;r=Promise.all(XL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const w7=$w.length;function QL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?QL(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})=>x7(e,n,r)))}function N7(e){let t=k7(e),n=mS(),r=!0;const s=c=>(u,d)=>{var f;const h=o0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=QL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;w<_7;w++){const y=v7[w],b=n[y],x=u[y]!==void 0?u[y]:d[y],_=kf(x),k=y===c?b.isActive:null;k===!1&&(m=w);let N=x===d[y]&&x!==u[y]&&_;if(N&&r&&e.manuallyAnimateOnMount&&(N=!1),b.protectedKeys={...p},!b.isActive&&k===null||!x&&!b.prevProp||i0(x)||typeof x=="boolean")continue;const T=S7(b.prevProp,x);let S=T||y===c&&b.isActive&&!N&&_||w>m&&_,R=!1;const I=Array.isArray(x)?x:[x];let j=I.reduce(s(y),{});k===!1&&(j={});const{prevResolvedValues:F={}}=b,Y={...F,...j},L=M=>{S=!0,h.has(M)&&(R=!0,h.delete(M)),b.needsAnimating[M]=!0;const O=e.getValue(M);O&&(O.liveStyle=!1)};for(const M in Y){const O=j[M],D=F[M];if(p.hasOwnProperty(M))continue;let A=!1;lE(O)&&lE(D)?A=!hL(O,D):A=O!==D,A?O!=null?L(M):h.add(M):O!==void 0&&h.has(M)?L(M):b.protectedKeys[M]=!0}b.prevProp=x,b.prevResolvedValues=j,b.isActive&&(p={...p,...j}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&T)||R)&&f.push(...I.map(M=>({animation:M,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mS(),r=!0}}}function S7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hL(t,e):!1}function Io(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mS(){return{animate:Io(!0),whileInView:Io(),whileHover:Io(),whileTap:Io(),whileDrag:Io(),whileFocus:Io(),exit:Io()}}class go{constructor(t){this.isMounted=!1,this.node=t}update(){}}class T7 extends go{constructor(t){super(t),t.animationState||(t.animationState=N7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();i0(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 A7=0;class C7 extends go{constructor(){super(...arguments),this.id=A7++}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 I7={animation:{Feature:T7},exit:{Feature:C7}},ai={x:!1,y:!1};function ZL(){return ai.x||ai.y}function R7(e){return e==="x"||e==="y"?ai[e]?null:(ai[e]=!0,()=>{ai[e]=!1}):ai.x||ai.y?null:(ai.x=ai.y=!0,()=>{ai.x=ai.y=!1})}const mv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Af(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ih(e){return{point:{x:e.pageX,y:e.pageY}}}const O7=e=>t=>mv(t)&&e(t,ih(t));function Fd(e,t,n,r){return Af(e,t,O7(n),r)}const gS=(e,t)=>Math.abs(e-t);function L7(e,t){const n=gS(e.x,t.x),r=gS(e.y,t.y);return Math.sqrt(n**2+r**2)}class JL{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=qy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=L7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=_r;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Gy(h,this.transformPagePoint),_n.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qy(f.type==="pointercancel"?this.lastMoveEventInfo:Gy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!mv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ih(t),l=Gy(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=_r;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,qy(l,this.history)),this.removeListeners=sh(Fd(this.contextWindow,"pointermove",this.handlePointerMove),Fd(this.contextWindow,"pointerup",this.handlePointerUp),Fd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),uo(this.updatePoint)}}function Gy(e,t){return t?{point:t(e.point)}:e}function yS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qy({point:e},t){return{point:e,delta:yS(e,eM(t)),offset:yS(e,M7(t)),velocity:j7(t,.1)}}function M7(e){return e[0]}function eM(e){return e[e.length-1]}function j7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=eM(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>da(t)));)n--;if(!r)return{x:0,y:0};const i=fa(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 tM=1e-4,D7=1-tM,P7=1+tM,nM=.01,B7=0-nM,F7=0+nM;function _s(e){return e.max-e.min}function U7(e,t,n){return Math.abs(e-t)<=n}function bS(e,t,n,r=.5){e.origin=r,e.originPoint=Bn(t.min,t.max,e.origin),e.scale=_s(n)/_s(t),e.translate=Bn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=D7&&e.scale<=P7||isNaN(e.scale))&&(e.scale=1),(e.translate>=B7&&e.translate<=F7||isNaN(e.translate))&&(e.translate=0)}function Ud(e,t,n,r){bS(e.x,t.x,n.x,r?r.originX:void 0),bS(e.y,t.y,n.y,r?r.originY:void 0)}function ES(e,t,n){e.min=n.min+t.min,e.max=e.min+_s(t)}function $7(e,t,n){ES(e.x,t.x,n.x),ES(e.y,t.y,n.y)}function xS(e,t,n){e.min=t.min-n.min,e.max=e.min+_s(t)}function $d(e,t,n){xS(e.x,t.x,n.x),xS(e.y,t.y,n.y)}function H7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Bn(n,e,r.max):Math.min(e,n)),e}function wS(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 z7(e,{top:t,left:n,bottom:r,right:s}){return{x:wS(e.x,n,s),y:wS(e.y,t,r)}}function vS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Wc(t.min,t.max-r,e.min):r>s&&(n=Wc(e.min,e.max-s,t.min)),ba(0,1,n)}function Y7(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 EE=.35;function W7(e=EE){return e===!1?e=0:e===!0&&(e=EE),{x:_S(e,"left","right"),y:_S(e,"top","bottom")}}function _S(e,t,n){return{min:kS(e,t),max:kS(e,n)}}function kS(e,t){return typeof e=="number"?e:e[t]||0}const NS=()=>({translate:0,scale:1,origin:0,originPoint:0}),uc=()=>({x:NS(),y:NS()}),SS=()=>({min:0,max:0}),qn=()=>({x:SS(),y:SS()});function Os(e){return[e("x"),e("y")]}function rM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function G7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function q7(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 Xy(e){return e===void 0||e===1}function xE({scale:e,scaleX:t,scaleY:n}){return!Xy(e)||!Xy(t)||!Xy(n)}function jo(e){return xE(e)||sM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sM(e){return TS(e.x)||TS(e.y)}function TS(e){return e&&e!=="0%"}function eg(e,t,n){const r=e-n,s=t*r;return n+s}function AS(e,t,n,r,s){return s!==void 0&&(e=eg(e,s,r)),eg(e,n,r)+t}function wE(e,t=0,n=1,r,s){e.min=AS(e.min,t,n,r,s),e.max=AS(e.max,t,n,r,s)}function iM(e,{x:t,y:n}){wE(e.x,t.translate,t.scale,t.originPoint),wE(e.y,n.translate,n.scale,n.originPoint)}const CS=.999999999999,IS=1.0000000000001;function X7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lCS&&(t.x=1),t.yCS&&(t.y=1)}function dc(e,t){e.min=e.min+t,e.max=e.max+t}function RS(e,t,n,r,s=.5){const i=Bn(e.min,e.max,s);wE(e,t,n,i,r)}function fc(e,t){RS(e.x,t.x,t.scaleX,t.scale,t.originX),RS(e.y,t.y,t.scaleY,t.scale,t.originY)}function aM(e,t){return rM(q7(e.getBoundingClientRect(),t))}function Q7(e,t,n){const r=aM(e,n),{scroll:s}=t;return s&&(dc(r.x,s.offset.x),dc(r.y,s.offset.y)),r}const oM=({current:e})=>e?e.ownerDocument.defaultView:null,Z7=new WeakMap;class J7{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=qn(),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(ih(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=R7(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),Os(w=>{let y=this.getAxisMotionValue(w).get()||0;if(Ui.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=_s(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&_n.postRender(()=>m(d,f)),cE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=eH(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Os(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 JL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oM(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&&_n.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||!up(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=H7(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&&lc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=z7(s.layoutBox,n):this.constraints=!1,this.elastic=W7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Os(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Y7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!lc(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Q7(r,s.root,this.visualElement.getTransformPagePoint());let a=V7(s.layout.layoutBox,i);if(n){const l=n(G7(a));this.hasMutatedConstraints=!!l,l&&(a=rM(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Os(d=>{if(!up(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return cE(this.visualElement,t),r.start(pv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Os(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Os(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){Os(n=>{const{drag:r}=this.getProps();if(!up(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-Bn(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Os(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=K7({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(),Os(a=>{if(!up(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Bn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;Z7.set(this.visualElement,this);const t=this.visualElement.current,n=Fd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lc(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()),_n.read(r);const a=Af(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Os(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=EE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function up(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eH(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tH extends go{constructor(t){super(t),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new J7(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 OS=e=>(t,n)=>{e&&_n.postRender(()=>e(t,n))};class nH extends go{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(t){this.session=new JL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:OS(t),onStart:OS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&_n.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Fd(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 sm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function LS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(lt.test(e))e=parseFloat(e);else return e;const n=LS(e,t.target.x),r=LS(e,t.target.y);return`${n}% ${r}%`}},rH={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=fo.parse(e);if(s.length>5)return r;const i=fo.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=Bn(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class sH extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;IU(iH),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()})),sm.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()||_n.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zw.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 lM(e){const[t,n]=KO(),r=E.useContext(Bw);return o.jsx(sH,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(eL),isPresent:t,safeToRemove:n})}const iH={borderRadius:{...Zu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zu,borderTopRightRadius:Zu,borderBottomLeftRadius:Zu,borderBottomRightRadius:Zu,boxShadow:rH};function aH(e,t,n){const r=Mr(e)?e:Sf(e);return r.start(pv("",r,t,n)),r.animation}function oH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lH=(e,t)=>e.depth-t.depth;class cH{constructor(){this.children=[],this.isDirty=!1}add(t){ev(this.children,t),this.isDirty=!0}remove(t){tv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lH),this.isDirty=!1,this.children.forEach(t)}}function uH(e,t){const n=$i.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(uo(r),e(i-t))};return _n.read(r,!0),()=>uo(r)}const cM=["TopLeft","TopRight","BottomLeft","BottomRight"],dH=cM.length,MS=e=>typeof e=="string"?parseFloat(e):e,jS=e=>typeof e=="number"||lt.test(e);function fH(e,t,n,r,s,i){s?(e.opacity=Bn(0,n.opacity!==void 0?n.opacity:1,hH(r)),e.opacityExit=Bn(t.opacity!==void 0?t.opacity:1,0,pH(r))):i&&(e.opacity=Bn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Wc(e,t,r))}function PS(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){PS(e.x,t.x),PS(e.y,t.y)}function BS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function FS(e,t,n,r,s){return e-=t,e=eg(e,1/n,r),s!==void 0&&(e=eg(e,1/s,r)),e}function mH(e,t=0,n=1,r=.5,s,i=e,a=e){if(Ui.test(t)&&(t=parseFloat(t),t=Bn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Bn(i.min,i.max,r);e===i&&(l-=t),e.min=FS(e.min,t,n,l,s),e.max=FS(e.max,t,n,l,s)}function US(e,t,[n,r,s],i,a){mH(e,t[n],t[r],t[s],t.scale,i,a)}const gH=["x","scaleX","originX"],yH=["y","scaleY","originY"];function $S(e,t,n,r){US(e.x,t,gH,n?n.x:void 0,r?r.x:void 0),US(e.y,t,yH,n?n.y:void 0,r?r.y:void 0)}function HS(e){return e.translate===0&&e.scale===1}function dM(e){return HS(e.x)&&HS(e.y)}function zS(e,t){return e.min===t.min&&e.max===t.max}function bH(e,t){return zS(e.x,t.x)&&zS(e.y,t.y)}function VS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fM(e,t){return VS(e.x,t.x)&&VS(e.y,t.y)}function KS(e){return _s(e.x)/_s(e.y)}function YS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EH{constructor(){this.members=[]}add(t){ev(this.members,t),t.scheduleRender()}remove(t){if(tv(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 xH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Do={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ed=typeof window<"u"&&window.MotionDebug!==void 0,Qy=["","X","Y","Z"],wH={visibility:"hidden"},WS=1e3;let vH=0;function Zy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=gL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_n,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hM(r)}function pM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=vH++,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,Ed&&(Do.totalNodes=Do.resolvedTargetDeltas=Do.recalculatedProjection=0),this.nodes.forEach(NH),this.nodes.forEach(IH),this.nodes.forEach(RH),this.nodes.forEach(SH),Ed&&window.MotionDebug.record(Do)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=uH(h,250),sm.hasAnimatedSinceResize&&(sm.hasAnimatedSinceResize=!1,this.nodes.forEach(qS))})}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 g=this.options.transition||d.getDefaultTransition()||DH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!fM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Jw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||qS(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,uo(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(OH),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&&hM(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;XS(f.x,a.x,k),XS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),MH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&bH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=qn()),Rs(x,this.relativeTarget)),g&&(this.animationValues=d,fH(d,u,this.latestValues,k,b,y)),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&&(uo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_n.update(()=>{sm.hasAnimatedSinceResize=!0,this.currentAnimation=aH(0,WS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(WS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&mM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||qn();const f=_s(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=_s(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Rs(l,c),fc(l,d),Ud(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new EH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Zy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(GS),this.root.sharedNodes.clear()}}}function _H(e){e.updateLayout()}function kH(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"?Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(h);h.min=r[f].min,h.max=h.min+p}):mM(i,n.layoutBox,r)&&Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=uc();Ud(l,r,n.layoutBox);const c=uc();a?Ud(c,e.applyTransform(s,!0),n.measuredBox):Ud(c,r,n.layoutBox);const u=!dM(l);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=qn();$d(m,n.layoutBox,h.layoutBox);const g=qn();$d(g,r,p.layoutBox),fM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function NH(e){Ed&&Do.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 SH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function TH(e){e.clearSnapshot()}function GS(e){e.clearMeasurements()}function AH(e){e.isLayoutDirty=!1}function CH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function IH(e){e.resolveTargetDelta()}function RH(e){e.calcProjection()}function OH(e){e.resetSkewAndRotation()}function LH(e){e.removeLeadSnapshot()}function XS(e,t,n){e.translate=Bn(t.translate,0,n),e.scale=Bn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QS(e,t,n,r){e.min=Bn(t.min,n.min,r),e.max=Bn(t.max,n.max,r)}function MH(e,t,n,r){QS(e.x,t.x,n.x,r),QS(e.y,t.y,n.y,r)}function jH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const DH={duration:.45,ease:[.4,0,.1,1]},ZS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JS=ZS("applewebkit/")&&!ZS("chrome/")?Math.round:Es;function eT(e){e.min=JS(e.min),e.max=JS(e.max)}function PH(e){eT(e.x),eT(e.y)}function mM(e,t,n){return e==="position"||e==="preserve-aspect"&&!U7(KS(t),KS(n),.2)}function BH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const FH=pM({attachResizeListener:(e,t)=>Af(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jy={current:void 0},gM=pM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Jy.current){const e=new FH({});e.mount(window),e.setOptions({layoutScroll:!0}),Jy.current=e}return Jy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),UH={pan:{Feature:nH},drag:{Feature:tH,ProjectionNode:gM,MeasureLayout:lM}};function $H(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 yM(e,t){const n=$H(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function tT(e){return t=>{t.pointerType==="touch"||ZL()||e(t)}}function HH(e,t,n={}){const[r,s,i]=yM(e,n),a=tT(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=tT(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function nT(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&&_n.postRender(()=>i(t,ih(t)))}class zH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=HH(t,n=>(nT(this.node,n,"Start"),r=>nT(this.node,r,"End"))))}unmount(){}}class VH extends go{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=sh(Af(this.node.current,"focus",()=>this.onFocus()),Af(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const bM=(e,t)=>t?e===t?!0:bM(e,t.parentElement):!1,KH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YH(e){return KH.has(e.tagName)||e.tabIndex!==-1}const xd=new WeakSet;function rT(e){return t=>{t.key==="Enter"&&e(t)}}function eb(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rT(()=>{if(xd.has(n))return;eb(n,"down");const s=rT(()=>{eb(n,"up")}),i=()=>eb(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 sT(e){return mv(e)&&!ZL()}function GH(e,t,n={}){const[r,s,i]=yM(e,n),a=l=>{const c=l.currentTarget;if(!sT(l)||xd.has(c))return;xd.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!sT(p)||!xd.has(c))&&(xd.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||bM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!YH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>WH(u,s),s)}),i}function iT(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&&_n.postRender(()=>i(t,ih(t)))}class qH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=GH(t,n=>(iT(this.node,n,"Start"),(r,{success:s})=>iT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const vE=new WeakMap,tb=new WeakMap,XH=e=>{const t=vE.get(e.target);t&&t(e)},QH=e=>{e.forEach(XH)};function ZH({root:e,...t}){const n=e||document;tb.has(n)||tb.set(n,{});const r=tb.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(QH,{root:e,...t})),r[s]}function JH(e,t,n){const r=ZH(t);return vE.set(e,n),r.observe(e),()=>{vE.delete(e),r.unobserve(e)}}const ez={some:0,all:1};class tz extends go{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:ez[s]},l=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 JH(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(nz(t,n))&&this.startObserver()}unmount(){}}function nz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rz={inView:{Feature:tz},tap:{Feature:qH},focus:{Feature:VH},hover:{Feature:zH}},sz={layout:{ProjectionNode:gM,MeasureLayout:lM}},_E={current:null},EM={current:!1};function iz(){if(EM.current=!0,!!Fw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_E.current=e.matches;e.addListener(t),t()}else _E.current=!1}const az=[...UL,Or,fo],oz=e=>az.find(FL(e)),aT=new WeakMap;function lz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Mr(s))e.addValue(r,s);else if(Mr(i))e.addValue(r,Sf(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,Sf(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class cz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=dv,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=$i.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),EM.current||iz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_E.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aT.delete(this.current),this.projection&&this.projection.unmount(),uo(this.notifyUpdate),uo(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=wl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&_n.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):qn()}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=Sf(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"&&(PL(s)||AL(s))?s=parseFloat(s):!oz(s)&&fo.test(n)&&(s=ML(t,n)),this.setBaseTarget(t,Mr(s)?s.get():s)),Mr(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=Kw(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&&!Mr(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 nv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class xM extends cz{constructor(){super(...arguments),this.KeyframeResolver=$L}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;Mr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function uz(e){return window.getComputedStyle(e)}class dz extends xM{constructor(){super(...arguments),this.type="html",this.renderInstance=oL}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}else{const r=uz(t),s=(sL(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return aM(t,n)}build(t,n,r){Gw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zw(t,n,r)}}class fz extends xM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}return n=lL.has(n)?n:Hw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return dL(t,n,r)}build(t,n,r){qw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){cL(t,n,r,s)}mount(t){this.isSVGTag=Qw(t.tagName),super.mount(t)}}const hz=(e,t)=>Vw(e)?new fz(t):new dz(t,{allowProjection:e!==E.Fragment}),pz=FU({...I7,...rz,...UH,...sz},hz),nn=eU(pz);function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Kl(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var mz=["container"];function gz(e){var t=e.container,n=t===void 0?document.body:t,r=c0(e,mz);return vs.createPortal(kt.createElement("div",fr({},r)),n)}function yz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 bz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 Ez(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function xz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function cT(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 Ha=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function nb(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Ha(e,i,n,innerWidth)[0],f=Ha(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function SE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function rb(e,t,n){var r=SE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function fp(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var vz={T:0,L:0,W:0,H:0,FIT:void 0},vM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},_z=["className"];function kz(e){var t=e.className,n=t===void 0?"":t,r=c0(e,_z);return kt.createElement("div",fr({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Nz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Sz(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=c0(e,Nz),u=vM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",fr({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(kz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var Tz={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 Az(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,T=e.expose,S=tg(Tz),R=S[0],I=S[1],j=E.useRef(0),F=vM(),Y=R.naturalWidth,L=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?l:U,M=R.width,O=M===void 0?i:M,D=R.height,A=D===void 0?l:D,H=R.loaded,W=H===void 0?!n:H,P=R.broken,te=R.x,X=R.y,ne=R.touched,ce=R.stopRaf,J=R.maskTouched,fe=R.rotate,ee=R.scale,Ee=R.CX,ge=R.CY,xe=R.lastX,we=R.lastY,Te=R.lastCX,Re=R.lastCY,Ye=R.lastScale,Le=R.touchTime,bt=R.touchLength,Ze=R.pause,ze=R.reach,le=Jo({onScale:function(pe){return ve(dp(pe))},onRotate:function(pe){fe!==pe&&(T({rotate:pe}),I(fr({rotate:pe},rb(L,C,pe))))}});function ve(pe,Je,at){ee!==pe&&(T({scale:pe}),I(fr({scale:pe},nb(te,X,O,A,ee,pe,Je,at),pe<=1&&{x:0,y:0})))}var ct=fp(function(pe,Je,at){if(at===void 0&&(at=0),(ne||J)&&N){var dn=SE(fe,O,A),an=dn[0],pt=dn[1];if(at===0&&j.current===0){var Lt=Math.abs(pe-Ee)<=20,on=Math.abs(Je-ge)<=20;if(Lt&&on)return void I({lastCX:pe,lastCY:Je});j.current=Lt?Je>ge?3:2:1}var On,lr=pe-Te,fn=Je-Re;if(at===0){var Bt=Ha(lr+xe,ee,an,innerWidth)[0],Kn=Ha(fn+we,ee,pt,innerHeight);On=function(Se,Ce,Qe,ot){return Ce&&Se===1||ot==="x"?"x":Qe&&Se>1||ot==="y"?"y":void 0}(j.current,Bt,Kn[0],ze),On!==void 0&&x(On,pe,Je,ee)}if(On==="x"||J)return void I({reach:"x"});var ue=dp(ee+(at-bt)/100/2*ee,L/O,.2);T({scale:ue}),I(fr({touchLength:at,reach:On,scale:ue},nb(te,X,O,A,ee,ue,pe,Je,lr,fn)))}},{maxWait:8});function ht(pe){return!ce&&!ne&&(F.current&&I(fr({},pe,{pause:u})),F.current)}var G,Z,he,De,qe,nt,Vt,Et,Pt=(qe=function(pe){return ht({x:pe})},nt=function(pe){return ht({y:pe})},Vt=function(pe){return F.current&&(T({scale:pe}),I({scale:pe})),!ne&&F.current},Et=Jo({X:function(pe){return qe(pe)},Y:function(pe){return nt(pe)},S:function(pe){return Vt(pe)}}),function(pe,Je,at,dn,an,pt,Lt,on,On,lr,fn){var Bt=SE(lr,an,pt),Kn=Bt[0],ue=Bt[1],Se=Ha(pe,on,Kn,innerWidth),Ce=Se[0],Qe=Se[1],ot=Ha(Je,on,ue,innerHeight),et=ot[0],Ct=ot[1],Yt=Date.now()-fn;if(Yt>=200||on!==Lt||Math.abs(On-Lt)>1){var oe=nb(pe,Je,an,pt,Lt,on),be=oe.x,ft=oe.y,Ve=Ce?Qe:be!==pe?be:null,Ke=et?Ct:ft!==Je?ft:null;return Ve!==null&&Fo(pe,Ve,Et.X),Ke!==null&&Fo(Je,Ke,Et.Y),void(on!==Lt&&Fo(Lt,on,Et.S))}var dt=(pe-at)/Yt,Wt=(Je-dn)/Yt,cr=Math.sqrt(Math.pow(dt,2)+Math.pow(Wt,2)),Yn=!1,hn=!1;(function(Ln,Gt){var Jt,Ot=Ln,kn=0,Nn=0,en=function(pr){Jt||(Jt=pr);var nr=pr-Jt,Si=Math.sign(Ln),Xs=-.001*Si,Zr=Math.sign(-Ot)*Math.pow(Ot,2)*2e-4,Ar=Ot*nr+(Xs+Zr)*Math.pow(nr,2)/2;kn+=Ar,Jt=pr,Si*(Ot+=(Xs+Zr)*nr)<=0?Wn():Gt(kn)?tr():Wn()};function tr(){Nn=requestAnimationFrame(en)}function Wn(){cancelAnimationFrame(Nn)}tr()})(cr,function(Ln){var Gt=pe+Ln*(dt/cr),Jt=Je+Ln*(Wt/cr),Ot=Ha(Gt,Lt,Kn,innerWidth),kn=Ot[0],Nn=Ot[1],en=Ha(Jt,Lt,ue,innerHeight),tr=en[0],Wn=en[1];if(kn&&!Yn&&(Yn=!0,Ce?Fo(Gt,Nn,Et.X):uT(Nn,Gt+(Gt-Nn),Et.X)),tr&&!hn&&(hn=!0,et?Fo(Jt,Wn,Et.Y):uT(Wn,Jt+(Jt-Wn),Et.Y)),Yn&&hn)return!1;var pr=Yn||Et.X(Nn),nr=hn||Et.Y(Wn);return pr&&nr})}),Kt=(G=y,Z=function(pe,Je){ze||ve(ee!==1?1:Math.max(2,L/O),pe,Je)},he=E.useRef(0),De=fp(function(){he.current=0,G.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var pe=[].slice.call(arguments);he.current+=1,De.apply(void 0,pe),he.current>=2&&(De.cancel(),he.current=0,Z.apply(void 0,pe))});function Nt(pe,Je){if(j.current=0,(ne||J)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var at=dp(ee,L/O);if(Pt(te,X,xe,we,O,A,ee,at,Ye,fe,Le),_(pe,Je),Ee===pe&&ge===Je){if(ne)return void Kt(pe,Je);J&&b(pe,Je)}}}function rn(pe,Je,at){at===void 0&&(at=0),I({touched:!0,CX:pe,CY:Je,lastCX:pe,lastCY:Je,lastX:te,lastY:X,lastScale:ee,touchLength:at,touchTime:Date.now()})}function sn(pe){I({maskTouched:!0,CX:pe.clientX,CY:pe.clientY,lastX:te,lastY:X})}Kl(na?void 0:"mousemove",function(pe){pe.preventDefault(),ct(pe.clientX,pe.clientY)}),Kl(na?void 0:"mouseup",function(pe){Nt(pe.clientX,pe.clientY)}),Kl(na?"touchmove":void 0,function(pe){pe.preventDefault();var Je=cT(pe);ct.apply(void 0,Je)},{passive:!1}),Kl(na?"touchend":void 0,function(pe){var Je=pe.changedTouches[0];Nt(Je.clientX,Je.clientY)},{passive:!1}),Kl("resize",fp(function(){W&&!ne&&(I(rb(L,C,fe)),k())},{maxWait:8})),NE(function(){N&&T(fr({scale:ee,rotate:fe},le))},[N]);var _t=function(pe,Je,at,dn,an,pt,Lt,on,On,lr){var fn=function(be,ft,Ve,Ke,dt){var Wt=E.useRef(!1),cr=tg({lead:!0,scale:Ve}),Yn=cr[0],hn=Yn.lead,Ln=Yn.scale,Gt=cr[1],Jt=fp(function(Ot){try{return dt(!0),Gt({lead:!1,scale:Ot}),Promise.resolve()}catch(kn){return Promise.reject(kn)}},{wait:Ke});return NE(function(){Wt.current?(dt(!1),Gt({lead:!0}),Jt(Ve)):Wt.current=!0},[Ve]),hn?[be*Ln,ft*Ln,Ve/Ln]:[be*Ve,ft*Ve,1]}(pt,Lt,on,On,lr),Bt=fn[0],Kn=fn[1],ue=fn[2],Se=function(be,ft,Ve,Ke,dt){var Wt=E.useState(vz),cr=Wt[0],Yn=Wt[1],hn=E.useState(0),Ln=hn[0],Gt=hn[1],Jt=E.useRef(),Ot=Jo({OK:function(){return be&&Gt(4)}});function kn(Nn){dt(!1),Gt(Nn)}return E.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Ve){if(function(Nn,en){var tr=Nn&&Nn.current;if(tr&&tr.nodeType===1){var Wn=tr.getBoundingClientRect();en({T:Wn.top,L:Wn.left,W:Wn.width,H:Wn.height,FIT:tr.tagName==="IMG"?getComputedStyle(tr).objectFit:void 0})}}(ft,Yn),be)return Date.now()-Jt.current<250?(Gt(1),requestAnimationFrame(function(){Gt(2),requestAnimationFrame(function(){return kn(3)})}),void setTimeout(Ot.OK,Ke)):void Gt(4);kn(5)}},[be,Ve]),[Ln,cr]}(pe,Je,at,On,lr),Ce=Se[0],Qe=Se[1],ot=Qe.W,et=Qe.FIT,Ct=innerWidth/2,Yt=innerHeight/2,oe=Ce<3||Ce>4;return[oe?ot?Qe.L:Ct:dn+(Ct-pt*on/2),oe?ot?Qe.T:Yt:an+(Yt-Lt*on/2),Bt,oe&&et?Bt*(Qe.H/ot):Kn,Ce===0?ue:oe?ot/(pt*on)||.01:ue,oe?et?1:0:1,Ce,et]}(u,c,W,te,X,O,A,ee,d,function(pe){return I({pause:pe})}),rt=_t[4],Oe=_t[6],gt="transform "+d+"ms "+f,Ae={className:p,onMouseDown:na?void 0:function(pe){pe.stopPropagation(),pe.button===0&&rn(pe.clientX,pe.clientY,0)},onTouchStart:na?function(pe){pe.stopPropagation(),rn.apply(void 0,cT(pe))}:void 0,onWheel:function(pe){if(!ze){var Je=dp(ee-pe.deltaY/100/2,L/O);I({stopRaf:!0}),ve(Je,pe.clientX,pe.clientY)}},style:{width:_t[2]+"px",height:_t[3]+"px",opacity:_t[5],objectFit:Oe===4?void 0:_t[7],transform:fe?"rotate("+fe+"deg)":void 0,transition:Oe>2?gt+", opacity "+d+"ms ease, height "+(Oe<4?d/2:Oe>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!na&&N?sn:void 0,onTouchStart:na&&N?function(pe){return sn(pe.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+rt+", 0, 0, "+rt+", "+_t[0]+", "+_t[1]+")",transition:ne||Ze?void 0:gt,willChange:N?"transform":void 0}},n?kt.createElement(Sz,fr({src:n,loaded:W,broken:P},Ae,{onPhotoLoad:function(pe){I(fr({},pe,pe.loaded&&rb(pe.naturalWidth||0,pe.naturalHeight||0,fe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:Ae,scale:rt,rotate:fe})))}var dT={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 Cz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,T=e.index,S=T===void 0?0:T,R=e.onIndexChange,I=e.visible,j=e.onClose,F=e.afterClose,Y=e.portalContainer,L=tg(dT),U=L[0],C=L[1],M=E.useState(0),O=M[0],D=M[1],A=U.x,H=U.touched,W=U.pause,P=U.lastCX,te=U.lastCY,X=U.bg,ne=X===void 0?u:X,ce=U.lastBg,J=U.overlay,fe=U.minimal,ee=U.scale,Ee=U.rotate,ge=U.onScale,xe=U.onRotate,we=e.hasOwnProperty("index"),Te=we?S:O,Re=we?R:D,Ye=E.useRef(Te),Le=N.length,bt=N[Te],Ze=typeof n=="boolean"?n:Le>n,ze=function(rt,Oe){var gt=E.useReducer(function(at){return!at},!1)[1],Ae=E.useRef(0),pe=function(at){var dn=E.useRef(at);function an(pt){dn.current=pt}return E.useMemo(function(){(function(pt){rt?(pt(rt),Ae.current=1):Ae.current=2})(an)},[at]),[dn.current,an]}(rt),Je=pe[1];return[pe[0],Ae.current,function(){gt(),Ae.current===2&&(Je(!1),Oe&&Oe()),Ae.current=0}]}(I,F),le=ze[0],ve=ze[1],ct=ze[2];NE(function(){if(le)return C({pause:!0,x:Te*-(innerWidth+Pl)}),void(Ye.current=Te);C(dT)},[le]);var ht=Jo({close:function(rt){xe&&xe(0),C({overlay:!0,lastBg:ne}),j(rt)},changeIndex:function(rt,Oe){Oe===void 0&&(Oe=!1);var gt=Ze?Ye.current+(rt-Te):rt,Ae=Le-1,pe=kE(gt,0,Ae),Je=Ze?gt:pe,at=innerWidth+Pl;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-at*Je,pause:Oe}),Ye.current=Je,Re&&Re(Ze?rt<0?Ae:rt>Ae?0:rt:pe)}}),G=ht.close,Z=ht.changeIndex;function he(rt){return rt?G():C({overlay:!J})}function De(){C({x:-(innerWidth+Pl)*Te,lastCX:void 0,lastCY:void 0,pause:!0}),Ye.current=Te}function qe(rt,Oe,gt,Ae){rt==="x"?function(pe){if(P!==void 0){var Je=pe-P,at=Je;!Ze&&(Te===0&&Je>0||Te===Le-1&&Je<0)&&(at=Je/2),C({touched:!0,lastCX:P,x:-(innerWidth+Pl)*Ye.current+at,pause:!1})}else C({touched:!0,lastCX:pe,x:A,pause:!1})}(Oe):rt==="y"&&function(pe,Je){if(te!==void 0){var at=u===null?null:kE(u,.01,u-Math.abs(pe-te)/100/4);C({touched:!0,lastCY:te,bg:Je===1?at:u,minimal:Je===1})}else C({touched:!0,lastCY:pe,bg:ne,minimal:!0})}(gt,Ae)}function nt(rt,Oe){var gt=rt-(P??rt),Ae=Oe-(te??Oe),pe=!1;if(gt<-40)Z(Te+1);else if(gt>40)Z(Te-1);else{var Je=-(innerWidth+Pl)*Ye.current;Math.abs(Ae)>100&&fe&&f&&(pe=!0,G()),C({touched:!1,x:Je,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!pe||J})}}Kl("keydown",function(rt){if(I)switch(rt.key){case"ArrowLeft":Z(Te-1,!0);break;case"ArrowRight":Z(Te+1,!0);break;case"Escape":G()}});var Vt=function(rt,Oe,gt){return E.useMemo(function(){var Ae=rt.length;return gt?rt.concat(rt).concat(rt).slice(Ae+Oe-1,Ae+Oe+2):rt.slice(Math.max(Oe-1,0),Math.min(Oe+2,Ae+1))},[rt,Oe,gt])}(N,Te,Ze);if(!le)return null;var Et=J&&!ve,Pt=I?ne:ce,Kt=ge&&xe&&{images:N,index:Te,visible:I,onClose:G,onIndexChange:Z,overlayVisible:Et,overlay:bt&&bt.overlay,scale:ee,rotate:Ee,onScale:ge,onRotate:xe},Nt=r?r(ve):400,rn=s?s(ve):lT,sn=r?r(3):600,_t=s?s(3):lT;return kt.createElement(gz,{className:"PhotoView-Portal"+(Et?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(rt){return rt.stopPropagation()},container:Y},I&&kt.createElement(xz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ve===1?" PhotoView-Slider__fadeIn":ve===2?" PhotoView-Slider__fadeOut":""),style:{background:Pt?"rgba(0, 0, 0, "+Pt+")":void 0,transitionTimingFunction:rn,transitionDuration:(H?0:Nt)+"ms",animationDuration:Nt+"ms"},onAnimationEnd:ct}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},Te+1," / ",Le),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&Kt&&g(Kt),kt.createElement(yz,{className:"PhotoView-Slider__toolbarIcon",onClick:G}))),Vt.map(function(rt,Oe){var gt=Ze||Te!==0?Ye.current-1+Oe:Te+Oe;return kt.createElement(Az,{key:Ze?rt.key+"/"+rt.src+"/"+gt:rt.key,item:rt,speed:Nt,easing:rn,visible:I,onReachMove:qe,onReachUp:nt,onPhotoTap:function(){return he(i)},onMaskTap:function(){return he(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Pl)*gt+"px",transform:"translate3d("+A+"px, 0px, 0)",transition:H||W?void 0:"transform "+sn+"ms "+_t},loadingElement:_,brokenElement:k,onPhotoResize:De,isActive:Ye.current===gt,expose:C})}),!na&&p&&kt.createElement(kt.Fragment,null,(Ze||Te!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Z(Te-1,!0)}},kt.createElement(bz,null)),(Ze||Te+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Jo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return fr({},a,h)},[a,h]);return kt.createElement(wM.Provider,{value:m},t,kt.createElement(Cz,fr({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var _M=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(wM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=Jo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,fr({},g,{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 Lz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kM=(...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 Mz={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 jz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...Mz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kM("lucide",s),...l},[...a.map(([u,d])=>E.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 Pe=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(jz,{ref:i,iconNode:t,className:kM(`lucide-${Lz(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 Dz=Pe("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 Pz=Pe("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** + * @license lucide-react v0.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 gv=Pe("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 NM=Pe("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 Hd=Pe("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 SM=Pe("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 TM=Pe("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 Bz=Pe("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 cl=Pe("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 AM=Pe("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 Fz=Pe("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 Uz=Pe("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 Gs=Pe("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 yv=Pe("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 $z=Pe("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 $s=Pe("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 u0=Pe("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 CM=Pe("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 TE=Pe("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 Hz=Pe("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 bv=Pe("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 d0=Pe("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 zz=Pe("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 Vz=Pe("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 im=Pe("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 f0=Pe("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 Kz=Pe("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 Ev=Pe("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 Yz=Pe("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 xv=Pe("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 Wz=Pe("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 fT=Pe("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 Gz=Pe("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 qz=Pe("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 wv=Pe("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 Xz=Pe("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 IM=Pe("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 Qz=Pe("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 Zz=Pe("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 Jz=Pe("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 vv=Pe("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 RM=Pe("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 eV=Pe("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 tV=Pe("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 h0=Pe("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 nV=Pe("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 rV=Pe("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 _v=Pe("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 yo=Pe("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 sV=Pe("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 OM=Pe("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 iV=Pe("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 LM=Pe("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 aV=Pe("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 $t=Pe("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 oV=Pe("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 lV=Pe("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 Ac=Pe("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 cV=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.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 MM=Pe("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 uV=Pe("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 dV=Pe("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 fV=Pe("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 hV=Pe("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + * @license lucide-react v0.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 jM=Pe("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 pV=Pe("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 mV=Pe("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 gV=Pe("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 yV=Pe("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 kr=Pe("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 DM=Pe("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 kv=Pe("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 bV=Pe("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 EV=Pe("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 Cf=Pe("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 xV=Pe("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 wV=Pe("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 hT=Pe("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 ul=Pe("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 vV=Pe("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 Vi=Pe("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 _V=Pe("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 kV=Pe("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 NV=Pe("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 SV=Pe("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 TV=Pe("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 PM=Pe("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 Tr=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pT="veadk_auth_qs";let Ju=null;function AV(){if(Ju!==null)return Ju;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(pT,t),Ju=t):Ju=sessionStorage.getItem(pT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Ju}function Hi(e){const t=AV();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 wu=3e4,ah=12e4,BM=1e4;function bi(e,t=wu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const ng="veadk_local_user",rg="veadk_local_user_tab",CV=/^[A-Za-z0-9]{1,16}$/;function FM(){try{const e=sessionStorage.getItem(rg);if(e)return e;const t=localStorage.getItem(ng);return t&&sessionStorage.setItem(rg,t),t}catch{try{return localStorage.getItem(ng)}catch{return null}}}function mT(e){try{sessionStorage.setItem(rg,e)}catch{}try{localStorage.setItem(ng,e)}catch{}}function IV(){try{sessionStorage.removeItem(rg)}catch{}try{localStorage.removeItem(ng)}catch{}}function p0(e){const t=new Headers(e),n=FM();return n&&t.set("X-VeADK-Local-User",n),t}async function UM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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 RV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function OV(){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 LV(){const[e,t]=await Promise.all([AE(),UM()]);return e.status==="unauthenticated"&&t.length>0}function MV(){window.location.assign("/oauth2/logout")}async function AE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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=FM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function jV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function DV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const CE="veadk:authentication-required";let zd=null,wd=null;function PV(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 BV(e){zd||(zd=new Promise(n=>{wd=n}),window.dispatchEvent(new Event(CE)));const t=zd;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 FV(){return zd!==null}function UV(){wd==null||wd(),wd=null,zd=null}async function m0(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 $V=/\brun_sse\s*failed\s*:\s*404\b/i,HV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,gT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function hp(e){const t=String(e);return HV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!$V.test(t)||t.includes(gT)?t:`${t} + +${gT}`}async function*Nv(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 l=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const c=l.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 zV=255,VV=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function KV(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let r=0,s="";for(const i of t){if(!VV.test(i))continue;const a=n.encode(i).byteLength;if(r+a>zV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const Sv="veadk.messageFeedback.v1";function Tv(e,t,n,r){return[e,t,n,r].join(":")}function Av(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(Sv)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function YV(e,t,n){if(typeof window>"u")return;const r=Av();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(Sv,JSON.stringify(r))}function $M(e){if(typeof window>"u")return;const t=Tv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Av(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(Sv,JSON.stringify(n))}}const am="",Cv=new Map;function HM(e,t){Cv.set(e,t)}function zM(){Cv.clear()}function ar(e){const t=Cv.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 mt(e,t={},n={},r=wu){const s={...t,headers:p0(t.headers)},i=()=>{const c={...s,signal:bi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Hi(`${am}/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(Hi(`${am}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Hi(`${am}${e}`),c)},a=async c=>{if(PV(c))return!0;if(c.status!==401)return!1;try{return await LV()}catch{return!1}};let l=await i();for(;await a(l);)await BV(t.signal),l=await i();return l}function WV(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 En(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return WV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function VM(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class oh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class qa extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const GV="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",qV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",XV=3e4,IE=new Map;function KM(e,t){return`${t}:${e}`}async function QV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function g0(e,t,n){const r=await mt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await QV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new oh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new qa(GV);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new qa(qV);if(n!=null&&n.runtimeId&&r.status===404)throw new qa("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new qa("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await En(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&IE.set(KM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+XV}),i}async function sg(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,l=await En(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Iv(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function ig(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/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 l=Tv(s.runtimeId,r,t,n);a.state={...Av()[l]??{},...a.state??{}}}return a}async function YM(e){const{app:t,ep:n}=ar(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},ah);if(!r.ok)throw new Error(await En(r,"提交反馈失败"));const s=await r.json(),i=Tv(n.runtimeId,t,e.userId,e.sessionId);return YV(i,e.eventId,s),s}async function WM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await mt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await En(n,"读取评测集失败"));return n.json()}async function GM(e){const t=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},ah);if(!t.ok)throw new Error(await En(t,"删除评测案例失败"));return t.json()}async function RE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}function ZV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function XM(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await mt(c,{},a,ah);if(!u.ok)throw new Error(await En(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=ZV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function QM(e,t,n,r,s){const{blob:i}=await XM(e,t,n,r,s);return URL.createObjectURL(i)}async function JV(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await En(t,"media capabilities failed"));return t.json()}async function ZM(e,t,n,r){const{app:s}=ar(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 mt("/web/media",{method:"POST",body:i},{},ah);if(!a.ok)throw new Error(await En(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function OE(e,t,n){const{app:r}=ar(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await mt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await En(i,"media cleanup failed"))}function JM(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 om(e,t){const n=JM(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await mt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await En(r,"media cleanup failed"))}function ej(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=JM(t);if(!n)return t;const r=`${n}/content`;return Hi(`${am}${r}`)}async function tj(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Rv(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 Ov(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function LE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(Ov(r,t,n),{},s);if(!i.ok)throw new Error(await En(i,"读取会话能力失败"));return Rv(await i.json())}async function Lv(e){const{ep:t}=ar(e),n=await mt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await En(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function eK(e){const{ep:t}=ar(e),n=await mt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await En(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function tK(e,t,n){const{ep:r}=ar(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await mt(i,{},r);if(!a.ok)throw new Error(await En(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function nj(e,t,n=1,r=20){const{ep:s}=ar(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await mt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await En(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function ME(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=await mt(Ov(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(!l.ok)throw new Error(await En(l,"添加会话能力失败"));return Rv(await l.json())}async function rj(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=`${Ov(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await mt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await En(c,"移除会话能力失败"));return Rv(await c.json())}async function sj(e,t,n=!0){const r=await mt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await mt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Mv(e){const{app:t,ep:n}=ar(e);return sj(t,n,!1)}async function jv(e,t,n){const r={runtimeId:e,region:t},s=KM(e,t),i=IE.get(s);i&&i.expiresAt<=Date.now()&&IE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await g0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return sj(a,r)}async function ij(e,t,n,r){const{app:s,ep:i}=ar(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await mt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await En(l,"Agent 检索失败"));return l.json()}async function aj(e,t){const{app:n}=ar(e),r=await mt(`/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*If({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=ar(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,veadkInvocation:h}}}const m=await mt(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:l},d,0);if(!m.ok)throw new Error(hp(`run_sse failed: ${m.status}`));for await(const g of Nv(m)){const w=g;typeof w.error=="string"&&(w.error=hp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=hp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=hp(w.error_message)),yield w}}const Vd=new Map;async function y0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Vd.set(s,i);const a=()=>{s&&Vd.get(s)===i&&Vd.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await mt("/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:KV((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of Nv(l)){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 oj(e){var n;const t=await mt("/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=Vd.get(e))==null||n.abort(),Vd.delete(e)}async function nK(e="cn-beijing"){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Rf={title:"VeADK Studio",logoUrl:""},sb={studio:!1,version:"",branding:Rf,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function lj(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return sb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Rf.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:Rf.title,logoUrl:s?Hi(s):""},features:{...sb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return sb}}const cj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function uj(){var n,r,s;const e=await mt("/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 dj(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 mt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function fj(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},ah);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 Cc(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 mt(`/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 hj(e,t){try{return await g0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof oh||n instanceof qa)throw n;return null}}async function pj(e,t){const n=await mt("/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 Dv(e,t){const n=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载 Runtime 详情失败"));return n.json()}async function Pv(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"生成项目失败"));return t.json()}const rK=19e4;async function mj(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},rK);if(!t.ok)throw new Error(await En(t,"生成 Agent 配置失败"));return m0(t,"生成 Agent 配置失败")}async function gj(e){const t=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"创建调试运行失败"));return m0(t,"创建调试运行失败")}async function yj(e,t){const n=await mt(`/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 En(n,"创建调试会话失败"));return(await m0(n,"创建调试会话失败")).id}async function bj(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载调试调用链路失败"));const r=await m0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*Ej({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await mt(`/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 En(a,"调试运行失败"));for await(const l of Nv(a))yield l}async function Yl(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await En(t,"清理调试运行失败"))}const sK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Rf,DEFAULT_STUDIO_ACCESS:cj,RuntimeAccessDeniedError:oh,RuntimeProbeError:qa,addSessionCapability:ME,cancelAgentkitDeployment:oj,clearMessageFeedbackCache:$M,clearRemoteApps:zM,componentSearch:ij,createGeneratedAgentTestRun:gj,createGeneratedAgentTestSession:yj,createSession:sg,deleteAgentFeedbackCases:GM,deleteGeneratedAgentTestRun:Yl,deleteMedia:om,deleteRuntime:pj,deleteSession:RE,deleteSessionMedia:OE,deployAgentkitProject:y0,downloadArtifact:qM,fetchRemoteApps:g0,generateAgentDraftFromRequirement:mj,generateAgentProject:Pv,getAgentFeedbackCases:WM,getAgentInfo:Mv,getGeneratedAgentTestTrace:bj,getMediaCapabilities:JV,getMyRuntimes:nK,getRuntimeAgentInfo:jv,getRuntimeDetail:Dv,getRuntimes:Cc,getSession:ig,getSessionCapabilities:LE,getSessionTrace:tj,getStudioAccess:uj,getStudioUpdateStatus:dj,getUiConfig:lj,listApps:VM,listSessionBuiltinTools:Lv,listSessionSkillSpaces:eK,listSessionSkillsInSpace:tK,listSessions:Iv,mediaContentUrl:ej,previewArtifact:QM,probeRuntimeApps:hj,registerRemoteApp:HM,removeSessionCapability:rj,runGeneratedAgentTestSSE:Ej,runSSE:If,searchSessionPublicSkills:nj,startStudioUpdate:fj,submitMessageFeedback:YM,uploadMedia:ZM,webSearch:aj},Symbol.toStringTag,{value:"Module"})),iK="send_a2ui_json_to_client",aK="validated_a2ui_json",jE="adk_request_credential",yT="transfer_to_agent";function oK(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 hi(){return{blocks:[],liveStart:0}}const bT=e=>e.functionCall??e.function_call,DE=e=>e.functionResponse??e.function_response;function lK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function cK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function xj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:cK(l.data),name:l.displayName??l.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 PE(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 uK=new Set(["llm","sequential","parallel","loop","a2a"]);function dK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&uK.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 fK(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 hK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function ET(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 pp(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function qc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>bT(p)||DE(p));if(t.partial&&!i){for(const p of s){const m=PE(p);typeof m=="string"&&m&&ET(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=bT(p),g=DE(p),w=xj([p]),y=PE(p);if(typeof y=="string"&&y)ET(n,p.thought?"thinking":"text",y);else if(w.length)pp(n),fK(n,w);else if(m)if(pp(n),m.name===yT){const b=lK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===jE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:oK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(pp(n),g.name===yT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===jE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===iK){const b=((d=g.response)==null?void 0:d[aK])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&hK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),pp(n),r=n.length,{blocks:n,liveStart:r}}function pK(e,t={}){var s,i;const n=[];let r=hi();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=DE(p))==null?void 0:m.name)===jE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(PE).filter(p=>!!p).join(""),d=xj(c),f=dK(c);if(!u&&!d.length&&!f){r=hi();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=hi()}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=hi()),r=qc(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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function mK(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 gK=50,xT=48;function yK(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 bK(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 EK(e,t,n){const r=Math.max(0,t-xT),s=Math.min(e.length,t+n+xT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await ig(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of yK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:bK(l),snippet:EK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,gK)}async function wK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await aj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function vK(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await ij(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function _K(e,t,n){return e==="session"?{results:await xK(n.userId,n.appId,t)}:e==="web"?wK(n.appId,t):vK(e,n.appId,n.userId,t)}function wj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function kK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function NK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(wj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function SK(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 ag(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 wT(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 TK({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=SK(t,n,r),T=N.find(M=>M.id===a),S=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function M(O){var D;(D=k.current)!=null&&D.contains(O.target)||x(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[b]);async function R(M,O){var W;const D=M.trim();if(!D||!((W=N.find(P=>P.id===O))!=null&&W.ready))return;const A=++_.current;g(!0),y(!0);let H;try{H=await _K(O,D,{userId:e,appId:t})}catch(P){const te=P instanceof Error?P.message:String(P);H={results:[],note:`搜索失败:${te}`}}A===_.current&&(f(H.results),p(H.note),g(!1))}function I(M){_.current+=1,u(M),f([]),p(void 0),y(!1),g(!1)}function j(M){_.current+=1,l(M),x(!1),f([]),p(void 0),y(!1),g(!1)}const F=!!(T!=null&&T.ready),Y=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?ag(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(M=>!M),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(kK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(M=>{var A,H;const O=M.id==="knowledge"?(A=n==null?void 0:n.components)==null?void 0:A.find(W=>W.source==="knowledgebase"||W.kind==="knowledgebase"):M.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(W=>W.source==="long_term_memory"||W.kind==="memory"):void 0,D=O?[O.name,O.backend?ag(O.backend):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===M.id,disabled:!M.ready,onClick:()=>j(M.id),children:[o.jsx("span",{children:M.label}),D&&o.jsx("small",{children:D})]},M.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:M=>I(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),R(c,a))},placeholder:Y,disabled:!F,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx($t,{className:"icon spin"}):o.jsx(wj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:F?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((M,O)=>o.jsx(AK,{result:M,agentLabel:s,onOpen:i},O)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function AK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(MM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(h0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(Ev,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:"",e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function vT({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 Bv="/assets/volcengine-DM14a-L-.svg",_T="(max-width: 860px)";function CK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function IK(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 RK={admin:"管理员",developer:"开发者",user:"普通用户"};function kT({role:e}){const t=RK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function OK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),vs.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(Tr,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function LK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=jV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=IK(d||f||h),m=DV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} +${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(yo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(lV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(OK,{version:n,onClose:()=>l(!1)}):null]})}function MK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(_T).matches),[k,N]=E.useState(_.current),T=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(_T),I=j=>{j.matches?N(F=>F||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(mV,{className:"icon"}):o.jsx(pV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(kr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(CK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(NK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(kr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[T.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),T.map(R=>{const I=mK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(j=>j===R.id?null:R.id),children:o.jsx(Kz,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(Vi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(LK,{access:s,userInfo:m,version:g,onLogout:w})]})}const vj="veadk_agentkit_connections";function Ls(){try{const e=localStorage.getItem(vj);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function b0(e){try{localStorage.setItem(vj,JSON.stringify(e))}catch{}}function bo(e,t){return`agentkit:${e}:${t}`}function _j(e){try{return new URL(e).host}catch{return e}}function vu(e){zM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)HM(bo(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function kj(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=Ls(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,b0(l),vu(l),a}async function og(e,t,n,r){let s;try{s=await hj(e,n)}catch(l){throw l instanceof oh&&lg(e),l}if(!s||s.length===0)throw lg(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=kj(e,t,n,s,i,r);return bo(a.id,s[0])}async function Nj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await g0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||_j(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...Ls().filter(c=>c.base!==s),a];return b0(l),vu(l),a}function jK(e){const t=Ls().filter(n=>n.id!==e);return b0(t),vu(t),t}function lg(e){const t=Ls().filter(n=>n.runtimeId!==e);return b0(t),vu(t),t}function Sj(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:bo(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:_j(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const NT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:Nj,addRuntimeConnection:kj,buildAgentEntries:Sj,connectRuntime:og,loadConnections:Ls,registerConnections:vu,remoteAppId:bo,removeConnection:jK,removeRuntimeConnection:lg},Symbol.toStringTag,{value:"Module"}));function Xc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 BE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function DK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function Tj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const ST=15,PK=1e4,BK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function FK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function Aj(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 ib(e,t=PK){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 UK({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,T]=E.useState(!1),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(null),[L,U]=E.useState(new Set),[C,M]=E.useState(),[O,D]=E.useState("agent"),A=E.useRef(!1);function H(ee){M(Ee=>(Ee==null?void 0:Ee.runtimeId)===ee.runtimeId?void 0:{runtimeId:ee.runtimeId,name:ee.name,region:ee.region})}const W=E.useCallback(async ee=>{if(d[ee]){g(ee);return}const Ee=h[ee];if(Ee!==void 0){T(!0),R("");try{const ge=await ib(Cc({nextToken:Ee,pageSize:ST,region:_,scope:"all"}));f(xe=>{const we=[...xe];return we[ee]=ge.runtimes,we}),p(xe=>{const we=[...xe];return ge.nextToken&&(we[ee+1]=ge.nextToken),we}),g(ee)}catch(ge){R(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[h,d,_]),P=E.useCallback(async()=>{T(!0),R("");try{const ee=[];let Ee="";do{const ge=await ib(Cc({scope:"mine",nextToken:Ee,pageSize:100,region:_}));ee.push(...ge.runtimes),Ee=ge.nextToken}while(Ee&&ee.length<2e3);x(ee)}catch(ee){R(ee instanceof Error?ee.message:String(ee))}finally{T(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),A.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!A.current&&(A.current=!0,W(0))},[e,s,w,W]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&P()},[w,b,s,P]),E.useEffect(()=>{e&&(M(void 0),D("agent"))},[e]);function te(){U(new Set),w?(x(null),P()):(f([]),p([""]),g(0),A.current=!0,T(!0),R(""),ib(Cc({nextToken:"",pageSize:ST,region:_,scope:"all"})).then(ee=>{f([ee.runtimes]),p(ee.nextToken?["",ee.nextToken]:[""])}).catch(ee=>R(ee instanceof Error?ee.message:String(ee))).finally(()=>T(!1)))}function X(ee){ee!==_&&(k(ee),f([]),p([""]),g(0),x(null),U(new Set),A.current=!1)}const ne=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function ce(ee){Y(ee.runtimeId),og(ee.runtimeId,ee.name,ee.region).then(async Ee=>{await u(Ee),t()}).catch(Ee=>{if(Ee instanceof oh){R(Ee.message);return}if(Ee instanceof qa){Ee.unsupported&&U(ge=>new Set(ge).add(ee.runtimeId)),R(Ee.message);return}U(ge=>new Set(ge).add(ee.runtimeId))}).finally(()=>Y(null))}if(!e)return null;const fe=(w?b??[]:d[m]??[]).filter(ee=>I?ee.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Xc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:te,title:"刷新",disabled:N,children:o.jsx(DM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(Tr,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(ee=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${ee===a?"active":""}`,onClick:()=>{u(ee),t()},children:[o.jsx(Xc,{}),o.jsx("span",{className:"agentsel-item-name",children:ee})]})},ee))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(Cf,{className:"icon"}),o.jsx("input",{value:I,onChange:ee=>j(ee.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:BK.map(ee=>o.jsx("button",{type:"button",className:_===ee.value?"active":"","aria-pressed":_===ee.value,onClick:()=>X(ee.value),children:ee.label},ee.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:ee=>y(ee.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[fe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:fe.map(ee=>{const Ee=L.has(ee.runtimeId),ge=F===ee.runtimeId,xe=(l==null?void 0:l.runtimeId)===ee.runtimeId,we=(C==null?void 0:C.runtimeId)===ee.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${xe?"active":""} ${we?"is-previewed":""}`,title:ee.runtimeId,children:[o.jsx(Tj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:ee.name,children:ee.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${Ee?"bad":WK(ee.status)}`,children:Ee?"不支持":Cj(ee.status)}),ee.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||xe,onClick:()=>ce(ee),children:ge?"连接中…":xe?"已连接":Ee?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${we?"active":""}`,"aria-label":`查看 ${ee.name} 信息`,"aria-pressed":we,title:"查看信息",onClick:()=>H(ee),children:o.jsx(yo,{className:"icon"})}):null]})]})},ee.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx($t,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void W(m-1),"aria-label":"上一页",children:o.jsx($z,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!ne||N,onClick:()=>void W(m+1),"aria-label":"下一页",children:o.jsx($s,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(VK,{runtime:C,tab:O,onTabChange:D})]})]})}const $K={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function HK(e){return $K[e.toLowerCase()]??e}function zK(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 VK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx(KK,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(YK,{runtime:e})})]})}function KK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),jv(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(Aj(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx($t,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Xc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(TT,{icon:o.jsx(jM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(TT,{icon:o.jsx(BE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(DK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(AM,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[HK(d.kind),d.backend?` · ${zK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function TT({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function YK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Dv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(Aj(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",Cj(t.status)]),t.region&&u.push(["区域",FK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(Tj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx($t,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function WK(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 GK={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function Cj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return GK[t]??(e||"-")}function qK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx($s,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(XK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function XK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Pz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(yv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx(UK,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function lh(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Ij(){return(await lh("/web/skill-spaces?region=all")).items||[]}async function QK(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),lh(`/web/skill-spaces?${t.toString()}`)}async function Rj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function ZK(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),lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function JK(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 lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function eY(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 tY(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const nY="https://ark.cn-beijing.volces.com/api/v3/",lm=[{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:nY}],Qc=[],ed=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],Ei={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Oj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:Ei.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:Ei.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:Ei.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],dl=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Qc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Qc},{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"}]}],FE=[{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}]}],UE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:lm,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},...lm],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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Qc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Zc="viking",$E=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Qc},{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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Qc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],HE=[{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:[...Qc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],rY={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function zE(e){const t=dl.find(n=>n.id===e||n.toolNames.includes(e));return rY[e]??(t==null?void 0:t.label)??e}function AT(e){const t=dl.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function sY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function iY(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function CT(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Lj({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),vs.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(sY,{})})]}),i]})]}),document.body)}function cm({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(iY,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function aY({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${zE(m)} ${m} ${AT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Lj,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(BE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(cm,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(BE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:zE(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:AT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function oY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,T]=E.useState([]),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(!0),[L,U]=E.useState(!1),[C,M]=E.useState(""),[O,D]=E.useState(""),A=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let X=!0;const ne=window.setTimeout(()=>{g(!0),y(""),nj(e,c.trim()).then(ce=>{X&&(f(ce.items),p(ce.totalCount))}).catch(ce=>{X&&(f([]),p(0),y(ce instanceof Error?ce.message:"搜索 Skill Hub 失败"))}).finally(()=>{X&&g(!1)})},250);return()=>{X=!1,window.clearTimeout(ne)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let X=!0;return Y(!0),M(""),Ij().then(ne=>{X&&(x(ne),k(ne[0]??null))}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取 Skill Space 失败")}).finally(()=>{X&&Y(!1)}),()=>{X=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){T([]);return}let X=!0;return U(!0),M(""),Rj(_.id,_.region).then(ne=>{X&&T(ne)}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取技能失败")}).finally(()=>{X&&U(!1)}),()=>{X=!1}},[_,a]);const H=E.useMemo(()=>{const X=S.trim().toLowerCase();return X?b.filter(ne=>`${ne.name} ${ne.id} ${ne.description}`.toLowerCase().includes(X)):b},[S,b]),W=E.useMemo(()=>{const X=I.trim().toLowerCase();return X?N.filter(ne=>`${ne.skillName} ${ne.skillDescription}`.toLowerCase().includes(X)):N},[I,N]),P=async X=>{if(!_)return;D(X.skillId);const ne=await s({kind:"skill",name:X.skillName,skillSourceId:_.id,description:X.skillDescription,version:X.version});D(""),ne&&i()},te=async X=>{D(X.slug);const ne=await s({kind:"skill",name:X.name,skillSourceId:`findskill:${X.slug}`,description:X.description,version:X.version||X.updatedAt});D(""),ne&&i()};return o.jsx(Lj,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(cm,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(X=>{const ne=A.has(X.name),ce=O===X.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.name}),o.jsx("span",{children:X.description||"暂无描述"}),o.jsxs("small",{children:[X.sourceRepo||X.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),X.downloadCount.toLocaleString()," 次下载",X.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),X.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void te(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},X.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(cm,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:F?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):H.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):H.map(X=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===X.id?" is-active":""}`,onClick:()=>{k(X),j("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:X.name||X.id}),o.jsx("small",{children:X.description||X.id}),o.jsxs("em",{children:[X.skillCount??0," 个技能"]})]})},`${X.projectName??"default"}:${X.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(cm,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:j})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):W.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):W.map(X=>{const ne=A.has(X.skillName),ce=O===X.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.skillName}),o.jsx("span",{children:X.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",X.version||"—"]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void P(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},`${X.skillId}:${X.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function Ea({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const lY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Mj(e){return 1+e.children.reduce((t,n)=>t+Mj(n),0)}function Jc(e){return e.id||e.name}function cY(e,t){const n=Jc(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 jj(e,t=!0){return{...e,id:Jc(e),name:cY(e,t),children:e.children.map(n=>jj(n,!1))}}function Dj(e,t){t.set(Jc(e),e.name||Jc(e)),e.children.forEach(n=>Dj(n,t))}function uY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function dY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Pj({node:e,activeAgent:t,seen:n,path:r}){const s=Jc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Xc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:lY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Pj,{node:c,activeAgent:t,seen:n,path:r},Jc(c)))})]})}function ab({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function Bj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(Ea,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=jj(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:[]}),w=(l==null?void 0:l.tools)??uY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??dY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Dj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(ab,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:zE(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(ab,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(ab,{title:"拓扑",count:Mj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Pj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(aY,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(oY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function fY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function hY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(fY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(Bj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function W1e(){}function IT(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 Fj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pY=/[$_\p{ID_Start}]/u,mY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,gY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,yY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uj={};function G1e(e){return e?pY.test(String.fromCodePoint(e)):!1}function q1e(e,t){const r=(t||Uj).jsx?gY:mY;return e?r.test(String.fromCodePoint(e)):!1}function RT(e,t){return(Uj.jsx?bY:yY).test(e)}const EY=/[ \t\n\f\r]/g;function xY(e){return typeof e=="object"?e.type==="text"?OT(e.value):!1:OT(e)}function OT(e){return e.replace(EY,"")===""}let ch=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function $j(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ch(n,r,t)}function Of(e){return e.toLowerCase()}class cs{constructor(t,n){this.attribute=n,this.property=t}}cs.prototype.attribute="";cs.prototype.booleanish=!1;cs.prototype.boolean=!1;cs.prototype.commaOrSpaceSeparated=!1;cs.prototype.commaSeparated=!1;cs.prototype.defined=!1;cs.prototype.mustUseProperty=!1;cs.prototype.number=!1;cs.prototype.overloadedBoolean=!1;cs.prototype.property="";cs.prototype.spaceSeparated=!1;cs.prototype.space=void 0;let wY=0;const wt=vl(),sr=vl(),VE=vl(),je=vl(),gn=vl(),Ic=vl(),ps=vl();function vl(){return 2**++wY}const KE=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:sr,commaOrSpaceSeparated:ps,commaSeparated:Ic,number:je,overloadedBoolean:VE,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),ob=Object.keys(KE);class Fv extends cs{constructor(t,n,r,s){let i=-1;if(super(t,n),LT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&SY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(MT,AY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!MT.test(i)){let a=i.replace(NY,TY);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Fv}return new s(r,t)}function TY(e){return"-"+e.toLowerCase()}function AY(e){return e.charAt(1).toUpperCase()}const uh=$j([Hj,vY,Kj,Yj,Wj],"html"),Eo=$j([Hj,_Y,Kj,Yj,Wj],"svg");function jT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Gj(e){return e.join(" ").trim()}var Uv={},DT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,CY=/\n/g,IY=/^\s*/,RY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,OY=/^:\s*/,LY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,MY=/^[;\s]*/,jY=/^\s+|\s+$/g,DY=` +`,PT="/",BT="*",Uo="",PY="comment",BY="declaration";function FY(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 g=m.match(CY);g&&(n+=g.length);var w=m.lastIndexOf(DY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(IY)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(PT!=e.charAt(0)||BT!=e.charAt(1))){for(var g=2;Uo!=e.charAt(g)&&(BT!=e.charAt(g)||PT!=e.charAt(g+1));)++g;if(g+=2,Uo===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:PY,comment:w})}}function h(){var m=i(),g=c(RY);if(g){if(f(),!c(OY))return l("property missing ':'");var w=c(LY),y=m({type:BY,property:FT(g[0].replace(DT,Uo)),value:w?FT(w[0].replace(DT,Uo)):Uo});return c(MY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function FT(e){return e?e.replace(jY,Uo):Uo}var UY=FY,$Y=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.default=zY;const HY=$Y(UY);function zY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,HY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var x0={};Object.defineProperty(x0,"__esModule",{value:!0});x0.camelCase=void 0;var VY=/^--[a-zA-Z0-9_-]+$/,KY=/-([a-z])/g,YY=/^[^-]+$/,WY=/^-(webkit|moz|ms|o|khtml)-/,GY=/^-(ms)-/,qY=function(e){return!e||YY.test(e)||VY.test(e)},XY=function(e,t){return t.toUpperCase()},UT=function(e,t){return"".concat(t,"-")},QY=function(e,t){return t===void 0&&(t={}),qY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(GY,UT):e=e.replace(WY,UT),e.replace(KY,XY))};x0.camelCase=QY;var ZY=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},JY=ZY(Uv),eW=x0;function YE(e,t){var n={};return!e||typeof e!="string"||(0,JY.default)(e,function(r,s){r&&s&&(n[(0,eW.camelCase)(r,t)]=s)}),n}YE.default=YE;var tW=YE;const nW=Xf(tW),w0=qj("end"),Yi=qj("start");function qj(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 rW(e){const t=Yi(e),n=w0(e);if(t&&n)return{start:t,end:n}}function Kd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$T(e.position):"start"in e||"end"in e?$T(e):"line"in e||"column"in e?WE(e):""}function WE(e){return HT(e&&e.line)+":"+HT(e&&e.column)}function $T(e){return WE(e&&e.start)+"-"+WE(e&&e.end)}function HT(e){return e&&typeof e=="number"?e:1}class Br 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Kd(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}}Br.prototype.file="";Br.prototype.name="";Br.prototype.reason="";Br.prototype.message="";Br.prototype.stack="";Br.prototype.column=void 0;Br.prototype.line=void 0;Br.prototype.ancestors=void 0;Br.prototype.cause=void 0;Br.prototype.fatal=void 0;Br.prototype.place=void 0;Br.prototype.ruleId=void 0;Br.prototype.source=void 0;const $v={}.hasOwnProperty,sW=new Map,iW=/[A-Z]/g,aW=new Set(["table","tbody","thead","tfoot","tr"]),oW=new Set(["td","th"]),Xj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lW(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=gW(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=mW(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"?Eo:uh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Qj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Qj(e,t,n){if(t.type==="element")return cW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fW(e,t,n);if(t.type==="mdxjsEsm")return dW(e,t);if(t.type==="root")return hW(e,t,n);if(t.type==="text")return pW(e,t)}function cW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=Jj(e,t.tagName,!1),a=yW(e,t);let l=zv(e,t);return aW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!xY(c):!0})),Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function uW(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)}Lf(e,t.position)}function dW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lf(e,t.position)}function fW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Jj(e,t.name,!0),a=bW(e,t),l=zv(e,t);return Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function hW(e,t,n){const r={};return Hv(r,zv(e,t)),e.create(t,e.Fragment,r,n)}function pW(e,t){return t.value}function Zj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function gW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=Yi(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function yW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&$v.call(t.properties,s)){const i=EW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&oW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Lf(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else Lf(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function zv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:sW;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?(xs(e,e.length,0,t),e):t}const KT={}.hasOwnProperty;function t3(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 xi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yr=xo(/[A-Za-z]/),jr=xo(/[\dA-Za-z]/),AW=xo(/[#-'*+\--9=?A-Z^-~]/);function cg(e){return e!==null&&(e<32||e===127)}const GE=xo(/\d/),CW=xo(/[\dA-Fa-f]/),IW=xo(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function Tt(e){return e===-2||e===-1||e===32}const v0=xo(new RegExp("\\p{P}|\\p{S}","u")),fl=xo(/\s/);function xo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ku(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),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 Mt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return Tt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Tt(c)&&i++a))return;const T=t.events.length;let S=T,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=T;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function jW(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function eu(e){if(e===null||un(e)||fl(e))return 1;if(v0(e))return 2}function _0(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};WT(f,-c),WT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ds(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ds(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Ds(u,_0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ds(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Ds(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,xs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&Tt(N)?Mt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||it(N)?e.check(GT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||it(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,T,S){let R=0;return I;function I(U){return N.enter("lineEnding"),N.consume(U),N.exit("lineEnding"),j}function j(U){return N.enter("codeFencedFence"),Tt(U)?Mt(N,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===l?(N.enter("codeFencedFenceSequence"),Y(U)):S(U)}function Y(U){return U===l?(R++,N.consume(U),Y):R>=a?(N.exit("codeFencedFenceSequence"),Tt(U)?Mt(N,L,"whitespace")(U):L(U)):S(U)}function L(U){return U===null||it(U)?(N.exit("codeFencedFence"),T(U)):S(U)}}}function WW(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 cb={name:"codeIndented",tokenize:qW},GW={partial:!0,tokenize:XW};function qW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Mt(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):it(u)?e.attempt(GW,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||it(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function XW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Mt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):it(a)?s(a):n(a)}}const QW={name:"codeText",previous:JW,resolve:ZW,tokenize:eG};function ZW(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&&td(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),td(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),td(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 o3(e,t,n,r,s,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||cg(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||it(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||un(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):it(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||it(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Tt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function c3(e,t,n,r,s,i){let a;return l;function l(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):it(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Mt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||it(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 Yd(e,t){let n;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Tt(s)?Mt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const lG={name:"definition",tokenize:uG},cG={partial:!0,tokenize:dG};function uG(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return l3.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=xi(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 un(p)?Yd(e,u)(p):u(p)}function u(p){return o3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(cG,f,f)(p)}function f(p){return Tt(p)?Mt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||it(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function dG(e,t,n){return r;function r(l){return un(l)?Yd(e,s)(l):n(l)}function s(l){return c3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return Tt(l)?Mt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||it(l)?t(l):n(l)}}const fG={name:"hardBreakEscape",tokenize:hG};function hG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const pG={name:"headingAtx",resolve:mG,tokenize:gG};function mG(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"},xs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function gG(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||un(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||it(d)?(e.exit("atxHeading"),t(d)):Tt(d)?Mt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||un(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const yG=["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"],XT=["pre","script","style","textarea"],bG={concrete:!0,name:"htmlFlow",resolveTo:wG,tokenize:vG},EG={partial:!0,tokenize:kG},xG={partial:!0,tokenize:_G};function wG(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 vG(e,t,n){const r=this;let s,i,a,l,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,g):P===63?(e.consume(P),s=3,r.interrupt?t:A):Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,l=0,m):Yr(P)?(e.consume(P),s=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function m(P){const te="CDATA[";return P===te.charCodeAt(l++)?(e.consume(P),l===te.length?r.interrupt?t:F:m):n(P)}function g(P){return Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function w(P){if(P===null||P===47||P===62||un(P)){const te=P===47,X=a.toLowerCase();return!te&&!i&&XT.includes(X)?(s=1,r.interrupt?t(P):F(P)):yG.includes(a.toLowerCase())?(s=6,te?(e.consume(P),y):r.interrupt?t(P):F(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?b(P):x(P))}return P===45||jr(P)?(e.consume(P),a+=String.fromCharCode(P),w):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function b(P){return Tt(P)?(e.consume(P),b):I(P)}function x(P){return P===47?(e.consume(P),I):P===58||P===95||Yr(P)?(e.consume(P),_):Tt(P)?(e.consume(P),x):I(P)}function _(P){return P===45||P===46||P===58||P===95||jr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):Tt(P)?(e.consume(P),k):x(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,T):Tt(P)?(e.consume(P),N):S(P)}function T(P){return P===c?(e.consume(P),c=null,R):P===null||it(P)?n(P):(e.consume(P),T)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||un(P)?k(P):(e.consume(P),S)}function R(P){return P===47||P===62||Tt(P)?x(P):n(P)}function I(P){return P===62?(e.consume(P),j):n(P)}function j(P){return P===null||it(P)?F(P):Tt(P)?(e.consume(P),j):n(P)}function F(P){return P===45&&s===2?(e.consume(P),C):P===60&&s===1?(e.consume(P),M):P===62&&s===4?(e.consume(P),H):P===63&&s===3?(e.consume(P),A):P===93&&s===5?(e.consume(P),D):it(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(EG,W,Y)(P)):P===null||it(P)?(e.exit("htmlFlowData"),Y(P)):(e.consume(P),F)}function Y(P){return e.check(xG,L,W)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return P===null||it(P)?Y(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),A):F(P)}function M(P){return P===47?(e.consume(P),a="",O):F(P)}function O(P){if(P===62){const te=a.toLowerCase();return XT.includes(te)?(e.consume(P),H):F(P)}return Yr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),O):F(P)}function D(P){return P===93?(e.consume(P),A):F(P)}function A(P){return P===62?(e.consume(P),H):P===45&&s===2?(e.consume(P),A):F(P)}function H(P){return P===null||it(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),H)}function W(P){return e.exit("htmlFlow"),t(P)}}function _G(e,t,n){const r=this;return s;function s(a){return it(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 kG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(dh,t,n)}}const NG={name:"htmlText",tokenize:SG};function SG(e,t,n){const r=this;let s,i,a;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),k):A===63?(e.consume(A),x):Yr(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,m):Yr(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):it(A)?(a=f,M(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?C(A):A===45?h(A):f(A)}function m(A){const H="CDATA[";return A===H.charCodeAt(i++)?(e.consume(A),i===H.length?g:m):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),w):it(A)?(a=g,M(A)):(e.consume(A),g)}function w(A){return A===93?(e.consume(A),y):g(A)}function y(A){return A===62?C(A):A===93?(e.consume(A),y):g(A)}function b(A){return A===null||A===62?C(A):it(A)?(a=b,M(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),_):it(A)?(a=x,M(A)):(e.consume(A),x)}function _(A){return A===62?C(A):x(A)}function k(A){return Yr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||jr(A)?(e.consume(A),N):T(A)}function T(A){return it(A)?(a=T,M(A)):Tt(A)?(e.consume(A),T):C(A)}function S(A){return A===45||jr(A)?(e.consume(A),S):A===47||A===62||un(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),C):A===58||A===95||Yr(A)?(e.consume(A),I):it(A)?(a=R,M(A)):Tt(A)?(e.consume(A),R):C(A)}function I(A){return A===45||A===46||A===58||A===95||jr(A)?(e.consume(A),I):j(A)}function j(A){return A===61?(e.consume(A),F):it(A)?(a=j,M(A)):Tt(A)?(e.consume(A),j):R(A)}function F(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,Y):it(A)?(a=F,M(A)):Tt(A)?(e.consume(A),F):(e.consume(A),L)}function Y(A){return A===s?(e.consume(A),s=void 0,U):A===null?n(A):it(A)?(a=Y,M(A)):(e.consume(A),Y)}function L(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||un(A)?R(A):(e.consume(A),L)}function U(A){return A===47||A===62||un(A)?R(A):n(A)}function C(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function M(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Tt(A)?Mt(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):D(A)}function D(A){return e.enter("htmlTextData"),a(A)}}const Yv={name:"labelEnd",resolveAll:IG,resolveTo:RG,tokenize:OG},TG={tokenize:LG},AG={tokenize:MG},CG={tokenize:jG};function IG(e){let t=-1;const n=[];for(;++t=3&&(u===null||it(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Tt(u)?Mt(e,l,"whitespace")(u):l(u))}}const ts={continuation:{tokenize:KG},exit:WG,name:"list",tokenize:VG},HG={partial:!0,tokenize:GG},zG={partial:!0,tokenize:YG};function VG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:GE(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(um,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 GE(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(dh,r.interrupt?n:d,e.attempt(HG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return Tt(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 KG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dh,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!Tt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function YG(e,t,n){const r=this;return Mt(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 WG(e){e.exit(this.containerState.type)}function GG(e,t,n){const r=this;return Mt(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!Tt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const QT={name:"setextUnderline",resolveTo:qG,tokenize:XG};function qG(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 XG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Tt(u)?Mt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||it(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const QG={tokenize:ZG};function ZG(e){const t=this,n=e.attempt(dh,r,e.attempt(this.parser.constructs.flowInitial,s,Mt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(rG,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 JG={resolveAll:d3()},eq=u3("string"),tq=u3("text");function u3(e){return{resolveAll:d3(e==="text"?nq:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function mq(e,t){let n=-1;const r=[];let s;for(;++n0){const nt=he.tokenStack[he.tokenStack.length-1];(nt[1]||JT).call(he,void 0,nt[0])}for(Z.position={start:La(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:La(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe0&&(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 Cq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Iq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ku(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Oq(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 Lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p3(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 Mq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={src:ku(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 jq(e,t){const n={src:ku(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 Dq(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 Pq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={href:ku(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 Bq(e,t){const n={href:ku(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 Fq(e,t,n){const r=e.all(t),s=n?Uq(n):m3(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 l=-1;for(;++l1}function $q(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)},l=Yi(t.children[1]),c=w0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Yq(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,l=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(n2(t.slice(s),s>0,!1)),i.join("")}function n2(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===e2||i===t2;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===e2||i===t2;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function qq(e,t){const n={type:"text",value:Gq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Qq={blockquote:Sq,break:Tq,code:Aq,delete:Cq,emphasis:Iq,footnoteReference:Rq,heading:Oq,html:Lq,imageReference:Mq,image:jq,inlineCode:Dq,linkReference:Pq,link:Bq,listItem:Fq,list:$q,paragraph:Hq,root:zq,strong:Vq,table:Kq,tableCell:Wq,tableRow:Yq,text:qq,thematicBreak:Xq,toml:mp,yaml:mp,definition:mp,footnoteDefinition:mp};function mp(){}const g3=-1,k0=0,Wd=1,ug=2,Wv=3,Gv=4,qv=5,Xv=6,y3=7,b3=8,Zq=typeof self=="object"?self:globalThis,r2=(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 Zq[e](t)},Jq=(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 k0:case g3:return n(a,s);case Wd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case ug:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Wv:return n(new Date(a),s);case Gv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case qv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Xv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case y3:{const{name:l,message:c}=a;return n(r2(l,c),s)}case b3: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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(r2(i,a),s)};return r},s2=e=>Jq(new Map,e)(0),Bl="",{toString:eX}={},{keys:tX}=Object,nd=e=>{const t=typeof e;if(t!=="object"||!e)return[k0,t];const n=eX.call(e).slice(8,-1);switch(n){case"Array":return[Wd,Bl];case"Object":return[ug,Bl];case"Date":return[Wv,Bl];case"RegExp":return[Gv,Bl];case"Map":return[qv,Bl];case"Set":return[Xv,Bl];case"DataView":return[Wd,n]}return n.includes("Array")?[Wd,n]:n.includes("Error")?[y3,n]:[ug,n]},gp=([e,t])=>e===k0&&(t==="function"||t==="symbol"),nX=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=nd(a);switch(l){case k0:{let d=a;switch(c){case"bigint":l=b3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([g3],a)}return s([l,d],a)}case Wd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case ug:{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([l,d],a);for(const h of tX(a))(e||!gp(nd(a[h])))&&d.push([i(h),i(a[h])]);return f}case Wv:return s([l,a.toISOString()],a);case Gv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case qv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(gp(nd(h))||gp(nd(p))))&&d.push([i(h),i(p)]);return f}case Xv:{const d=[],f=s([l,d],a);for(const h of a)(e||!gp(nd(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},i2=(e,{json:t,lossy:n}={})=>{const r=[];return nX(!(t||n),!!t,new Map,r)(e),r},tu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?s2(i2(e,t)):structuredClone(e):(e,t)=>s2(i2(e,t));function rX(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 sX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rX,r=e.options.footnoteBackLabel||sX,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...tu(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const fh=function(e){if(e==null)return cX;if(typeof e=="function")return N0(e);if(typeof e=="object")return Array.isArray(e)?aX(e):oX(e);if(typeof e=="string")return lX(e);throw new Error("Expected function, string, or object as test")};function aX(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=E3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=hX(n(c,d)),p[0]===XE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==fX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` +`}),n}function a2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function o2(e,t){const n=mX(e,t),r=n.one(e,void 0),s=iX(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function xX(e,t){return e&&"run"in e?async function(n,r){const s=o2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return o2(n,{file:r,...e||t})}}function l2(e){if(e)throw e}var dm=Object.prototype.hasOwnProperty,w3=Object.prototype.toString,c2=Object.defineProperty,u2=Object.getOwnPropertyDescriptor,d2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):w3.call(t)==="[object Array]"},f2=function(t){if(!t||w3.call(t)!=="[object Object]")return!1;var n=dm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&dm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||dm.call(t,s)},h2=function(t,n){c2&&n.name==="__proto__"?c2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},p2=function(t,n){if(n==="__proto__")if(dm.call(t,n)){if(u2)return u2(t,n).value}else return;return t[n]},wX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Li={basename:kX,dirname:NX,extname:SX,join:TX,sep:"/"};function kX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ph(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function NX(e){if(ph(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 SX(e){ph(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 TX(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function ph(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IX={cwd:RX};function RX(){return"/"}function JE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OX(e){if(typeof e=="string")e=new URL(e);else if(!JE(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 LX(e)}function LX(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 g=r[h][1];ZE(g)&&ZE(p)&&(p=db(!0,g,p)),r[h]=[u,p,...m]}}}}const PX=new Qv().freeze();function mb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yb(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 g2(e){if(!ZE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yp(e){return BX(e)?e:new v3(e)}function BX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FX(e){return typeof e=="string"||UX(e)}function UX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $X="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b2=[],E2={allowDangerousHtml:!0},HX=/^(https?|ircs?|mailto|xmpp)$/i,zX=[{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 VX(e){const t=KX(e),n=YX(e);return WX(t.runSync(t.parse(n),n),e)}function KX(e){const t=e.rehypePlugins||b2,n=e.remarkPlugins||b2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...E2}:E2;return PX().use(Nq).use(n).use(xX,r).use(t)}function YX(e){const t=e.children||"",n=new v3;return typeof t=="string"&&(n.value=t),n}function WX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||GX;for(const d of zX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+$X+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),hh(e,u),lW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 lb)if(Object.hasOwn(lb,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=lb[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function GX(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||HX.test(e.slice(0,t))?e:""}function x2(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 qX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XX(e,t,n){const s=fh((n||{}).ignore||[]),i=QX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=x2(e,"(");let i=x2(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 _3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fl(n)||v0(n))&&(!t||n!==47)}k3.peek=xQ;function fQ(){this.buffer()}function hQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pQ(){this.buffer()}function mQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yQ(e){this.exit(e)}function bQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EQ(e){this.exit(e)}function xQ(){return"["}function k3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function wQ(){return{enter:{gfmFootnoteCallString:fQ,gfmFootnoteCall:hQ,gfmFootnoteDefinitionLabelString:pQ,gfmFootnoteDefinition:mQ},exit:{gfmFootnoteCallString:gQ,gfmFootnoteCall:yQ,gfmFootnoteDefinitionLabelString:bQ,gfmFootnoteDefinition:EQ}}}function vQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:k3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?N3:_Q))),u(),c}}function _Q(e,t,n){return t===0?e:N3(e,t,n)}function N3(e,t,n){return(n?"":" ")+e}const kQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];S3.peek=CQ;function NQ(){return{canContainEols:["delete"],enter:{strikethrough:TQ},exit:{strikethrough:AQ}}}function SQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kQ}],handlers:{delete:S3}}}function TQ(e){this.enter({type:"delete",children:[]},e)}function AQ(e){this.exit(e)}function S3(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 CQ(){return"~"}function IQ(e){return e.length}function RQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||IQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),MQ);return s(),a}function MQ(e,t,n){return">"+(n?"":" ")+e}function jQ(e,t){return _2(e,t.inConstruct,!0)&&!_2(e,t.notInConstruct,!1)}function _2(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 PQ(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 BQ(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 FQ(e,t,n,r){const s=BQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(PQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,UQ);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(DQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`,encode:["`"],...l.current()})),f()}return d+=l.move(` +`),i&&(d+=l.move(i+` +`)),d+=l.move(c),u(),d}function UQ(e,t,n){return(n?"":" ")+e}function Zv(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 $Q(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function HQ(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 Mf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dg(e,t,n){const r=eu(e),s=eu(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}}A3.peek=zQ;function A3(e,t,n,r){const s=HQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function zQ(e,t,n){return n.options.emphasis||"*"}function VQ(e,t){let n=!1;return hh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,XE}),!!((!e.depth||e.depth<3)&&Vv(e)&&(t.options.setext||n))}function KQ(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(VQ(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),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=Mf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}C3.peek=YQ;function C3(e){return e.value||""}function YQ(){return"<"}I3.peek=WQ;function I3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function WQ(){return"!"}R3.peek=GQ;function R3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function GQ(){return"!"}O3.peek=qQ;function O3(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))}M3.peek=XQ;function M3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(L3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function XQ(e,t,n){return L3(e,n)?"<":"["}j3.peek=QQ;function j3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function QQ(){return"["}function Jv(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 ZQ(e){const t=Jv(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 JQ(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 D3(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 eZ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?JQ(n):Jv(n);const l=e.ordered?a==="."?")":".":ZQ(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),D3(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 rZ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const sZ=fh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iZ(e,t,n,r){return(e.children.some(function(a){return sZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function aZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}P3.peek=oZ;function P3(e,t,n,r){const s=aZ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function oZ(e,t,n){return n.options.strong||"*"}function lZ(e,t,n,r){return n.safe(e.value,r)}function cZ(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 uZ(e,t,n){const r=(D3(n)+(n.options.ruleSpaces?" ":"")).repeat(cZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const B3={blockquote:LQ,break:k2,code:FQ,definition:$Q,emphasis:A3,hardBreak:k2,heading:KQ,html:C3,image:I3,imageReference:R3,inlineCode:O3,link:M3,linkReference:j3,list:eZ,listItem:nZ,paragraph:rZ,root:iZ,strong:P3,text:lZ,thematicBreak:uZ};function dZ(){return{enter:{table:fZ,tableData:N2,tableHeader:N2,tableRow:pZ},exit:{codeText:mZ,table:hZ,tableData:wb,tableHeader:wb,tableRow:wb}}}function fZ(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 hZ(e){this.exit(e),this.data.inTable=void 0}function pZ(e){this.enter({type:"tableRow",children:[]},e)}function wb(e){this.exit(e)}function N2(e){this.enter({type:"tableCell",children:[]},e)}function mZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gZ(e,t){return t==="|"?t:e}function yZ(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:l}};function a(p,m,g,w){return u(d(p,g,w),p.align)}function l(p,m,g,w){const y=f(p,g,w),b=u([y]);return b.slice(0,b.indexOf(` +`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return RQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const jZ={tokenize:zZ,partial:!0};function DZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:UZ,continuation:{tokenize:$Z},exit:HZ}},text:{91:{name:"gfmFootnoteCall",tokenize:FZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PZ,resolveTo:BZ}}}}function PZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=xi(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 BZ(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)},l=[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,...l),e}function FZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||un(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(xi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return un(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 UZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||un(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=xi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return un(m)||(l=!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),Mt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function $Z(e,t,n){return e.check(dh,t,e.attempt(jZ,t,n))}function HZ(e){e.exit("gfmFootnoteDefinition")}function zZ(e,t,n){const r=this;return Mt(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 VZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=eu(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class KZ{constructor(){this.map=[]}add(t,n,r){YZ(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 YZ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const L=r.events[j][1].type;if(L==="lineEnding"||L==="linePrefix")j--;else break}const F=j>-1?r.events[j][1].type:null,Y=F==="tableHead"||F==="tableRow"?N:c;return Y===N&&r.parser.lazy[r.now().line]?n(I):Y(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):it(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):Tt(I)?Mt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||un(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Tt(I)?Mt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return Tt(I)?Mt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||it(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return Tt(I)?Mt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||it(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||it(I)?(e.exit("tableRow"),t(I)):Tt(I)?Mt(e,T,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||un(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function XZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new KZ;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Wl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function T2(e,t,n,r,s){const i=[],a=Wl(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 Wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QZ={name:"tasklistCheck",tokenize:JZ};function ZZ(){return{text:{91:QZ}}}function JZ(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 un(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"),l):n(c)}function l(c){return it(c)?t(c):Tt(c)?e.check({tokenize:eJ},t,n)(c):n(c)}}function eJ(e,t,n){return Mt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function tJ(e){return t3([SZ(),DZ(),VZ(e),GZ(),ZZ()])}const nJ={};function rJ(e){const t=this,n=e||nJ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(tJ(n)),i.push(vZ()),a.push(_Z(n))}const A2=function(e,t,n){const r=fh(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 G3(e,t,n){return e.type==="element"?dJ(e,t,n):e.type==="text"?n.whitespace==="normal"?q3(e,n):fJ(e):[]}function dJ(e,t,n){const r=X3(e,n),s=e.children||[];let i=-1,a=[];if(cJ(e))return a;let l,c;for(tx(e)||O2(e)&&A2(t,e,O2)?c=` +`:lJ(e)?(l=2,c=2):W3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function EJ(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=bJ(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 Q3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function xJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function wJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vJ(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const _J=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_-]*/}}),kJ=["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"],NJ=["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"],SJ=[...kJ,...NJ],TJ=["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(),AJ=["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(),CJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IJ=["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 RJ(e){const t=e.regex,n=_J(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_-]*",l=[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:":("+AJ.join("|")+")"},{begin:":(:)?("+CJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+IJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:TJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+SJ.join("|")+")\\b"}]}}function OJ(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 LJ(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:"J3(e,t,n-1))}function jJ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+J3("(?:<"+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,L2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},L2,u]}}const M2="[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"],PJ=["true","false","null","undefined","NaN","Infinity"],eD=["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"],tD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],FJ=[].concat(nD,eD,tD);function rD(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:M2,keyword:DJ,literal:PJ,built_in:FJ,"variable.language":BJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...eD,...tD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...nD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function sD(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 ql="[0-9](_*[0-9])*",wp=`\\.(${ql})`,vp="[0-9a-fA-F](_*[0-9a-fA-F])*",UJ={className:"number",variants:[{begin:`(\\b(${ql})((${wp})|\\.)?|(${wp}))[eE][+-]?(${ql})[fFdD]?\\b`},{begin:`\\b(${ql})((${wp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wp})[fFdD]?\\b`},{begin:`\\b(${ql})[fFdD]\\b`},{begin:`\\b0[xX]((${vp})\\.?|(${vp})?\\.(${vp}))[pP][+-]?(${ql})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $J(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 l={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=UJ,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const HJ=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_-]*/}}),zJ=["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"],VJ=["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"],KJ=[...zJ,...VJ],YJ=["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(),iD=["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(),aD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),WJ=["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(),GJ=iD.concat(aD).sort().reverse();function qJ(e){const t=HJ(e),n=GJ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:YJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+WJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+KJ.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:":("+iD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+aD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function XJ(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 oD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 QJ(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_]*/,l={"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:l,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 ZJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 JJ(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},l={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,U)=>{U.data._beginMatch=L[1]||L[2]},"on:end":(L,U)=>{U.data._beginMatch!==L[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(L=>{const U=[];return L.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:b},k=L=>L.map(U=>U.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(j);const F=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,j,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",Y,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function eee(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 tee(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function cD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function nee(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ree(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 see(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function iee(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const aee=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_-]*/}}),oee=["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"],lee=["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"],cee=[...oee,...lee],uee=["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(),dee=["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(),fee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hee=["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 pee(e){const t=aee(e),n=fee,r=dee,s="@[a-z-]+",i="and or not only",l={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("+cee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hee.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,l,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:uee.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function mee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function gee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:T}={}){const S=T;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function uD(e){return e?typeof e=="string"?e:e.source:null}function rd(e){return tn("(?=",e,")")}function tn(...e){return e.map(n=>uD(n)).join("")}function yee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function zr(...e){return"("+(yee(e).capture?"":"?:")+e.map(r=>uD(r)).join("|")+")"}const n_=e=>tn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),bee=["Protocol","Type"].map(n_),j2=["init","self"].map(n_),Eee=["Any","Self"],vb=["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"],D2=["false","nil","true"],xee=["assignment","associativity","higherThan","left","lowerThan","none","right"],wee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],P2=["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"],dD=zr(/[/=\-+!*%<>&|^~?]/,/[\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]/),fD=zr(dD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),_b=tn(dD,fD,"*"),hD=zr(/[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]/),fg=zr(hD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ii=tn(hD,fg,"*"),_p=tn(/[A-Z]/,fg,"*"),vee=["attached","autoclosure",tn(/convention\(/,zr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",tn(/objc\(/,Ii,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_ee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function kee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,zr(...bee,...j2)],className:{2:"keyword"}},i={match:tn(/\./,zr(...vb)),relevance:0},a=vb.filter(Re=>typeof Re=="string").concat(["_|0"]),l=vb.filter(Re=>typeof Re!="string").concat(Eee).map(n_),c={variants:[{className:"keyword",match:zr(...l,...j2)}]},u={$pattern:zr(/\b\w+/,/#\w+/),keyword:a.concat(wee),literal:D2},d=[s,i,c],f={match:tn(/\./,zr(...P2)),relevance:0},h={className:"built_in",match:tn(/\b/,zr(...P2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:_b},{match:`\\.(\\.|${fD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Re="")=>({className:"subst",variants:[{match:tn(/\\/,Re,/[0\\tnr"']/)},{match:tn(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Re="")=>({className:"subst",match:tn(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Re="")=>({className:"subst",label:"interpol",begin:tn(/\\/,Re,/\(/),end:/\)/}),T=(Re="")=>({begin:tn(Re,/"""/),end:tn(/"""/,Re),contains:[_(Re),k(Re),N(Re)]}),S=(Re="")=>({begin:tn(Re,/"/),end:tn(/"/,Re),contains:[_(Re),N(Re)]}),R={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=Re=>{const Ye=tn(Re,/\//),Le=tn(/\//,Re);return{begin:Ye,end:Le,contains:[...I,{scope:"comment",begin:`#(?!.*${Le})`,end:/$/}]}},Y={scope:"regexp",variants:[F("###"),F("##"),F("#"),j]},L={match:tn(/`/,Ii,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${fg}+`},M=[L,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_ee,contains:[...w,x,R]}]}},D={scope:"keyword",match:tn(/@/,zr(...vee),rd(zr(/\(/,/\s+/)))},A={scope:"meta",match:tn(/@/,Ii)},H=[O,D,A],W={match:rd(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:tn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,fg,"+")},{className:"type",match:_p,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:tn(/\s+&\s+/,rd(_p)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...H,m,W]};W.contains.push(P);const te={match:tn(Ii,/\s*:/),keywords:"_|0",relevance:0},X={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",te,...r,Y,...d,...p,...w,x,R,...M,...H,W]},ne={begin://,keywords:"repeat each",contains:[...r,W]},ce={begin:zr(rd(tn(Ii,/\s*:/)),rd(tn(Ii,/\s+/,Ii,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ii}]},J={begin:/\(/,end:/\)/,keywords:u,contains:[ce,...r,...d,...w,x,R,...H,W,X],endsParent:!0,illegal:/["']/},fe={match:[/(func|macro)/,/\s+/,zr(L.match,Ii,_b)],className:{1:"keyword",3:"title.function"},contains:[ne,J,t],illegal:[/\[/,/%/]},ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,J,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,_b],className:{1:"keyword",3:"title"}},ge={begin:[/precedencegroup/,/\s+/,_p],className:{1:"keyword",3:"title"},contains:[W],keywords:[...xee,...D2],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},we={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ii,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:_p},...d],relevance:0}]};for(const Re of R.variants){const Ye=Re.contains.find(bt=>bt.label==="interpol");Ye.keywords=u;const Le=[...d,...p,...w,x,R,...M];Ye.contains=[...Le,{begin:/\(/,end:/\)/,contains:["self",...Le]}]}return{name:"Swift",keywords:u,contains:[...r,fe,ee,xe,we,Te,Ee,ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,x,R,...M,...H,W,X]}}const hg="[A-Za-z$_][0-9A-Za-z$_]*",pD=["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"],mD=["true","false","null","undefined","NaN","Infinity"],gD=["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"],yD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ED=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xD=[].concat(bD,gD,yD);function Nee(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:hg,keyword:pD,literal:mD,built_in:xD,"variable.language":ED},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...gD,...yD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...bD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function wD(e){const t=e.regex,n=Nee(e),r=hg,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:hg,keyword:pD.concat(c),literal:mD,built_in:xD.concat(s),"variable.language":ED},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function See(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 Tee(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},l={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,l]}}function Aee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 vD(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Cee={arduino:EJ,bash:Q3,c:xJ,cpp:wJ,csharp:vJ,css:RJ,diff:OJ,go:LJ,graphql:MJ,ini:Z3,java:jJ,javascript:rD,json:sD,kotlin:$J,less:qJ,lua:XJ,makefile:oD,markdown:lD,objectivec:QJ,perl:ZJ,php:JJ,"php-template":eee,plaintext:tee,python:cD,"python-repl":nee,r:ree,ruby:see,rust:iee,scss:pee,shell:mee,sql:gee,swift:kee,typescript:wD,vbnet:See,wasm:Tee,xml:Aee,yaml:vD};function _D(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)&&_D(n)}),e}let B2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function kD(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Xa(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 Iee="",F2=e=>!!e.scope,Ree=(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 Oee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=kD(t)}openNode(t){if(!F2(t))return;const n=Ree(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){F2(t)&&(this.buffer+=Iee)}value(){return this.buffer}span(t){this.buffer+=``}}const U2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class r_{constructor(){this.rootNode=U2(),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=U2({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=>{r_._collapse(n)}))}}class Lee extends r_{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 Oee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function jf(e){return e?typeof e=="string"?e:e.source:null}function ND(e){return kl("(?=",e,")")}function Mee(e){return kl("(?:",e,")*")}function jee(e){return kl("(?:",e,")?")}function kl(...e){return e.map(n=>jf(n)).join("")}function Dee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function s_(...e){return"("+(Dee(e).capture?"":"?:")+e.map(r=>jf(r)).join("|")+")"}function SD(e){return new RegExp(e.toString()+"|").exec("").length-1}function Pee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Bee=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function i_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=jf(r),a="";for(;i.length>0;){const l=Bee.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const Fee=/\b\B/,TD="[a-zA-Z]\\w*",a_="[a-zA-Z_]\\w*",AD="\\b\\d+(\\.\\d+)?",CD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ID="\\b(0b[01]+)",Uee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$ee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=kl(t,/.*\b/,e.binary,/\b.*/)),Xa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Df={begin:"\\\\[\\s\\S]",relevance:0},Hee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Df]},zee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Df]},Vee={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/},S0=function(e,t,n={}){const r=Xa({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=s_("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:kl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Kee=S0("//","$"),Yee=S0("/\\*","\\*/"),Wee=S0("#","$"),Gee={scope:"number",begin:AD,relevance:0},qee={scope:"number",begin:CD,relevance:0},Xee={scope:"number",begin:ID,relevance:0},Qee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Df,{begin:/\[/,end:/\]/,relevance:0,contains:[Df]}]},Zee={scope:"title",begin:TD,relevance:0},Jee={scope:"title",begin:a_,relevance:0},ete={begin:"\\.\\s*"+a_,relevance:0},tte=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 kp=Object.freeze({__proto__:null,APOS_STRING_MODE:Hee,BACKSLASH_ESCAPE:Df,BINARY_NUMBER_MODE:Xee,BINARY_NUMBER_RE:ID,COMMENT:S0,C_BLOCK_COMMENT_MODE:Yee,C_LINE_COMMENT_MODE:Kee,C_NUMBER_MODE:qee,C_NUMBER_RE:CD,END_SAME_AS_BEGIN:tte,HASH_COMMENT_MODE:Wee,IDENT_RE:TD,MATCH_NOTHING_RE:Fee,METHOD_GUARD:ete,NUMBER_MODE:Gee,NUMBER_RE:AD,PHRASAL_WORDS_MODE:Vee,QUOTE_STRING_MODE:zee,REGEXP_MODE:Qee,RE_STARTERS_RE:Uee,SHEBANG:$ee,TITLE_MODE:Zee,UNDERSCORE_IDENT_RE:a_,UNDERSCORE_TITLE_MODE:Jee});function nte(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function rte(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ste(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=nte,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ite(e,t){Array.isArray(e.illegal)&&(e.illegal=s_(...e.illegal))}function ate(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 ote(e,t){e.relevance===void 0&&(e.relevance=1)}const lte=(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=kl(n.beforeMatch,ND(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},cte=["of","and","for","in","not","or","if","then","parent","list","value"],ute="keyword";function RD(e,t,n=ute){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,RD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,dte(c[0],c[1])]})}}function dte(e,t){return t?Number(t):fte(e)?0:1}function fte(e){return cte.includes(e.toLowerCase())}const $2={},el=e=>{console.error(e)},H2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fl=(e,t)=>{$2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$2[`${e}/${t}`]=!0)},pg=new Error;function OD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=SD(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function hte(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw el("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pg;if(typeof e.beginScope!="object"||e.beginScope===null)throw el("beginScope must be object"),pg;OD(e,e.begin,{key:"beginScope"}),e.begin=i_(e.begin,{joinWith:""})}}function pte(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw el("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pg;if(typeof e.endScope!="object"||e.endScope===null)throw el("endScope must be object"),pg;OD(e,e.end,{key:"endScope"}),e.end=i_(e.end,{joinWith:""})}}function mte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function gte(e){mte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),hte(e),pte(e)}function yte(e){function t(a,l){return new RegExp(jf(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=SD(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(i_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[rte,ate,gte,lte].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[ste,ite,ote].forEach(d=>d(a,l)),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=RD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=jf(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return bte(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Xa(e.classNameAliases||{}),i(e)}function LD(e){return e?e.endsWithParent||LD(e.starts):!1}function bte(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Xa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:LD(e)?Xa(e,{starts:e.starts?Xa(e.starts):null}):Object.isFrozen(e)?Xa(e):e}var Ete="11.11.1";class xte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const kb=kD,z2=Xa,V2=Symbol("nomatch"),wte=7,MD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lee};function c(C){return l.noHighlightRe.test(C)}function u(C){let M=C.className+" ";M+=C.parentNode?C.parentNode.className:"";const O=l.languageDetectRe.exec(M);if(O){const D=S(O[1]);return D||(H2(i.replace("{}",O[1])),H2("Falling back to no-highlight mode for this block.",C)),D?O[1]:"no-highlight"}return M.split(/\s+/).find(D=>c(D)||S(D))}function d(C,M,O){let D="",A="";typeof M=="object"?(D=C,O=M.ignoreIllegals,A=M.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`),A=C,D=M),O===void 0&&(O=!0);const H={code:D,language:A};L("before:highlight",H);const W=H.result?H.result:f(H.language,H.code,O);return W.code=H.code,L("after:highlight",W),W}function f(C,M,O,D){const A=Object.create(null);function H(G,Z){return G.keywords[Z]}function W(){if(!Le.keywords){Ze.addText(ze);return}let G=0;Le.keywordPatternRe.lastIndex=0;let Z=Le.keywordPatternRe.exec(ze),he="";for(;Z;){he+=ze.substring(G,Z.index);const De=Te.case_insensitive?Z[0].toLowerCase():Z[0],qe=H(Le,De);if(qe){const[nt,Vt]=qe;if(Ze.addText(he),he="",A[De]=(A[De]||0)+1,A[De]<=wte&&(le+=Vt),nt.startsWith("_"))he+=Z[0];else{const Et=Te.classNameAliases[nt]||nt;X(Z[0],Et)}}else he+=Z[0];G=Le.keywordPatternRe.lastIndex,Z=Le.keywordPatternRe.exec(ze)}he+=ze.substring(G),Ze.addText(he)}function P(){if(ze==="")return;let G=null;if(typeof Le.subLanguage=="string"){if(!t[Le.subLanguage]){Ze.addText(ze);return}G=f(Le.subLanguage,ze,!0,bt[Le.subLanguage]),bt[Le.subLanguage]=G._top}else G=p(ze,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(le+=G.relevance),Ze.__addSublanguage(G._emitter,G.language)}function te(){Le.subLanguage!=null?P():W(),ze=""}function X(G,Z){G!==""&&(Ze.startScope(Z),Ze.addText(G),Ze.endScope())}function ne(G,Z){let he=1;const De=Z.length-1;for(;he<=De;){if(!G._emit[he]){he++;continue}const qe=Te.classNameAliases[G[he]]||G[he],nt=Z[he];qe?X(nt,qe):(ze=nt,W(),ze=""),he++}}function ce(G,Z){return G.scope&&typeof G.scope=="string"&&Ze.openNode(Te.classNameAliases[G.scope]||G.scope),G.beginScope&&(G.beginScope._wrap?(X(ze,Te.classNameAliases[G.beginScope._wrap]||G.beginScope._wrap),ze=""):G.beginScope._multi&&(ne(G.beginScope,Z),ze="")),Le=Object.create(G,{parent:{value:Le}}),Le}function J(G,Z,he){let De=Pee(G.endRe,he);if(De){if(G["on:end"]){const qe=new B2(G);G["on:end"](Z,qe),qe.isMatchIgnored&&(De=!1)}if(De){for(;G.endsParent&&G.parent;)G=G.parent;return G}}if(G.endsWithParent)return J(G.parent,Z,he)}function fe(G){return Le.matcher.regexIndex===0?(ze+=G[0],1):(ht=!0,0)}function ee(G){const Z=G[0],he=G.rule,De=new B2(he),qe=[he.__beforeBegin,he["on:begin"]];for(const nt of qe)if(nt&&(nt(G,De),De.isMatchIgnored))return fe(Z);return he.skip?ze+=Z:(he.excludeBegin&&(ze+=Z),te(),!he.returnBegin&&!he.excludeBegin&&(ze=Z)),ce(he,G),he.returnBegin?0:Z.length}function Ee(G){const Z=G[0],he=M.substring(G.index),De=J(Le,G,he);if(!De)return V2;const qe=Le;Le.endScope&&Le.endScope._wrap?(te(),X(Z,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(te(),ne(Le.endScope,G)):qe.skip?ze+=Z:(qe.returnEnd||qe.excludeEnd||(ze+=Z),te(),qe.excludeEnd&&(ze=Z));do Le.scope&&Ze.closeNode(),!Le.skip&&!Le.subLanguage&&(le+=Le.relevance),Le=Le.parent;while(Le!==De.parent);return De.starts&&ce(De.starts,G),qe.returnEnd?0:Z.length}function ge(){const G=[];for(let Z=Le;Z!==Te;Z=Z.parent)Z.scope&&G.unshift(Z.scope);G.forEach(Z=>Ze.openNode(Z))}let xe={};function we(G,Z){const he=Z&&Z[0];if(ze+=G,he==null)return te(),0;if(xe.type==="begin"&&Z.type==="end"&&xe.index===Z.index&&he===""){if(ze+=M.slice(Z.index,Z.index+1),!s){const De=new Error(`0 width match regex (${C})`);throw De.languageName=C,De.badRule=xe.rule,De}return 1}if(xe=Z,Z.type==="begin")return ee(Z);if(Z.type==="illegal"&&!O){const De=new Error('Illegal lexeme "'+he+'" for mode "'+(Le.scope||"")+'"');throw De.mode=Le,De}else if(Z.type==="end"){const De=Ee(Z);if(De!==V2)return De}if(Z.type==="illegal"&&he==="")return ze+=` +`,1;if(ct>1e5&&ct>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=he,he.length}const Te=S(C);if(!Te)throw el(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Re=yte(Te);let Ye="",Le=D||Re;const bt={},Ze=new l.__emitter(l);ge();let ze="",le=0,ve=0,ct=0,ht=!1;try{if(Te.__emitTokens)Te.__emitTokens(M,Ze);else{for(Le.matcher.considerAll();;){ct++,ht?ht=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=ve;const G=Le.matcher.exec(M);if(!G)break;const Z=M.substring(ve,G.index),he=we(Z,G);ve=G.index+he}we(M.substring(ve))}return Ze.finalize(),Ye=Ze.toHTML(),{language:C,value:Ye,relevance:le,illegal:!1,_emitter:Ze,_top:Le}}catch(G){if(G.message&&G.message.includes("Illegal"))return{language:C,value:kb(M),illegal:!0,relevance:0,_illegalBy:{message:G.message,index:ve,context:M.slice(ve-100,ve+100),mode:G.mode,resultSoFar:Ye},_emitter:Ze};if(s)return{language:C,value:kb(M),illegal:!1,relevance:0,errorRaised:G,_emitter:Ze,_top:Le};throw G}}function h(C){const M={value:kb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return M._emitter.addText(C),M}function p(C,M){M=M||l.languages||Object.keys(t);const O=h(C),D=M.filter(S).filter(I).map(te=>f(te,C,!1));D.unshift(O);const A=D.sort((te,X)=>{if(te.relevance!==X.relevance)return X.relevance-te.relevance;if(te.language&&X.language){if(S(te.language).supersetOf===X.language)return 1;if(S(X.language).supersetOf===te.language)return-1}return 0}),[H,W]=A,P=H;return P.secondBest=W,P}function m(C,M,O){const D=M&&n[M]||O;C.classList.add("hljs"),C.classList.add(`language-${D}`)}function g(C){let M=null;const O=u(C);if(c(O))return;if(L("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new xte("One of your code blocks includes unescaped HTML.",C.innerHTML);M=C;const D=M.textContent,A=O?d(D,{language:O,ignoreIllegals:!0}):p(D);C.innerHTML=A.value,C.dataset.highlighted="yes",m(C,O,A.language),C.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(C.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),L("after:highlightElement",{el:C,result:A,text:D})}function w(C){l=z2(l,C)}const y=()=>{_(),Fl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Fl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,M){let O=null;try{O=M(e)}catch(D){if(el("Language definition for '{}' could not be registered.".replace("{}",C)),s)el(D);else throw D;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=M.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function N(C){delete t[C];for(const M of Object.keys(n))n[M]===C&&delete n[M]}function T(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:M}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=M})}function I(C){const M=S(C);return M&&!M.disableAutodetect}function j(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=M=>{C["before:highlightBlock"](Object.assign({block:M.el},M))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=M=>{C["after:highlightBlock"](Object.assign({block:M.el},M))})}function F(C){j(C),r.push(C)}function Y(C){const M=r.indexOf(C);M!==-1&&r.splice(M,1)}function L(C,M){const O=C;r.forEach(function(D){D[O]&&D[O](M)})}function U(C){return Fl("10.7.0","highlightBlock will be removed entirely in v12.0"),Fl("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:U,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:T,getLanguage:S,registerAliases:R,autoDetection:I,inherit:z2,addPlugin:F,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Ete,e.regex={concat:kl,lookahead:ND,either:s_,optional:jee,anyNumberOfTimes:Mee};for(const C in kp)typeof kp[C]=="object"&&_D(kp[C]);return Object.assign(e,kp),e},nu=MD({});nu.newInstance=()=>MD({});var vte=nu;nu.HighlightJS=nu;nu.default=nu;const ls=Xf(vte),K2={},_te="hljs-";function kte(e){const t=ls.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||K2,h=typeof f.prefix=="string"?f.prefix:_te;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Nte,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||K2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class Nte{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,l){return l?a+"_".repeat(l):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 Ste={};function Y2(e){const t=e||Ste,n=t.aliases,r=t.detect||!1,s=t.languages||Cee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=kte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){hh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=Tte(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=uJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Tte(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 l=n[a];if(l===void 0){const c=q2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 Jte(e){return e>=56320&&e<=57343}function ene(e,t){return(e-55296)*1024+9216+t}function UD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $D(e){return e>=64976&&e<=65007||Zte.has(e)}var de;(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"})(de||(de={}));const tne=65536;class nne{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=tne,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(Jte(n))return this.pos++,this._addGap(),ene(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(de.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,FD(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){UD(t)?this._err(de.controlCharacterInInputStream):$D(t)&&this._err(de.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 rne=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))),sne=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 ine(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=sne.get(e))!==null&&t!==void 0?t:e}var Er;(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"})(Er||(Er={}));const ane=32;var Qa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qa||(Qa={}));function rx(e){return e>=Er.ZERO&&e<=Er.NINE}function one(e){return e>=Er.UPPER_A&&e<=Er.UPPER_F||e>=Er.LOWER_A&&e<=Er.LOWER_F}function lne(e){return e>=Er.UPPER_A&&e<=Er.UPPER_Z||e>=Er.LOWER_A&&e<=Er.LOWER_Z||rx(e)}function cne(e){return e===Er.EQUALS||lne(e)}var yr;(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"})(yr||(yr={}));var ia;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ia||(ia={}));class une{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=yr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ia.Strict}startEntity(t){this.decodeMode=t,this.state=yr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case yr.EntityStart:return t.charCodeAt(n)===Er.NUM?(this.state=yr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=yr.NamedEntity,this.stateNamedEntity(t,n));case yr.NumericStart:return this.stateNumericStart(t,n);case yr.NumericDecimal:return this.stateNumericDecimal(t,n);case yr.NumericHex:return this.stateNumericHex(t,n);case yr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ane)===Er.LOWER_X?(this.state=yr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=yr.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===Er.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ia.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]&Qa.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]&~Qa.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case yr.NamedEntity:return this.result!==0&&(this.decodeMode!==ia.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yr.NumericDecimal:return this.emitNumericEntity(0,2);case yr.NumericHex:return this.emitNumericEntity(0,3);case yr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yr.EntityStart:return 0}}}function dne(e,t,n,r){const s=(t&Qa.BRANCH_LENGTH)>>7,i=t&Qa.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=c-1;else return e[c+s]}return-1}var ke;(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/"})(ke||(ke={}));var tl;(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"})(tl||(tl={}));var Ps;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ps||(Ps={}));var ie;(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"})(ie||(ie={}));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 fne=new Map([[ie.A,v.A],[ie.ADDRESS,v.ADDRESS],[ie.ANNOTATION_XML,v.ANNOTATION_XML],[ie.APPLET,v.APPLET],[ie.AREA,v.AREA],[ie.ARTICLE,v.ARTICLE],[ie.ASIDE,v.ASIDE],[ie.B,v.B],[ie.BASE,v.BASE],[ie.BASEFONT,v.BASEFONT],[ie.BGSOUND,v.BGSOUND],[ie.BIG,v.BIG],[ie.BLOCKQUOTE,v.BLOCKQUOTE],[ie.BODY,v.BODY],[ie.BR,v.BR],[ie.BUTTON,v.BUTTON],[ie.CAPTION,v.CAPTION],[ie.CENTER,v.CENTER],[ie.CODE,v.CODE],[ie.COL,v.COL],[ie.COLGROUP,v.COLGROUP],[ie.DD,v.DD],[ie.DESC,v.DESC],[ie.DETAILS,v.DETAILS],[ie.DIALOG,v.DIALOG],[ie.DIR,v.DIR],[ie.DIV,v.DIV],[ie.DL,v.DL],[ie.DT,v.DT],[ie.EM,v.EM],[ie.EMBED,v.EMBED],[ie.FIELDSET,v.FIELDSET],[ie.FIGCAPTION,v.FIGCAPTION],[ie.FIGURE,v.FIGURE],[ie.FONT,v.FONT],[ie.FOOTER,v.FOOTER],[ie.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ie.FORM,v.FORM],[ie.FRAME,v.FRAME],[ie.FRAMESET,v.FRAMESET],[ie.H1,v.H1],[ie.H2,v.H2],[ie.H3,v.H3],[ie.H4,v.H4],[ie.H5,v.H5],[ie.H6,v.H6],[ie.HEAD,v.HEAD],[ie.HEADER,v.HEADER],[ie.HGROUP,v.HGROUP],[ie.HR,v.HR],[ie.HTML,v.HTML],[ie.I,v.I],[ie.IMG,v.IMG],[ie.IMAGE,v.IMAGE],[ie.INPUT,v.INPUT],[ie.IFRAME,v.IFRAME],[ie.KEYGEN,v.KEYGEN],[ie.LABEL,v.LABEL],[ie.LI,v.LI],[ie.LINK,v.LINK],[ie.LISTING,v.LISTING],[ie.MAIN,v.MAIN],[ie.MALIGNMARK,v.MALIGNMARK],[ie.MARQUEE,v.MARQUEE],[ie.MATH,v.MATH],[ie.MENU,v.MENU],[ie.META,v.META],[ie.MGLYPH,v.MGLYPH],[ie.MI,v.MI],[ie.MO,v.MO],[ie.MN,v.MN],[ie.MS,v.MS],[ie.MTEXT,v.MTEXT],[ie.NAV,v.NAV],[ie.NOBR,v.NOBR],[ie.NOFRAMES,v.NOFRAMES],[ie.NOEMBED,v.NOEMBED],[ie.NOSCRIPT,v.NOSCRIPT],[ie.OBJECT,v.OBJECT],[ie.OL,v.OL],[ie.OPTGROUP,v.OPTGROUP],[ie.OPTION,v.OPTION],[ie.P,v.P],[ie.PARAM,v.PARAM],[ie.PLAINTEXT,v.PLAINTEXT],[ie.PRE,v.PRE],[ie.RB,v.RB],[ie.RP,v.RP],[ie.RT,v.RT],[ie.RTC,v.RTC],[ie.RUBY,v.RUBY],[ie.S,v.S],[ie.SCRIPT,v.SCRIPT],[ie.SEARCH,v.SEARCH],[ie.SECTION,v.SECTION],[ie.SELECT,v.SELECT],[ie.SOURCE,v.SOURCE],[ie.SMALL,v.SMALL],[ie.SPAN,v.SPAN],[ie.STRIKE,v.STRIKE],[ie.STRONG,v.STRONG],[ie.STYLE,v.STYLE],[ie.SUB,v.SUB],[ie.SUMMARY,v.SUMMARY],[ie.SUP,v.SUP],[ie.TABLE,v.TABLE],[ie.TBODY,v.TBODY],[ie.TEMPLATE,v.TEMPLATE],[ie.TEXTAREA,v.TEXTAREA],[ie.TFOOT,v.TFOOT],[ie.TD,v.TD],[ie.TH,v.TH],[ie.THEAD,v.THEAD],[ie.TITLE,v.TITLE],[ie.TR,v.TR],[ie.TRACK,v.TRACK],[ie.TT,v.TT],[ie.U,v.U],[ie.UL,v.UL],[ie.SVG,v.SVG],[ie.VAR,v.VAR],[ie.WBR,v.WBR],[ie.XMP,v.XMP]]);function Su(e){var t;return(t=fne.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ie=v,hne={[ke.HTML]:new Set([Ie.ADDRESS,Ie.APPLET,Ie.AREA,Ie.ARTICLE,Ie.ASIDE,Ie.BASE,Ie.BASEFONT,Ie.BGSOUND,Ie.BLOCKQUOTE,Ie.BODY,Ie.BR,Ie.BUTTON,Ie.CAPTION,Ie.CENTER,Ie.COL,Ie.COLGROUP,Ie.DD,Ie.DETAILS,Ie.DIR,Ie.DIV,Ie.DL,Ie.DT,Ie.EMBED,Ie.FIELDSET,Ie.FIGCAPTION,Ie.FIGURE,Ie.FOOTER,Ie.FORM,Ie.FRAME,Ie.FRAMESET,Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6,Ie.HEAD,Ie.HEADER,Ie.HGROUP,Ie.HR,Ie.HTML,Ie.IFRAME,Ie.IMG,Ie.INPUT,Ie.LI,Ie.LINK,Ie.LISTING,Ie.MAIN,Ie.MARQUEE,Ie.MENU,Ie.META,Ie.NAV,Ie.NOEMBED,Ie.NOFRAMES,Ie.NOSCRIPT,Ie.OBJECT,Ie.OL,Ie.P,Ie.PARAM,Ie.PLAINTEXT,Ie.PRE,Ie.SCRIPT,Ie.SECTION,Ie.SELECT,Ie.SOURCE,Ie.STYLE,Ie.SUMMARY,Ie.TABLE,Ie.TBODY,Ie.TD,Ie.TEMPLATE,Ie.TEXTAREA,Ie.TFOOT,Ie.TH,Ie.THEAD,Ie.TITLE,Ie.TR,Ie.TRACK,Ie.UL,Ie.WBR,Ie.XMP]),[ke.MATHML]:new Set([Ie.MI,Ie.MO,Ie.MN,Ie.MS,Ie.MTEXT,Ie.ANNOTATION_XML]),[ke.SVG]:new Set([Ie.TITLE,Ie.FOREIGN_OBJECT,Ie.DESC]),[ke.XLINK]:new Set,[ke.XML]:new Set,[ke.XMLNS]:new Set},sx=new Set([Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6]);ie.STYLE,ie.SCRIPT,ie.XMP,ie.IFRAME,ie.NOEMBED,ie.NOFRAMES,ie.PLAINTEXT;var K;(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"})(K||(K={}));const Qn={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function pne(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function vd(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function mne(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function Ba(e){return mne(e)||vd(e)}function Q2(e){return Ba(e)||pne(e)}function Np(e){return e+32}function zD(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function Z2(e){return zD(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function gne(e){return e===$.NULL?de.nullCharacterReference:e>1114111?de.characterReferenceOutsideUnicodeRange:FD(e)?de.surrogateCharacterReference:$D(e)?de.noncharacterCharacterReference:UD(e)||e===$.CARRIAGE_RETURN?de.controlCharacterReference:null}class yne{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=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new nne(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new une(rne,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(de.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(de.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=gne(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(de.endTagWithAttributes),t.selfClosing&&this._err(de.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 St.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case St.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case St.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:St.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=zD(t)?St.WHITESPACE_CHARACTER:t===$.NULL?St.NULL_CHARACTER:St.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(St.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ia.Attribute:ia.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case K.DATA:{this._stateData(t);break}case K.RCDATA:{this._stateRcdata(t);break}case K.RAWTEXT:{this._stateRawtext(t);break}case K.SCRIPT_DATA:{this._stateScriptData(t);break}case K.PLAINTEXT:{this._statePlaintext(t);break}case K.TAG_OPEN:{this._stateTagOpen(t);break}case K.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case K.TAG_NAME:{this._stateTagName(t);break}case K.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case K.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case K.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case K.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case K.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case K.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case K.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case K.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case K.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case K.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case K.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case K.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case K.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case K.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case K.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case K.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case K.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case K.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case K.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case K.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case K.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case K.BOGUS_COMMENT:{this._stateBogusComment(t);break}case K.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case K.COMMENT_START:{this._stateCommentStart(t);break}case K.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case K.COMMENT:{this._stateComment(t);break}case K.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case K.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case K.COMMENT_END:{this._stateCommentEnd(t);break}case K.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case K.DOCTYPE:{this._stateDoctype(t);break}case K.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case K.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case K.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case K.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case K.CDATA_SECTION:{this._stateCdataSection(t);break}case K.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case K.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case K.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case K.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(de.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=K.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ba(t))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=K.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=K.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(de.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(de.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=K.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ba(t))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(de.missingEndTagName),this.state=K.DATA;break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ba(t)?(this._emitChars("<"),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ba(t)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(es.SCRIPT,!1)&&Z2(this.preprocessor.peek(es.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])!==ke.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(vne,ke.HTML)}clearBackToTableBodyContext(){this.clearBackTo(wne,ke.HTML)}clearBackToTableRowContext(){this.clearBackTo(xne,ke.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 ke.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ke.SVG:{if(tA.has(s))return!1;break}case ke.MATHML:{if(eA.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,mg)}hasInListItemScope(t){return this.hasInDynamicScope(t,bne)}hasInButtonScope(t){return this.hasInDynamicScope(t,Ene)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ke.HTML:{if(sx.has(n))return!0;if(mg.has(n))return!1;break}case ke.SVG:{if(tA.has(n))return!1;break}case ke.MATHML:{if(eA.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.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])===ke.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])===ke.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&&VD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&J2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&J2.has(this.currentTagId);)this.pop()}}const Nb=3;var Mi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Mi||(Mi={}));const nA={type:Mi.Marker};class Nne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=Nb&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(nA)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Mi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Mi.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(nA);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Mi.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Mi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Mi.Element&&n.element===t)}}const Fa={createDocument(){return{nodeName:"#document",mode:Ps.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};Fa.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(Fa.isTextNode(n)){n.value+=t;return}}Fa.appendChild(e,Fa.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Fa.isTextNode(r)?r.value+=t:Fa.insertBefore(e,Fa.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Rne(e){return e.name===KD&&e.publicId===null&&(e.systemId===null||e.systemId===Sne)}function One(e){if(e.name!==KD)return Ps.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Tne)return Ps.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Cne.has(n))return Ps.QUIRKS;let r=t===null?Ane:YD;if(rA(n,r))return Ps.QUIRKS;if(r=t===null?WD:Ine,rA(n,r))return Ps.LIMITED_QUIRKS}return Ps.NO_QUIRKS}const sA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Lne="definitionurl",Mne="definitionURL",jne=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])),Dne=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ke.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ke.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ke.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ke.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ke.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ke.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ke.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ke.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ke.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ke.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ke.XMLNS}]]),Pne=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])),Bne=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 Fne(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===tl.COLOR||r===tl.SIZE||r===tl.FACE)||Bne.has(t)}function GD(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)===ke.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ke.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=Qn.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)===ie.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ke.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Qn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Qn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Qn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Qn.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(l=>this.treeAdapter.isDocumentTypeNode(l));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,ke.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ke.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(ie.HTML,ke.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===St.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)===ie.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ke.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ke.HTML)}_processToken(t){switch(t.type){case St.CHARACTER:{this.onCharacter(t);break}case St.NULL_CHARACTER:{this.onNullCharacter(t);break}case St.COMMENT:{this.onComment(t);break}case St.DOCTYPE:{this.onDoctype(t);break}case St.START_TAG:{this._processStartTag(t);break}case St.END_TAG:{this.onEndTag(t);break}case St.EOF:{this.onEof(t);break}case St.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return zne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Mi.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=Q.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=Q.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Q.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Q.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Q.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Q.IN_TABLE;return}case v.BODY:{this.insertionMode=Q.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Q.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?Q.AFTER_HEAD:Q.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Q.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Q.IN_HEAD;return}break}}this.insertionMode=Q.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=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(t){return XD.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)===ke.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 hne[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_se(this,t);return}switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:{ZD(this,t);break}case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{sP(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){vse(this,t);return}switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.TEXT:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ix(this,t);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{ix(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.AFTER_BODY:{ere(this,t);break}case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{tre(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:{nre(this,t);break}case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:{this._err(t,de.misplacedDoctype);break}case Q.IN_TABLE_TEXT:{id(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,de.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?kse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{rre(this,t);break}case Q.BEFORE_HEAD:{ire(this,t);break}case Q.IN_HEAD:{_i(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{lre(this,t);break}case Q.AFTER_HEAD:{ure(this,t);break}case Q.IN_BODY:{Fr(this,t);break}case Q.IN_TABLE:{ru(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_CAPTION:{ase(this,t);break}case Q.IN_COLUMN_GROUP:{f_(this,t);break}case Q.IN_TABLE_BODY:{C0(this,t);break}case Q.IN_ROW:{I0(this,t);break}case Q.IN_CELL:{cse(this,t);break}case Q.IN_SELECT:{oP(this,t);break}case Q.IN_SELECT_IN_TABLE:{dse(this,t);break}case Q.IN_TEMPLATE:{hse(this,t);break}case Q.AFTER_BODY:{mse(this,t);break}case Q.IN_FRAMESET:{gse(this,t);break}case Q.AFTER_FRAMESET:{bse(this,t);break}case Q.AFTER_AFTER_BODY:{xse(this,t);break}case Q.AFTER_AFTER_FRAMESET:{wse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Nse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{sre(this,t);break}case Q.BEFORE_HEAD:{are(this,t);break}case Q.IN_HEAD:{ore(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{cre(this,t);break}case Q.AFTER_HEAD:{dre(this,t);break}case Q.IN_BODY:{A0(this,t);break}case Q.TEXT:{Xre(this,t);break}case Q.IN_TABLE:{Pf(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_CAPTION:{ose(this,t);break}case Q.IN_COLUMN_GROUP:{lse(this,t);break}case Q.IN_TABLE_BODY:{ax(this,t);break}case Q.IN_ROW:{aP(this,t);break}case Q.IN_CELL:{use(this,t);break}case Q.IN_SELECT:{lP(this,t);break}case Q.IN_SELECT_IN_TABLE:{fse(this,t);break}case Q.IN_TEMPLATE:{pse(this,t);break}case Q.AFTER_BODY:{uP(this,t);break}case Q.IN_FRAMESET:{yse(this,t);break}case Q.AFTER_FRAMESET:{Ese(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onEof(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{nP(this,t);break}case Q.TEXT:{Qre(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_TEMPLATE:{cP(this,t);break}case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{d_(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 Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{this._insertCharacters(t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{QD(this,t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{rP(this,t);break}}}};function Gne(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):tP(e,t),n}function qne(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 Xne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Yne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Qne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Qne(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 Zne(e,t,n){const r=e.treeAdapter.getTagName(t),s=Su(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===ke.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Jne(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 u_(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 nre(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ps.QUIRKS:One(t);Rne(t)||e._err(t,de.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function sd(e,t){e._err(t,de.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ps.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function rre(e,t){t.tagID===v.HTML?(e._insertElement(t,ke.HTML),e.insertionMode=Q.BEFORE_HEAD):Gd(e,t)}function sre(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Gd(e,t)}function Gd(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function ire(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.HEAD:{e._insertElement(t,ke.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break}default:qd(e,t)}}function are(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?qd(e,t):e._err(t,de.endTagWithoutMatchingOpenElement)}function qd(e,t){e._insertFakeElement(ie.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function _i(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Qn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Qn.RAWTEXT):(e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Qn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Qn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Xd(e,t)}}function ore(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Xd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Nl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,de.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,de.endTagWithoutMatchingOpenElement)}function Xd(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function lre(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{_i(e,t);break}case v.NOSCRIPT:{e._err(t,de.nestedNoscriptInHead);break}default:Qd(e,t)}}function cre(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break}case v.BR:{Qd(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Qd(e,t){const n=t.type===St.EOF?de.openElementsLeftAfterEof:de.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function ure(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BODY:{e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,ke.HTML),e.insertionMode=Q.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,de.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),_i(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Zd(e,t)}}function dre(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Zd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Zd(e,t){e._insertFakeElement(ie.BODY,v.BODY),e.insertionMode=Q.IN_BODY,T0(e,t)}function T0(e,t){switch(t.type){case St.CHARACTER:{ZD(e,t);break}case St.WHITESPACE_CHARACTER:{QD(e,t);break}case St.COMMENT:{ix(e,t);break}case St.START_TAG:{Fr(e,t);break}case St.END_TAG:{A0(e,t);break}case St.EOF:{nP(e,t);break}}}function QD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ZD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function fre(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function hre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function pre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_FRAMESET)}function mre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function gre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&sx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ke.HTML)}function yre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function bre(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),n||(e.formElement=e.openElements.current))}function Ere(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,ke.HTML)}function xre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.tokenizer.state=Qn.PLAINTEXT}function wre(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1}function vre(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ie.A);n&&(u_(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _re(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(u_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Sre(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ps.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function JD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function eP(e){const t=HD(e,tl.TYPE);return t!=null&&t.toLowerCase()===Vne}function Tre(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),eP(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Are(e,t){e._appendElement(t,ke.HTML),t.ackSelfClosing=!0}function Cre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ire(e,t){t.tagName=ie.IMG,t.tagID=v.IMG,JD(e,t)}function Rre(e,t){e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Qn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function Ore(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function Lre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function oA(e,t){e._switchToTextParsing(t,Qn.RAWTEXT)}function Mre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function jre(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Dre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ke.HTML)}function Pre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,ke.HTML)}function Bre(e,t){e._reconstructActiveFormattingElements(),GD(t),c_(t),t.selfClosing?e._appendElement(t,ke.MATHML):e._insertElement(t,ke.MATHML),t.ackSelfClosing=!0}function Fre(e,t){e._reconstructActiveFormattingElements(),qD(t),c_(t),t.selfClosing?e._appendElement(t,ke.SVG):e._insertElement(t,ke.SVG),t.ackSelfClosing=!0}function lA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Fr(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:{_re(e,t);break}case v.A:{vre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{gre(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:{mre(e,t);break}case v.LI:case v.DD:case v.DT:{Ere(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{JD(e,t);break}case v.HR:{Cre(e,t);break}case v.RB:case v.RTC:{Dre(e,t);break}case v.RT:case v.RP:{Pre(e,t);break}case v.PRE:case v.LISTING:{yre(e,t);break}case v.XMP:{Ore(e,t);break}case v.SVG:{Fre(e,t);break}case v.HTML:{fre(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:{_i(e,t);break}case v.BODY:{hre(e,t);break}case v.FORM:{bre(e,t);break}case v.NOBR:{kre(e,t);break}case v.MATH:{Bre(e,t);break}case v.TABLE:{Sre(e,t);break}case v.INPUT:{Tre(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{Are(e,t);break}case v.IMAGE:{Ire(e,t);break}case v.BUTTON:{wre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Nre(e,t);break}case v.IFRAME:{Lre(e,t);break}case v.SELECT:{Mre(e,t);break}case v.OPTION:case v.OPTGROUP:{jre(e,t);break}case v.NOEMBED:case v.NOFRAMES:{oA(e,t);break}case v.FRAMESET:{pre(e,t);break}case v.TEXTAREA:{Rre(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?oA(e,t):lA(e,t);break}case v.PLAINTEXT:{xre(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:lA(e,t)}}function Ure(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function $re(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,uP(e,t))}function Hre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function zre(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 Vre(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ie.P,v.P),e._closePElement()}function Kre(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Yre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Wre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Gre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function qre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ie.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function tP(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 A0(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:{u_(e,t);break}case v.P:{Vre(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:{Hre(e,t);break}case v.LI:{Kre(e);break}case v.DD:case v.DT:{Yre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Wre(e);break}case v.BR:{qre(e);break}case v.BODY:{Ure(e,t);break}case v.HTML:{$re(e,t);break}case v.FORM:{zre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Gre(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:tP(e,t)}}function nP(e,t){e.tmplInsertionModeStack.length>0?cP(e,t):d_(e,t)}function Xre(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 Qre(e,t){e._err(t,de.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Sb(e,t){if(e.openElements.currentTagId!==void 0&&XD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case St.CHARACTER:{sP(e,t);break}case St.WHITESPACE_CHARACTER:{rP(e,t);break}}else mh(e,t)}function Zre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_CAPTION}function Jre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function ese(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.COLGROUP,v.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t)}function tse(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_TABLE_BODY}function nse(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.TBODY,v.TBODY),e.insertionMode=Q.IN_TABLE_BODY,C0(e,t)}function rse(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function sse(e,t){eP(t)?e._appendElement(t,ke.HTML):mh(e,t),t.ackSelfClosing=!0}function ise(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ke.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ru(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{nse(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{_i(e,t);break}case v.COL:{ese(e,t);break}case v.FORM:{ise(e,t);break}case v.TABLE:{rse(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{tse(e,t);break}case v.INPUT:{sse(e,t);break}case v.CAPTION:{Zre(e,t);break}case v.COLGROUP:{Jre(e,t);break}default:mh(e,t)}}function Pf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Nl(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:mh(e,t)}}function mh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,T0(e,t),e.fosterParentingEnabled=n}function rP(e,t){e.pendingCharacterTokens.push(t)}function sP(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function id(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:{Nl(e,t);break}}}function dse(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)):oP(e,t)}function fse(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)):lP(e,t)}function hse(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:{_i(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,ru(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,C0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,I0(e,t);break}default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,Fr(e,t)}}function pse(e,t){t.tagID===v.TEMPLATE&&Nl(e,t)}function cP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):d_(e,t)}function mse(e,t){t.tagID===v.HTML?Fr(e,t):yg(e,t)}function uP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Q.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 yg(e,t)}function yg(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function gse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.FRAMESET:{e._insertElement(t,ke.HTML);break}case v.FRAME:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{_i(e,t);break}}}function yse(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function bse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function Ese(e,t){t.tagID===v.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function xse(e,t){t.tagID===v.HTML?Fr(e,t):hm(e,t)}function hm(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function wse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function vse(e,t){t.chars=Tn,e._insertCharacters(t)}function _se(e,t){e._insertCharacters(t),e.framesetOk=!1}function dP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ke.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function kse(e,t){if(Fne(t))dP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ke.MATHML?GD(t):r===ke.SVG&&(Une(t),qD(t)),c_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Nse(e,t){if(t.tagID===v.P||t.tagID===v.BR){dP(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)===ke.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ie.AREA,ie.BASE,ie.BASEFONT,ie.BGSOUND,ie.BR,ie.COL,ie.EMBED,ie.FRAME,ie.HR,ie.IMG,ie.INPUT,ie.KEYGEN,ie.LINK,ie.META,ie.PARAM,ie.SOURCE,ie.TRACK,ie.WBR;const Sse=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Tse=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),cA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fP(e,t){const n=Pse(e),r=T3("type",{handlers:{root:Ase,element:Cse,text:Ise,comment:pP,doctype:Rse,raw:Lse},unknown:Mse}),s={parser:n?new aA(cA):aA.getFragmentParser(void 0,cA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),Tu(s,Yi());const i=n?s.parser.document:s.parser.getFragment(),a=Bte(i,{file:s.options.file});return s.stitches&&hh(a,"comment",function(l,c,u){const d=l;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 hP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:St.CHARACTER,chars:e.value,location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Rse(e,t){const n={type:St.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ose(e,t){t.stitches=!0;const n=Bse(e);if("children"in e&&"children"in n){const r=fP({type:"root",children:e.children},t.options);n.children=r.children}pP({type:"comment",value:{stitch:n}},t)}function pP(e,t){const n=e.value,r={type:St.COMMENT,data:n,location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Lse(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,mP(t,Yi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Sse,"<$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 Mse(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ose(n,t);else{let r="";throw Tse.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 Tu(e,t){mP(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=Qn.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 mP(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 jse(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Qn.PLAINTEXT)return;Tu(t,Yi(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Yo.html;s===Yo.html&&n==="svg"&&(s=Yo.svg);const i=zte({...e,children:[]},{space:s===Yo.svg?"svg":"html"}),a={type:St.START_TAG,tagName:n,tagID:Su(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:gh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Dse(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Qte.includes(n)||t.parser.tokenizer.state===Qn.PLAINTEXT)return;Tu(t,w0(e));const r={type:St.END_TAG,tagName:n,tagID:Su(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:gh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Qn.RCDATA||t.parser.tokenizer.state===Qn.RAWTEXT||t.parser.tokenizer.state===Qn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Qn.DATA)}function Pse(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function gh(e){const t=Yi(e)||{line:void 0,column:void 0,offset:void 0},n=w0(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 Bse(e){return"children"in e?tu({...e,children:[]}):tu(e)}function Fse(e){return function(t,n){return fP(t,{...e,file:n})}}const gP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function yP(e){if(!e)return!1;try{const t=e.toLowerCase();return gP.some(n=>t.includes(n))}catch{return!1}}function Use(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(yP(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 gP.some(i=>s.includes(i))}return!1}function $se({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(VX,{remarkPlugins:[rJ],rehypePlugins:n?[Fse,Y2]:[Y2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(yP(d)||Use(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(_M,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(Tr,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const yh=E.memo($se),uA=6,dA=7,Hse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ox(e){return Hse[(e||"").trim().toLowerCase()]||"未知"}function fA(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 zse(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 Vse(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 Kse({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Yse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function hA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 lx(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function pA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(hA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(hA,{direction:"right"})})]})]})}function pm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function Wse({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(Kse,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Yse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ox(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(lx,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(yh,{text:Vse(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(pm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function Gse(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,T]=E.useState(""),[S,R]=E.useState(null),[I,j]=E.useState(null),[F,Y]=E.useState(!1),[L,U]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let H=!0;return u(!0),f(""),QK({region:e,page:s,pageSize:uA}).then(W=>{if(!H)return;const P=W.items||[];r(P),l(W.totalCount||0),p(te=>P.find(X=>X.id===(te==null?void 0:te.id))||null)}).catch(W=>{H&&(r([]),l(0),p(null),f(W instanceof Error?W.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let H=!0;return k(!0),T(""),ZK(h.id,{region:e,page:w,pageSize:dA,project:h.projectName}).then(W=>{H&&(g(W.items||[]),x(W.totalCount||0))}).catch(W=>{H&&(g([]),x(0),T(W instanceof Error?W.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&k(!1)}),()=>{H=!1}},[e,h,w]);const M=H=>{H!==e&&(D(),t(H),i(1),y(1),p(null),g([]))},O=H=>{D(),p(H),y(1)},D=()=>{C.current+=1,R(null),j(null),U(""),Y(!1)},A=async H=>{if(!h)return;const W=C.current+1;C.current=W,R(H),j(null),U(""),Y(!0);try{const P=await JK(h.id,H.skillId,H.version,e,h.projectName);C.current===W&&j(P)}catch(P){C.current===W&&U(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{C.current===W&&Y(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>M("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>M("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(pm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(H=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),o.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.status)}`,children:ox(H.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",zse(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),o.jsx(pA,{page:s,total:a,pageSize:uA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(pm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void A(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.skillStatus)}`,children:ox(H.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),o.jsx(pA,{page:w,total:b,pageSize:dA,onPage:y})]}):o.jsx(pm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(Wse,{skill:S,space:h,region:e,detail:I,loading:F,error:L,onClose:D})]})}function qse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await Nj(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 o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx($t,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function or(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function R0(){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}})}mm.prototype=R0.prototype={constructor:mm,on:function(e,t){var n=this._,r=Qse(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)),gA.hasOwnProperty(t)?{space:gA[t],local:e}:e}function Jse(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cx&&t.documentElement.namespaceURI===cx?t.createElement(e):t.createElementNS(n,e)}}function eie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bP(e){var t=O0(e);return(t.local?eie:Jse)(t)}function tie(){}function h_(e){return e==null?tie:function(){return this.querySelector(e)}}function nie(e){typeof e!="function"&&(e=h_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Tie(e){e||(e=Aie);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 Cie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Iie(){return Array.from(this)}function Rie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Hie:typeof t=="function"?Vie:zie)(e,t,n??"")):su(this.node(),e)}function su(e,t){return e.style.getPropertyValue(t)||_P(e).getComputedStyle(e,null).getPropertyValue(t)}function Yie(e){return function(){delete this[e]}}function Wie(e,t){return function(){this[e]=t}}function Gie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qie(e,t){return arguments.length>1?this.each((t==null?Yie:typeof t=="function"?Gie:Wie)(e,t)):this.node()[e]}function kP(e){return e.trim().split(/^|\s+/)}function p_(e){return e.classList||new NP(e)}function NP(e){this._node=e,this._names=kP(e.getAttribute("class")||"")}NP.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 SP(e,t){for(var n=p_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function _ae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function ux(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ux.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Lae(e){return!e.ctrlKey&&!e.button}function Mae(){return this.parentNode}function jae(e,t){return t??{x:e.x,y:e.y}}function Dae(){return navigator.maxTouchPoints||"ontouchstart"in this}function OP(){var e=Lae,t=Mae,n=jae,r=Dae,s={},i=R0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Oae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(gs(_.view).on("mousemove.drag",m,Bf).on("mouseup.drag",g,Bf),IP(_.view),Tb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Rc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){gs(_.view).on("mousemove.drag mouseup.drag",null),RP(_.view,u),Rc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,T=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tp(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=Bae.exec(e))?new ss(t[1],t[2],t[3],1):(t=Fae.exec(e))?new ss(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Uae.exec(e))?Tp(t[1],t[2],t[3],t[4]):(t=$ae.exec(e))?Tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Hae.exec(e))?_A(t[1],t[2]/100,t[3]/100,1):(t=zae.exec(e))?_A(t[1],t[2]/100,t[3]/100,t[4]):yA.hasOwnProperty(e)?xA(yA[e]):e==="transparent"?new ss(NaN,NaN,NaN,0):null}function xA(e){return new ss(e>>16&255,e>>8&255,e&255,1)}function Tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new ss(e,t,n,r)}function Yae(e){return e instanceof Eh||(e=hl(e)),e?(e=e.rgb(),new ss(e.r,e.g,e.b,e.opacity)):new ss}function dx(e,t,n,r){return arguments.length===1?Yae(e):new ss(e,t,n,r??1)}function ss(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}m_(ss,dx,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ss(nl(this.r),nl(this.g),nl(this.b),xg(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:wA,formatHex:wA,formatHex8:Wae,formatRgb:vA,toString:vA}));function wA(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}`}function Wae(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}${Wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function vA(){const e=xg(this.opacity);return`${e===1?"rgb(":"rgba("}${nl(this.r)}, ${nl(this.g)}, ${nl(this.b)}${e===1?")":`, ${e})`}`}function xg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wo(e){return e=nl(e),(e<16?"0":"")+e.toString(16)}function _A(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fi(e,t,n,r)}function MP(e){if(e instanceof fi)return new fi(e.h,e.s,e.l,e.opacity);if(e instanceof Eh||(e=hl(e)),!e)return new fi;if(e instanceof fi)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new fi(a,l,c,e.opacity)}function Gae(e,t,n,r){return arguments.length===1?MP(e):new fi(e,t,n,r??1)}function fi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}m_(fi,Gae,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new fi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new fi(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 ss(Ab(e>=240?e-240:e+120,s,r),Ab(e,s,r),Ab(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new fi(kA(this.h),Ap(this.s),Ap(this.l),xg(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=xg(this.opacity);return`${e===1?"hsl(":"hsla("}${kA(this.h)}, ${Ap(this.s)*100}%, ${Ap(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kA(e){return e=(e||0)%360,e<0?e+360:e}function Ap(e){return Math.max(0,Math.min(1,e||0))}function Ab(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 g_=e=>()=>e;function qae(e,t){return function(n){return e+n*t}}function Xae(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 Qae(e){return(e=+e)==1?jP:function(t,n){return n-t?Xae(t,n,e):g_(isNaN(t)?n:t)}}function jP(e,t){var n=t-e;return n?qae(e,n):g_(isNaN(e)?t:e)}const wg=function e(t){var n=Qae(t);function r(s,i){var a=n((s=dx(s)).r,(i=dx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=jP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Zae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:ji(r,s)})),n=Cb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:ji(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:ji(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:ji(u,f)},{i:g-2,x:ji(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--iu}function TA(){pl=(_g=$f.now())+L0,iu=_d=0;try{hoe()}finally{iu=0,moe(),pl=0}}function poe(){var e=$f.now(),t=e-_g;t>FP&&(L0-=t,_g=e)}function moe(){for(var e,t=vg,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:vg=n);kd=e,px(r)}function px(e){if(!iu){_d&&(_d=clearTimeout(_d));var t=e-pl;t>24?(e<1/0&&(_d=setTimeout(TA,e-$f.now()-L0)),ad&&(ad=clearInterval(ad))):(ad||(_g=$f.now(),ad=setInterval(poe,FP)),iu=1,UP(TA))}}function AA(e,t,n){var r=new kg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var goe=R0("start","end","cancel","interrupt"),yoe=[],HP=0,CA=1,mx=2,ym=3,IA=4,gx=5,bm=6;function M0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;boe(e,n,{name:t,index:r,group:s,on:goe,tween:yoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:HP})}function b_(e,t){var n=ki(e,t);if(n.state>HP)throw new Error("too late; already scheduled");return n}function Gi(e,t){var n=ki(e,t);if(n.state>ym)throw new Error("too late; already running");return n}function ki(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function boe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=$P(i,0,n.time);function i(u){n.state=CA,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!==CA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===ym)return AA(a);p.state===IA?(p.state=bm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dmx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Goe(e,t,n){var r,s,i=Woe(t)?b_:Gi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function qoe(e,t){var n=this._id;return arguments.length<2?ki(this.node(),n).on.on(e):this.each(Goe(n,e,t))}function Xoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Qoe(){return this.on("end.remove",Xoe(this._id))}function Zoe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=h_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function _le(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 la(e,t,n){this.k=e,this.x=t,this.y=n}la.prototype={constructor:la,scale:function(e){return e===1?this:new la(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new la(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 j0=new la(1,0,0);YP.prototype=la.prototype;function YP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return j0;return e.__zoom}function Ib(e){e.stopImmediatePropagation()}function od(e){e.preventDefault(),e.stopImmediatePropagation()}function kle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Nle(){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 RA(){return this.__zoom||j0}function Sle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tle(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ale(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 WP(){var e=kle,t=Nle,n=Ale,r=Sle,s=Tle,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=gm,u=R0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(L){L.property("__zoom",RA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,U,C,M){var O=L.selection?L.selection():L;O.property("__zoom",RA),L!==O?k(L,U,C,M):O.interrupt().each(function(){N(this,arguments).event(M).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},y.scaleBy=function(L,U,C,M){y.scaleTo(L,function(){var O=this.__zoom.k,D=typeof U=="function"?U.apply(this,arguments):U;return O*D},C,M)},y.scaleTo=function(L,U,C,M){y.transform(L,function(){var O=t.apply(this,arguments),D=this.__zoom,A=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=D.invert(A),W=typeof U=="function"?U.apply(this,arguments):U;return n(x(b(D,W),A,H),O,a)},C,M)},y.translateBy=function(L,U,C,M){y.transform(L,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(L,U,C,M,O){y.transform(L,function(){var D=t.apply(this,arguments),A=this.__zoom,H=M==null?_(D):typeof M=="function"?M.apply(this,arguments):M;return n(j0.translate(H[0],H[1]).scale(A.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),D,a)},M,O)};function b(L,U){return U=Math.max(i[0],Math.min(i[1],U)),U===L.k?L:new la(U,L.x,L.y)}function x(L,U,C){var M=U[0]-C[0]*L.k,O=U[1]-C[1]*L.k;return M===L.x&&O===L.y?L:new la(L.k,M,O)}function _(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function k(L,U,C,M){L.on("start.zoom",function(){N(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(M).end()}).tween("zoom",function(){var O=this,D=arguments,A=N(O,D).event(M),H=t.apply(O,D),W=C==null?_(H):typeof C=="function"?C.apply(O,D):C,P=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),te=O.__zoom,X=typeof U=="function"?U.apply(O,D):U,ne=c(te.invert(W).concat(P/te.k),X.invert(W).concat(P/X.k));return function(ce){if(ce===1)ce=X;else{var J=ne(ce),fe=P/J[2];ce=new la(fe,W[0]-J[0]*fe,W[1]-J[1]*fe)}A.zoom(null,ce)}})}function N(L,U,C){return!C&&L.__zooming||new T(L,U)}function T(L,U){this.that=L,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,U),this.taps=0}T.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,U){return this.mouse&&L!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var U=gs(this.that).datum();u.call(L,this.that,new _le(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),U)}};function S(L,...U){if(!e.apply(this,arguments))return;var C=N(this,U).event(L),M=this.__zoom,O=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=ci(L);if(C.wheel)(C.mouse[0][0]!==D[0]||C.mouse[0][1]!==D[1])&&(C.mouse[1]=M.invert(C.mouse[0]=D)),clearTimeout(C.wheel);else{if(M.k===O)return;C.mouse=[D,M.invert(D)],Em(this),C.start()}od(L),C.wheel=setTimeout(A,m),C.zoom("mouse",n(x(b(M,O),C.mouse[0],C.mouse[1]),C.extent,a));function A(){C.wheel=null,C.end()}}function R(L,...U){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,M=N(this,U,!0).event(L),O=gs(L.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",P,!0),D=ci(L,C),A=L.clientX,H=L.clientY;IP(L.view),Ib(L),M.mouse=[D,this.__zoom.invert(D)],Em(this),M.start();function W(te){if(od(te),!M.moved){var X=te.clientX-A,ne=te.clientY-H;M.moved=X*X+ne*ne>g}M.event(te).zoom("mouse",n(x(M.that.__zoom,M.mouse[0]=ci(te,C),M.mouse[1]),M.extent,a))}function P(te){O.on("mousemove.zoom mouseup.zoom",null),RP(te.view,M.moved),od(te),M.event(te).end()}}function I(L,...U){if(e.apply(this,arguments)){var C=this.__zoom,M=ci(L.changedTouches?L.changedTouches[0]:L,this),O=C.invert(M),D=C.k*(L.shiftKey?.5:2),A=n(x(b(C,D),M,O),t.apply(this,U),a);od(L),l>0?gs(this).transition().duration(l).call(k,A,M,L):gs(this).call(y.transform,A,M,L)}}function j(L,...U){if(e.apply(this,arguments)){var C=L.touches,M=C.length,O=N(this,U,L.changedTouches.length===M).event(L),D,A,H,W;for(Ib(L),A=0;A`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.`},Hf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GP=["Enter"," ","Escape"],qP={"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 au;(function(e){e.Strict="strict",e.Loose="loose"})(au||(au={}));var rl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rl||(rl={}));var zf;(function(e){e.Partial="partial",e.Full="full"})(zf||(zf={}));const XP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ya;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ya||(Ya={}));var ou;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ou||(ou={}));var He;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(He||(He={}));const OA={[He.Left]:He.Right,[He.Right]:He.Left,[He.Top]:He.Bottom,[He.Bottom]:He.Top};function QP(e){return e===null?null:e?"valid":"invalid"}const ZP=e=>"id"in e&&"source"in e&&"target"in e,Cle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),x_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xh=(e,t=[0,0])=>{const{width:n,height:r}=_a(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Ile=(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):x_(s)?s:t.nodeLookup.get(s.id));const l=a?Ng(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return D0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P0(n)},wh=(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=D0(n,Ng(s)),r=!0)}),r?P0(n):{x:0,y:0,width:0,height:0}},w_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={...Au(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,g=Vf(l,cu(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},Rle=(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 Ole(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 Lle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Ole(e,a),c=wh(l),u=__(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 JP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",vi.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&gl(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=gl(f)?ml(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",vi.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 Mle({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=Rle(a,c);for(const h of c)l.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 lu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ml=(e={x:0,y:0},t,n)=>({x:lu(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lu(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function e4(e,t,n){const{width:r,height:s}=_a(n),{x:i,y:a}=n.internals.positionAbsolute;return ml(e,[[i,a],[i+r,a+s]],t)}const LA=(e,t,n)=>en?-lu(Math.abs(e-n),1,t)/t:0,v_=(e,t,n=15,r=40)=>{const s=LA(e.x,r,t.width-r)*n,i=LA(e.y,r,t.height-r)*n;return[s,i]},D0=(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)}),yx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),P0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),cu=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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}},Ng=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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)}},t4=(e,t)=>P0(D0(yx(e),yx(t))),Vf=(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)},MA=e=>pi(e.width)&&pi(e.height)&&pi(e.x)&&pi(e.y),pi=e=>!isNaN(e)&&isFinite(e),n4=(e,t)=>(n,r)=>{},vh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Au=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?vh(l,a):l},uu=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ul(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 jle(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ul(e,n),s=Ul(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ul(e.top??e.y??0,n),s=Ul(e.bottom??e.y??0,n),i=Ul(e.left??e.x??0,t),a=Ul(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 Dle(e,t,n,r,s,i){const{x:a,y:l}=uu(e,[t,n,r]),{x:c,y:u}=uu({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const __=(e,t,n,r,s,i)=>{const a=jle(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=lu(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,g=Dle(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Kf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gl(e){return e!=null&&e!=="parent"}function _a(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 k_(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 r4(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function jA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ple(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Ble(e){return{...qP,...e||{}}}function ef(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=mi(e),l=Au({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?vh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const N_=e=>({width:e.offsetWidth,height:e.offsetHeight}),s4=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Fle=["INPUT","SELECT","TEXTAREA"];function i4(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:Fle.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const a4=e=>"clientX"in e,mi=(e,t)=>{var i,a;const n=a4(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)}},DA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...N_(a)}})};function o4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Rp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function PA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case He.Left:return[t-Rp(t-r,i),n];case He.Right:return[t+Rp(r-t,i),n];case He.Top:return[t,n-Rp(n-s,i)];case He.Bottom:return[t,n+Rp(s-n,i)]}}function l4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top,curvature:a=.25}){const[l,c]=PA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=PA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function c4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const Hle=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,zle=(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)),Vle=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",vi.error006()),t;const r=n.getEdgeId||Hle;let s;return ZP(e)?s={...e}:s={...e,id:r(e)},zle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function u4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=c4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const BA={[He.Left]:{x:-1,y:0},[He.Right]:{x:1,y:0},[He.Top]:{x:0,y:-1},[He.Bottom]:{x:0,y:1}},Kle=({source:e,sourcePosition:t=He.Bottom,target:n})=>t===He.Left||t===He.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Yle({source:e,sourcePosition:t=He.Bottom,target:n,targetPosition:r=He.Top,center:s,offset:i,stepPosition:a}){const l=BA[t],c=BA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=Kle({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=c4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const L=Math.abs(e[h]-n[h]);if(L<=i){const U=Math.min(i-1,i-L);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*U:b[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const L=h==="x"?"y":"x",U=l[h]===c[L],C=u[L]>d[L],M=u[L]=Y?(g=(I.x+j.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function Wle(e,t,n,r){const s=Math.min(FA(e,t)/2,FA(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 bx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function qle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=bx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const d4=1e3,Xle=10,S_={nodeOrigin:[0,0],nodeExtent:Hf,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Qle={...S_,checkEquality:!0};function T_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Zle(e,t,n){const r=T_(S_,n);for(const s of e.values())if(s.parentId)C_(s,e,t,r);else{const i=xh(s,r.nodeOrigin),a=gl(s.extent)?s.extent:r.nodeExtent,l=ml(i,a,_a(s));s.internals.positionAbsolute=l}}function Jle(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 A_(e){return e==="manual"}function Ex(e,t,n,r={}){var d,f;const s=T_(Qle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!A_(s.zIndexMode)?d4: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=xh(h,s.nodeOrigin),g=gl(h.extent)?h.extent:s.nodeExtent,w=ml(m,g,_a(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:Jle(h,p),z:f4(h,l,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&&C_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function ece(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 C_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=T_(S_,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}ece(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*Xle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!A_(c)?d4:0,{x:h,y:p,z:m}=tce(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function f4(e,t,n){const r=pi(e.zIndex)?e.zIndex:0;return A_(n)?r:r+(e.selected?t:0)}function tce(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=_a(e),u=xh(e,n),d=gl(e.extent)?ml(u,e.extent,c):u;let f=ml({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=e4(f,c,t));const h=f4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function I_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??cu(c),d=t4(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=_a(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=I_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function rce({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 zA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 h4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;zA("source",c,d,e,s,a),zA("target",c,u,e,i,l),t.set(r.id,r)}}function p4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:p4(n,t):!1}function VA(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 sce(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!p4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Rb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function ice({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=vh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function ace({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:T=0}){h=gs(_);function S({x:F,y:Y}){const{nodeLookup:L,nodeExtent:U,snapGrid:C,snapToGrid:M,nodeOrigin:O,onNodeDrag:D,onSelectionDrag:A,onError:H,updateNodePositions:W}=t();i={x:F,y:Y};let P=!1;const te=l.size>1,X=te&&U?yx(wh(l)):null,ne=te&&M?ice({dragItems:l,snapGrid:C,x:F,y:Y}):null;for(const[ce,J]of l){if(!L.has(ce))continue;let fe={x:F-J.distance.x,y:Y-J.distance.y};M&&(fe=ne?{x:Math.round(fe.x+ne.x),y:Math.round(fe.y+ne.y)}:vh(fe,C));let ee=null;if(te&&U&&!J.extent&&X){const{positionAbsolute:xe}=J.internals,we=xe.x-X.x+U[0][0],Te=xe.x+J.measured.width-X.x2+U[1][0],Re=xe.y-X.y+U[0][1],Ye=xe.y+J.measured.height-X.y2+U[1][1];ee=[[we,Re],[Te,Ye]]}const{position:Ee,positionAbsolute:ge}=JP({nodeId:ce,nextPosition:fe,nodeLookup:L,nodeExtent:ee||U,nodeOrigin:O,onError:H});P=P||J.position.x!==Ee.x||J.position.y!==Ee.y,J.position=Ee,J.internals.positionAbsolute=ge}if(m=m||P,!!P&&(W(l,!0),g&&(r||D||!N&&A))){const[ce,J]=Rb({nodeId:N,dragItems:l,nodeLookup:L});r==null||r(g,l,ce,J),D==null||D(g,ce,J),N||A==null||A(g,J)}}async function R(){if(!d)return;const{transform:F,panBy:Y,autoPanSpeed:L,autoPanOnNodeDrag:U}=t();if(!U){c=!1,cancelAnimationFrame(a);return}const[C,M]=v_(u,d,L);(C!==0||M!==0)&&(i.x=(i.x??0)-C/F[2],i.y=(i.y??0)-M/F[2],await Y({x:C,y:M})&&S(i)),a=requestAnimationFrame(R)}function I(F){var te;const{nodeLookup:Y,multiSelectionActive:L,nodesDraggable:U,transform:C,snapGrid:M,snapToGrid:O,selectNodesOnDrag:D,onNodeDragStart:A,onSelectionDragStart:H,unselectNodesAndEdges:W}=t();f=!0,(!D||!k)&&!L&&N&&((te=Y.get(N))!=null&&te.selected||W()),k&&D&&N&&(e==null||e(N));const P=ef(F.sourceEvent,{transform:C,snapGrid:M,snapToGrid:O,containerBounds:d});if(i=P,l=sce(Y,U,P,N),l.size>0&&(n||A||!N&&H)){const[X,ne]=Rb({nodeId:N,dragItems:l,nodeLookup:Y});n==null||n(F.sourceEvent,l,X,ne),A==null||A(F.sourceEvent,X,ne),N||H==null||H(F.sourceEvent,ne)}}const j=OP().clickDistance(T).on("start",F=>{const{domNode:Y,nodeDragThreshold:L,transform:U,snapGrid:C,snapToGrid:M}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,g=F.sourceEvent,L===0&&I(F),i=ef(F.sourceEvent,{transform:U,snapGrid:C,snapToGrid:M,containerBounds:d}),u=mi(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:L,snapGrid:U,snapToGrid:C,nodeDragThreshold:M,nodeLookup:O}=t(),D=ef(F.sourceEvent,{transform:L,snapGrid:U,snapToGrid:C,containerBounds:d});if(g=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||N&&!O.has(N))&&(p=!0),!p){if(!c&&Y&&f&&(c=!0,R()),!f){const A=mi(F.sourceEvent,d),H=A.x-u.x,W=A.y-u.y;Math.sqrt(H*H+W*W)>M&&I(F)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&f&&(u=mi(F.sourceEvent,d),S(D))}}).on("end",F=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:Y,updateNodePositions:L,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(L(l,!1),m=!1),s||U||!N&&C){const[M,O]=Rb({nodeId:N,dragItems:l,nodeLookup:Y,dragging:!1});s==null||s(F.sourceEvent,l,M,O),U==null||U(F.sourceEvent,M,O),N||C==null||C(F.sourceEvent,O)}}}).filter(F=>{const Y=F.target;return!F.button&&(!b||!VA(Y,`.${b}`,_))&&(!x||VA(Y,x,_))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function oce(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())Vf(s,cu(i))>0&&r.push(i);return r}const lce=250;function cce(e,t,n,r){var l,c;let s=[],i=1/0;const a=oce(e,n,t+lce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=yl(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 m4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...yl(a,c,c.position,!0)}:c}function g4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function uce(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const y4=()=>!0;function dce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=y4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:S}){const R=s4(e.target);let I=0,j;const{x:F,y:Y}=mi(e),L=g4(i,S),U=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!U||!L)return;const M=m4(s,L,r,c,t);if(!M)return;let O=mi(e,U),D=!1,A=null,H=!1,W=null;function P(){if(!d||!U)return;const[Ee,ge]=v_(O,U,N);h({x:Ee,y:ge}),I=requestAnimationFrame(P)}const te={...M,nodeId:s,type:L,position:M.position},X=c.get(s);let ce={inProgress:!0,isValid:null,from:yl(X,te,He.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:X,to:O,toHandle:null,toPosition:OA[te.position],toNode:null,pointer:O};function J(){C=!0,x(ce),m==null||m(e,{nodeId:s,handleId:r,handleType:L})}T===0&&J();function fe(Ee){if(!C){const{x:Ye,y:Le}=mi(Ee),bt=Ye-F,Ze=Le-Y;if(!(bt*bt+Ze*Ze>T*T))return;J()}if(!k()||!te){ee(Ee);return}const ge=_();O=mi(Ee,U),j=cce(Au(O,ge,!1,[1,1]),n,c,te),D||(P(),D=!0);const xe=b4(Ee,{handle:j,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});W=xe.handleDomNode,A=xe.connection,H=uce(!!j,xe.isValid);const we=c.get(s),Te=we?yl(we,te,He.Left,!0):ce.from,Re={...ce,from:Te,isValid:H,to:xe.toHandle&&H?uu({x:xe.toHandle.x,y:xe.toHandle.y},ge):O,toHandle:xe.toHandle,toPosition:H&&xe.toHandle?xe.toHandle.position:OA[te.position],toNode:xe.toHandle?c.get(xe.toHandle.nodeId):null,pointer:O};x(Re),ce=Re}function ee(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(C){(j||W)&&A&&H&&(g==null||g(A));const{inProgress:ge,...xe}=ce,we={...xe,toPosition:ce.toHandle?ce.toPosition:null};w==null||w(Ee,we),i&&(b==null||b(Ee,we))}p(),cancelAnimationFrame(I),D=!1,H=!1,A=null,W=null,R.removeEventListener("mousemove",fe),R.removeEventListener("mouseup",ee),R.removeEventListener("touchmove",fe),R.removeEventListener("touchend",ee)}}R.addEventListener("mousemove",fe),R.addEventListener("mouseup",ee),R.addEventListener("touchmove",fe),R.addEventListener("touchend",ee)}function b4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=y4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=mi(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=g4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const T={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=T;const R=k&&N&&(n===au.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(T),y.toHandle=m4(x,b,_,d,n,!0)}return y}const xx={onPointerDown:dce,isValid:b4};function fce({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=gs(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Kf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=_[2]*Math.pow(2,N*k);t.scaleTo(T)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const T=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*T,y:_[1]-N[1]*T},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=WP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ci}}const B0=e=>({x:e.x,y:e.y,zoom:e.k}),Ob=({x:e,y:t,zoom:n})=>j0.translate(e,t).scale(n),pc=(e,t)=>e.target.closest(`.${t}`),E4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hce=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lb=(e,t=0,n=hce,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},x4=e=>{const t=e.ctrlKey&&Kf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(pc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ci(d),y=x4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===rl.Vertical?0:d.deltaX*h,m=s===rl.Horizontal?0:d.deltaY*h;!Kf()&&d.shiftKey&&s!==rl.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=B0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function mce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=pc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function gce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=B0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function yce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&E4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,B0(i.transform)))}}function bce({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&E4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=B0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function Ece({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(pc(f,`${u}-flow__node`)||pc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||pc(f,l)&&m||pc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function xce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=WP().scaleExtent([t,n]).translateExtent(r),h=gs(e).call(f);b({x:s.x,y:s.y,zoom:lu(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(x4);async function g(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).transform(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function w({noWheelClassName:j,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:L,panOnScroll:U,panOnDrag:C,panOnScrollMode:M,panOnScrollSpeed:O,preventScrolling:D,zoomOnPinch:A,zoomOnScroll:H,zoomOnDoubleClick:W,zoomActivationKeyPressed:P,lib:te,onTransformChange:X,connectionInProgress:ne,paneClickDistance:ce,selectionOnDrag:J}){L&&!u.isZoomingOrPanning&&y();const fe=U&&!P&&!L;f.clickDistance(J?1/0:!pi(ce)||ce<0?0:ce);const ee=fe?pce({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:O,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):mce({noWheelClassName:j,preventScrolling:D,d3ZoomHandler:p});h.on("wheel.zoom",ee,{passive:!1});const Ee=gce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ee);const ge=yce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:X});f.on("zoom",ge);const xe=bce({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});f.on("end",xe);const we=Ece({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:W,zoomOnPinch:A,userSelectionActive:L,noPanClassName:F,noWheelClassName:j,lib:te,connectionInProgress:ne});f.filter(we),W?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(j,F,Y){const L=Ob(j),U=f==null?void 0:f.constrain()(L,F,Y);return U&&await g(U),U}async function x(j,F){const Y=Ob(j);return await g(Y,F),Y}function _(j){if(h){const F=Ob(j),Y=h.property("__zoom");(Y.k!==j.zoom||Y.x!==j.x||Y.y!==j.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function k(){const j=h?YP(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function N(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleTo(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}async function T(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleBy(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function S(j){f==null||f.scaleExtent(j)}function R(j){f==null||f.translateExtent(j)}function I(j){const F=!pi(j)||j<0?0:j;f==null||f.clickDistance(F)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:T,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var du;(function(e){e.Line="line",e.Handle="handle"})(du||(du={}));function wce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function KA(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 Ma(e,t){return Math.max(0,t-e)}function ja(e,t){return Math.max(0,e-t)}function Op(e,t,n){return Math.max(0,t-e,e-n)}function YA(e,t){return e?!t:t}function vce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:T}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),j=N+(u?-R:R),F=-i[0]*k,Y=-i[1]*N;let L=Op(I,g,w),U=Op(j,y,b);if(a){let O=0,D=0;c&&S<0?O=Ma(x+S+F,a[0][0]):!c&&S>0&&(O=ja(x+I+F,a[1][0])),u&&R<0?D=Ma(_+R+Y,a[0][1]):!u&&R>0&&(D=ja(_+j+Y,a[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(l){let O=0,D=0;c&&S>0?O=ja(x+S,l[0][0]):!c&&S<0&&(O=Ma(x+I,l[1][0])),u&&R>0?D=ja(_+R,l[0][1]):!u&&R<0&&(D=Ma(_+j,l[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(s){if(d){const O=Op(I/T,y,b)*T;if(L=Math.max(L,O),a){let D=0;!c&&!u||c&&!u&&h?D=ja(_+Y+I/T,a[1][1])*T:D=Ma(_+Y+(c?S:-S)/T,a[0][1])*T,L=Math.max(L,D)}if(l){let D=0;!c&&!u||c&&!u&&h?D=Ma(_+I/T,l[1][1])*T:D=ja(_+(c?S:-S)/T,l[0][1])*T,L=Math.max(L,D)}}if(f){const O=Op(j*T,g,w)/T;if(U=Math.max(U,O),a){let D=0;!c&&!u||u&&!c&&h?D=ja(x+j*T+F,a[1][0])/T:D=Ma(x+(u?R:-R)*T+F,a[0][0])/T,U=Math.max(U,D)}if(l){let D=0;!c&&!u||u&&!c&&h?D=Ma(x+j*T,l[1][0])/T:D=ja(x+(u?R:-R)*T,l[0][0])/T,U=Math.max(U,D)}}}R=R+(R<0?U:-U),S=S+(S<0?L:-L),s&&(h?I>j*T?R=(YA(c,u)?-S:S)/T:S=(YA(c,u)?-R:R)*T:d?(R=S/T,u=c):(S=R*T,c=u));const C=c?x+S:x,M=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+M}}const w4={width:0,height:0,x:0,y:0},_ce={...w4,pointerX:0,pointerY:0,aspectRatio:1};function kce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function Nce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=gs(e);let a={controlDirection:KA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...w4},b={..._ce};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:KA(u)};let x,_=null,k=[],N,T,S,R=!1;const I=OP().on("start",j=>{const{nodeLookup:F,transform:Y,snapGrid:L,snapToGrid:U,nodeOrigin:C,paneDomNode:M}=n();if(x=F.get(t),!x)return;_=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:D}=ef(j.sourceEvent,{transform:Y,snapGrid:L,snapToGrid:U,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:O,pointerY:D,aspectRatio:y.width/y.height},N=void 0,T=gl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=F.get(x.parentId)),N&&x.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[A,H]of F)if(H.parentId===t&&(k.push({id:A,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const W=kce(H,x,H.origin??C);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(j,{...y})}).on("drag",j=>{const{transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U}=n(),C=ef(j.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:L,containerBounds:_}),M=[];if(!x)return;const{x:O,y:D,width:A,height:H}=y,W={},P=x.origin??U,{width:te,height:X,x:ne,y:ce}=vce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,T,S),J=te!==A,fe=X!==H,ee=ne!==O&&J,Ee=ce!==D&&fe;if(!ee&&!Ee&&!J&&!fe)return;if((ee||Ee||P[0]===1||P[1]===1)&&(W.x=ee?ne:y.x,W.y=Ee?ce:y.y,y.x=W.x,y.y=W.y,k.length>0)){const Te=ne-O,Re=ce-D;for(const Ye of k)Ye.position={x:Ye.position.x-Te+P[0]*(te-A),y:Ye.position.y-Re+P[1]*(X-H)},M.push(Ye)}if((J||fe)&&(W.width=J&&(!a.resizeDirection||a.resizeDirection==="horizontal")?te:y.width,W.height=fe&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=W.width,y.height=W.height),N&&x.expandParent){const Te=P[0]*(W.width??0);W.x&&W.x{R&&(g==null||g(j,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var v4={exports:{}},_4={},k4={exports:{}},N4={};/** + * @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 fu=E;function Sce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tce=typeof Object.is=="function"?Object.is:Sce,Ace=fu.useState,Cce=fu.useEffect,Ice=fu.useLayoutEffect,Rce=fu.useDebugValue;function Oce(e,t){var n=t(),r=Ace({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Ice(function(){s.value=n,s.getSnapshot=t,Mb(s)&&i({inst:s})},[e,n,t]),Cce(function(){return Mb(s)&&i({inst:s}),e(function(){Mb(s)&&i({inst:s})})},[e]),Rce(n),n}function Mb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tce(e,n)}catch{return!0}}function Lce(e,t){return t()}var Mce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lce:Oce;N4.useSyncExternalStore=fu.useSyncExternalStore!==void 0?fu.useSyncExternalStore:Mce;k4.exports=N4;var jce=k4.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 F0=E,Dce=jce;function Pce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bce=typeof Object.is=="function"?Object.is:Pce,Fce=Dce.useSyncExternalStore,Uce=F0.useRef,$ce=F0.useEffect,Hce=F0.useMemo,zce=F0.useDebugValue;_4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Uce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Hce(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,Bce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=Fce(e,i[0],i[1]);return $ce(function(){a.hasValue=!0,a.value=l},[l]),zce(l),l};v4.exports=_4;var Vce=v4.exports;const Kce=Xf(Vce),Yce={},WA=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:()=>{(Yce?"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},Wce=e=>e?WA(e):WA,{useDebugValue:Gce}=kt,{useSyncExternalStoreWithSelector:qce}=Kce,Xce=e=>e;function S4(e,t=Xce,n){const r=qce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Gce(r),r}const GA=(e,t)=>{const n=Wce(e),r=(s,i=t)=>S4(n,s,i);return Object.assign(r,n),r},Qce=(e,t)=>e?GA(e,t):GA;function In(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 U0=E.createContext(null),Zce=U0.Provider,T4=vi.error001("react");function Rt(e,t){const n=E.useContext(U0);if(n===null)throw new Error(T4);return S4(n,e,t)}function Rn(){const e=E.useContext(U0);if(e===null)throw new Error(T4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qA={display:"none"},Jce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},A4="react-flow__node-desc",C4="react-flow__edge-desc",eue="react-flow__aria-live",tue=e=>e.ariaLiveMessage,nue=e=>e.ariaLabelConfig;function rue({rfId:e}){const t=Rt(tue);return o.jsx("div",{id:`${eue}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Jce,children:t})}function sue({rfId:e,disableKeyboardA11y:t}){const n=Rt(nue);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${A4}-${e}`,style:qA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${C4}-${e}`,style:qA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(rue,{rfId:e})]})}const $0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:or(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});$0.displayName="Panel";function iue({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx($0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aue=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}},Lp=e=>e.id;function oue(e,t){return In(e.selectedNodes.map(Lp),t.selectedNodes.map(Lp))&&In(e.selectedEdges.map(Lp),t.selectedEdges.map(Lp))}function lue({onSelectionChange:e}){const t=Rn(),{selectedNodes:n,selectedEdges:r}=Rt(aue,oue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const cue=e=>!!e.onSelectionChangeHandlers;function uue({onSelectionChange:e}){const t=Rt(cue);return e||t?o.jsx(lue,{onSelectionChange:e}):null}const I4=[0,0],due={x:0,y:0,zoom:1},fue=["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"],XA=[...fue,"rfId"],hue=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}),QA={translateExtent:Hf,nodeOrigin:I4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function pue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Rt(hue,In),u=Rn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=QA,l()}),[]);const d=E.useRef(QA);return E.useEffect(()=>{for(const f of XA){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:Ble(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},XA.map(f=>e[f])),null}function ZA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function mue(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=ZA(),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=ZA())!=null&&r.matches?"dark":"light"}const JA=typeof document<"u"?document:null;function Yf(e=null,t={target:JA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.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 E.useEffect(()=>{const c=(t==null?void 0:t.target)??JA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&i4(p))return!1;const g=tC(p.code,l);if(i.current.add(p[g]),eC(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=tC(p.code,l);eC(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 eC(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function tC(e,t){return t.includes(e)?"code":"key"}const gue=()=>{const e=Rn();return E.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:l}=e.getState(),c=__(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return Au(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=uu(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function R4(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 l={...i};for(const c of a)yue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function yue(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 O4(e,t){return R4(e,t)}function L4(e,t){return R4(e,t)}function Po(e,t){return{id:e,type:"select",selected:t}}function mc(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(Po(i.id,a)))}return r}function nC({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 rC(e){return{id:e.id,type:"remove"}}const bue=n4();function M4(e,t,n={}){return Vle(e,t,{...n,onError:n.onError??bue})}const sC=e=>Cle(e),Eue=e=>ZP(e);function j4(e){return E.forwardRef(e)}const xue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function iC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>wue(()=>n(s=>s+BigInt(1))));return xue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function wue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const D4=E.createContext(null);function vue({children:e}){const t=Rn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=nC({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=iC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(nC({items:p,lookup:h}))},[]),i=iC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(D4.Provider,{value:a,children:e})}function _ue(){const e=E.useContext(D4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kue=e=>!!e.panZoom;function H0(){const e=gue(),t=Rn(),n=_ue(),r=Rt(kue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=sC(f)?f:h.get(f.id),g=m.parentId?r4(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return cu(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&sC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&Eue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Mle({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),T=N.length>0,S=k.length>0;if(T){const R=N.map(rC);w==null||w(N),b(R)}if(S){const R=k.map(rC);g==null||g(k),y(R)}return(S||T)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=MA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=cu(w?y:b),_=Vf(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=MA(f)?f:c(f);if(!g)return!1;const w=Vf(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Ile(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??Ple();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const aC=e=>e.selected,Nue=typeof window<"u"?window:void 0;function Sue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Rn(),{deleteElements:r}=H0(),s=Yf(e,{actInsideInputWithModifier:!1}),i=Yf(t,{target:Nue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(aC),edges:a.filter(aC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Tue(e){const t=Rn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=N_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",vi.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 z0={position:"absolute",width:"100%",height:"100%",top:0,left:0},Aue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Cue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=rl.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=Rn(),N=E.useRef(null),{userSelectionActive:T,lib:S,connectionInProgress:R}=Rt(Aue,In),I=Yf(h),j=E.useRef();Tue(N);const F=E.useCallback(Y=>{y==null||y({x:Y[0],y:Y[1],zoom:Y[2]}),b||k.setState({transform:Y})},[y,b]);return E.useEffect(()=>{if(N.current){j.current=xce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(M=>M.paneDragging===C?M:{paneDragging:C}),onPanZoomStart:(C,M)=>{const{onViewportChangeStart:O,onMoveStart:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoom:(C,M)=>{const{onViewportChange:O,onMove:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoomEnd:(C,M)=>{const{onViewportChangeEnd:O,onMoveEnd:D}=k.getState();D==null||D(C,M),O==null||O(M)}});const{x:Y,y:L,zoom:U}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[Y,L,U],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=j.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var Y;(Y=j.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:T,noWheelClassName:g,lib:S,onTransformChange:F,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,T,g,S,F,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:z0,children:m})}const Iue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Rue(){const{userSelectionActive:e,userSelectionRect:t}=Rt(Iue,In);return e&&t?o.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 jb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Oue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Lue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=zf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=Rn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:T}=Rt(Oue,In),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),j=E.useRef(new Set),F=E.useRef(new Set),Y=E.useRef(!1),L=E.useRef({x:0,y:0}),U=E.useRef(!1),C=J=>{if(Y.current||k){Y.current=!1;return}u==null||u(J),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},M=J=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){J.preventDefault();return}d==null||d(J)},O=f?J=>f(J):void 0,D=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},A=J=>{var Ye,Le;const{domNode:fe,transform:ee}=y.getState();if(I.current=fe==null?void 0:fe.getBoundingClientRect(),!I.current)return;const Ee=J.target===R.current;if(!Ee&&!!J.target.closest(".nokey")||!e||!(a&&Ee||t)||J.button!==0||!J.isPrimary)return;(Le=(Ye=J.target)==null?void 0:Ye.setPointerCapture)==null||Le.call(Ye,J.pointerId),Y.current=!1;const{x:we,y:Te}=mi(J.nativeEvent,I.current),Re=Au({x:we,y:Te},ee);y.setState({userSelectionRect:{width:0,height:0,startX:Re.x,startY:Re.y,x:we,y:Te}}),Ee||(J.stopPropagation(),J.preventDefault())};function H(J,fe){const{userSelectionRect:ee}=y.getState();if(!ee)return;const{transform:Ee,nodeLookup:ge,edgeLookup:xe,connectionLookup:we,triggerNodeChanges:Te,triggerEdgeChanges:Re,defaultEdgeOptions:Ye}=y.getState(),Le={x:ee.startX,y:ee.startY},{x:bt,y:Ze}=uu(Le,Ee),ze={startX:Le.x,startY:Le.y,x:Jht.id)),F.current=new Set;const ct=(Ye==null?void 0:Ye.selectable)??!0;for(const ht of j.current){const G=we.get(ht);if(G)for(const{edgeId:Z}of G.values()){const he=xe.get(Z);he&&(he.selectable??ct)&&F.current.add(Z)}}if(!jA(le,j.current)){const ht=mc(ge,j.current,!0);Te(ht)}if(!jA(ve,F.current)){const ht=mc(xe,F.current);Re(ht)}y.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!I.current)return;const[J,fe]=v_(L.current,I.current,T);N({x:J,y:fe}).then(ee=>{if(!Y.current||!ee){w.current=requestAnimationFrame(W);return}const{x:Ee,y:ge}=L.current;H(Ee,ge),w.current=requestAnimationFrame(W)})}const P=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};E.useEffect(()=>()=>P(),[]);const te=J=>{const{userSelectionRect:fe,transform:ee,resetSelectedElements:Ee}=y.getState();if(!I.current||!fe)return;const{x:ge,y:xe}=mi(J.nativeEvent,I.current);L.current={x:ge,y:xe};const we=uu({x:fe.startX,y:fe.startY},ee);if(!Y.current){const Te=t?0:i;if(Math.hypot(ge-we.x,xe-we.y)<=Te)return;Ee(),l==null||l(J)}Y.current=!0,U.current||(W(),U.current=!0),H(ge,xe)},X=J=>{var fe,ee;J.button===0&&((ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),!b&&J.target===R.current&&y.getState().userSelectionRect&&(C==null||C(J)),y.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(c==null||c(J),y.setState({nodesSelectionActive:j.current.size>0})),P())},ne=J=>{var fe,ee;(ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),P()},ce=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:or(["react-flow__pane",{draggable:ce,dragging:_,selection:e}]),onClick:S?void 0:jb(C,R),onContextMenu:jb(M,R),onWheel:jb(O,R),onPointerEnter:S?void 0:h,onPointerMove:S?te:p,onPointerUp:S?X:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?A:void 0,onClickCapture:S?D:void 0,onPointerLeave:m,ref:R,style:z0,children:[g,o.jsx(Rue,{})]})}function wx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",vi.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 P4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=Rn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=ace({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{wx({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 Mue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function B4(){const e=Rn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Mue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=vh(b,i));const{position:x,positionAbsolute:_}=JP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const R_=E.createContext(null),jue=R_.Provider;R_.Consumer;const F4=()=>E.useContext(R_),Due=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Pue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===au.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Bue({type:e="source",position:t=He.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,g=e==="target",w=Rn(),y=F4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Rt(Due,In),{connectingFrom:k,connectingTo:N,clickConnecting:T,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:j}=Rt(Pue(y,m,e),In);y||(C=(U=w.getState()).onError)==null||C.call(U,"010",vi.error010());const F=M=>{const{defaultEdgeOptions:O,onConnect:D,hasDefaultEdges:A}=w.getState(),H={...O,...M};if(A){const{edges:W,setEdges:P,onError:te}=w.getState();P(M4(H,W,{onError:te}))}D==null||D(H),l==null||l(H)},Y=M=>{if(!y)return;const O=a4(M.nativeEvent);if(s&&(O&&M.button===0||!O)){const D=w.getState();xx.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:g,handleId:m,nodeId:y,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:(...A)=>{var H,W;return(W=(H=w.getState()).onConnectEnd)==null?void 0:W.call(H,...A)},updateConnection:D.updateConnection,onConnect:F,isValidConnection:n||((...A)=>{var H,W;return((W=(H=w.getState()).isValidConnection)==null?void 0:W.call(H,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}O?d==null||d(M):f==null||f(M)},L=M=>{const{onClickConnectStart:O,onClickConnectEnd:D,connectionClickStartHandle:A,connectionMode:H,isValidConnection:W,lib:P,rfId:te,nodeLookup:X,connection:ne}=w.getState();if(!y||!A&&!s)return;if(!A){O==null||O(M.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const ce=s4(M.target),J=n||W,{connection:fe,isValid:ee}=xx.isValid(M.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:H,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:J,flowId:te,doc:ce,lib:P,nodeLookup:X});ee&&fe&&F(fe);const Ee=structuredClone(ne);delete Ee.inProgress,Ee.toPosition=Ee.toHandle?Ee.toHandle.position:null,D==null||D(M,Ee),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:or(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:k,connectingto:N,valid:j,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:b?L:void 0,ref:p,...h,children:c})}const Dr=E.memo(j4(Bue));function Fue({data:e,isConnectable:t,sourcePosition:n=He.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function Uue({data:e,isConnectable:t,targetPosition:n=He.Top,sourcePosition:r=He.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:r,isConnectable:t})]})}function $ue(){return null}function Hue({data:e,isConnectable:t,targetPosition:n=He.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Tg={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oC={input:Fue,default:Uue,output:Hue,group:$ue};function zue(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 Vue=e=>{const{width:t,height:n,x:r,y:s}=wh(e.nodeLookup,{filter:i=>!!i.selected});return{width:pi(t)?t:null,height:pi(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 Kue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Rn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Rt(Vue,In),c=B4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(P4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Tg,p.key)&&(p.preventDefault(),c({direction:Tg[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:or(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 lC=typeof window<"u"?window:void 0,Yue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function U4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,preventScrolling:L,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:D,isControlledViewport:A}){const{nodesSelectionActive:H,userSelectionActive:W}=Rt(Yue,In),P=Yf(u,{target:lC}),te=Yf(g,{target:lC}),X=te||S,ne=te||_,ce=d&&X!==!0,J=P||W||ce;return Sue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(Cue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:ne,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!P&&X,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:L,noWheelClassName:C,noPanClassName:M,onViewportChange:D,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:ce,children:o.jsxs(Lue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:X,autoPanOnSelection:R,isSelecting:!!J,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:ce,children:[e,H&&o.jsx(Kue,{onSelectionContextMenu:U,noPanClassName:M,disableKeyboardA11y:O})]})})}U4.displayName="FlowRenderer";const Wue=E.memo(U4),Gue=e=>t=>e?w_(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 que(e){return Rt(E.useCallback(Gue(e),[e]),In)}const Xue=e=>e.updateNodeInternals;function Que(){const e=Rt(Xue),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Zue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Rn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 Jue({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Rt(J=>{const fe=J.nodeLookup.get(e),ee=J.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:ee}},In);let N=x.type||"default",T=(w==null?void 0:w[N])||oC[N];T===void 0&&(b==null||b("003",vi.error003(N)),N="default",T=(w==null?void 0:w.default)||oC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),j=!!(x.focusable||d&&typeof x.focusable>"u"),F=Rn(),Y=k_(x),L=Zue({node:x,nodeType:N,hasDimensions:Y,resizeObserver:f}),U=P4({nodeRef:L,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=B4();if(x.hidden)return null;const M=_a(x),O=zue(x),D=R||S||t||n||r||s,A=n?J=>n(J,{..._.userNode}):void 0,H=r?J=>r(J,{..._.userNode}):void 0,W=s?J=>s(J,{..._.userNode}):void 0,P=i?J=>i(J,{..._.userNode}):void 0,te=a?J=>a(J,{..._.userNode}):void 0,X=J=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ee}=F.getState();R&&(!fe||!S||ee>0)&&wx({id:e,store:F,nodeRef:L}),t&&t(J,{..._.userNode})},ne=J=>{if(!(i4(J.nativeEvent)||m)){if(GP.includes(J.key)&&R){const fe=J.key==="Escape";wx({id:e,store:F,unselect:fe,nodeRef:L})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(Tg,J.key)){J.preventDefault();const{ariaLabelConfig:fe}=F.getState();F.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Tg[J.key],factor:J.shiftKey?4:1})}}},ce=()=>{var we;if(m||!((we=L.current)!=null&&we.matches(":focus-visible")))return;const{transform:J,width:fe,height:ee,autoPanOnNodeFocus:Ee,setCenter:ge}=F.getState();if(!Ee)return;w_(new Map([[e,x]]),{x:0,y:0,width:fe,height:ee},J,!0).length>0||ge(x.position.x+M.width/2,x.position.y+M.height/2,{zoom:J[2]})};return o.jsx("div",{className:or(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:U}]),ref:L,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:Y?"visible":"hidden",...x.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:H,onMouseLeave:W,onContextMenu:P,onClick:X,onDoubleClick:te,onKeyDown:j?ne:void 0,tabIndex:j?0:void 0,onFocus:j?ce:void 0,role:x.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${A4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(jue,{value:e,children:o.jsx(T,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:U,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...M})})})}var ede=E.memo(Jue);const tde=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Rt(tde,In),a=que(e.onlyRenderVisibleElements),l=Que();return o.jsx("div",{className:"react-flow__nodes",style:z0,children:a.map(c=>o.jsx(ede,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}$4.displayName="NodeRenderer";const nde=E.memo($4);function rde(e){return Rt(E.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&&$le({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),In)}const sde=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ide=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cC={[ou.Arrow]:sde,[ou.ArrowClosed]:ide};function ade(e){const t=Rn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(cC,e)?cC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",vi.error009(e)),null)},[e])}const ode=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=ade(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},H4=({defaultColor:e,rfId:t})=>{const n=Rt(i=>i.edges),r=Rt(i=>i.defaultEdgeOptions),s=E.useMemo(()=>qle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(ode,{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};H4.displayName="MarkerDefinitions";var lde=E.memo(H4);function z4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=or(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}z4.displayName="EdgeText";const cde=E.memo(z4);function _h({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:or(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&pi(t)&&pi(n)?o.jsx(cde,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function uC({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===He.Left||e===He.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function V4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top}){const[a,l]=uC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=uC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function K4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=V4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(_h,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const ude=K4({isInternal:!1}),Y4=K4({isInternal:!0});ude.displayName="SimpleBezierEdge";Y4.displayName="SimpleBezierEdgeInternal";function W4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=He.Bottom,targetPosition:m=He.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=Sg({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const G4=W4({isInternal:!1}),q4=W4({isInternal:!0});G4.displayName="SmoothStepEdge";q4.displayName="SmoothStepEdgeInternal";function X4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(G4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const dde=X4({isInternal:!1}),Q4=X4({isInternal:!0});dde.displayName="StepEdge";Q4.displayName="StepEdgeInternal";function Z4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=u4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(_h,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const fde=Z4({isInternal:!1}),J4=Z4({isInternal:!0});fde.displayName="StraightEdge";J4.displayName="StraightEdgeInternal";function e6(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=He.Bottom,targetPosition:l=He.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=l4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const hde=e6({isInternal:!1}),t6=e6({isInternal:!0});hde.displayName="BezierEdge";t6.displayName="BezierEdgeInternal";const dC={default:t6,straight:J4,step:Q4,smoothstep:q4,simplebezier:Y4},fC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},pde=(e,t,n)=>n===He.Left?e-t:n===He.Right?e+t:e,mde=(e,t,n)=>n===He.Top?e-t:n===He.Bottom?e+t:e,hC="react-flow__edgeupdater";function pC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:or([hC,`${hC}-${l}`]),cx:pde(t,r,e),cy:mde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function gde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Rn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:j,cancelConnection:F,nodeLookup:Y,rfId:L,panBy:U,updateConnection:C}=m.getState(),M=k.type==="target",O=(H,W)=>{h(!1),f==null||f(H,n,k.type,W)},D=H=>u==null?void 0:u(n,H),A=(H,W)=>{h(!0),d==null||d(_,n,k.type),j==null||j(H,W)};xx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:T,handleId:k.id,nodeId:k.nodeId,nodeLookup:Y,isTarget:M,edgeUpdaterType:k.type,lib:I,flowId:L,cancelConnection:F,panBy:U,isValidConnection:(...H)=>{var W,P;return((P=(W=m.getState()).isValidConnection)==null?void 0:P.call(W,...H))??!0},onConnect:D,onConnectStart:A,onConnectEnd:(...H)=>{var W,P;return(P=(W=m.getState()).onConnectEnd)==null?void 0:P.call(W,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(pC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(pC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function yde({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Rt(ge=>ge.edgeLookup.get(e));const _=Rt(ge=>ge.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||dC[k];N===void 0&&(y==null||y("011",vi.error011(k)),k="default",N=(g==null?void 0:g.default)||dC.default);const T=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[j,F]=E.useState(!1),[Y,L]=E.useState(!1),U=Rn(),{zIndex:C,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W}=Rt(E.useCallback(ge=>{const xe=ge.nodeLookup.get(x.source),we=ge.nodeLookup.get(x.target);if(!xe||!we)return{zIndex:x.zIndex,...fC};const Te=Gle({id:e,sourceNode:xe,targetNode:we,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:y});return{zIndex:Ule({selected:x.selected,zIndex:x.zIndex,sourceNode:xe,targetNode:we,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Te||fC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),In),P=E.useMemo(()=>x.markerStart?`url('#${bx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),te=E.useMemo(()=>x.markerEnd?`url('#${bx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||M===null||O===null||D===null||A===null)return null;const X=ge=>{var Re;const{addSelectedEdges:xe,unselectNodesAndEdges:we,multiSelectionActive:Te}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),x.selected&&Te?(we({nodes:[],edges:[x]}),(Re=I.current)==null||Re.blur()):xe([e])),s&&s(ge,x)},ne=i?ge=>{i(ge,{...x})}:void 0,ce=a?ge=>{a(ge,{...x})}:void 0,J=l?ge=>{l(ge,{...x})}:void 0,fe=c?ge=>{c(ge,{...x})}:void 0,ee=u?ge=>{u(ge,{...x})}:void 0,Ee=ge=>{var xe;if(!b&&GP.includes(ge.key)&&R){const{unselectNodesAndEdges:we,addSelectedEdges:Te}=U.getState();ge.key==="Escape"?((xe=I.current)==null||xe.blur(),we({edges:[x]})):Te([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:or(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:j,selectable:R}]),onClick:X,onDoubleClick:ne,onContextMenu:ce,onMouseEnter:J,onMouseMove:fe,onMouseLeave:ee,onKeyDown:T?Ee:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${C4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!Y&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:P,markerEnd:te,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(gde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,setUpdateHover:F,setReconnecting:L})]})})}var bde=E.memo(yde);const Ede=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function n6({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Rt(Ede,In),_=rde(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(lde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(bde,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}n6.displayName="EdgeRenderer";const xde=E.memo(n6),wde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function vde({children:e}){const t=Rt(wde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function _de(e){const t=H0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const kde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Nde(e){const t=Rt(kde),n=Rn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Sde(e){return e.connection.inProgress?{...e.connection,to:Au(e.connection.to,e.transform)}:{...e.connection}}function Tde(e){return Sde}function Ade(e){const t=Tde();return Rt(t,In)}const Cde=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ide({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Rt(Cde,In);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:or(["react-flow__connection",QP(l)]),children:o.jsx(r6,{style:t,type:n,CustomComponent:r,isValid:l})})})}const r6=({style:e,type:t=Ya.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Ade();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:QP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ya.Bezier:[m]=l4(g);break;case Ya.SimpleBezier:[m]=V4(g);break;case Ya.Step:[m]=Sg({...g,borderRadius:0});break;case Ya.SmoothStep:[m]=Sg(g);break;default:[m]=u4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};r6.displayName="ConnectionLine";const Rde={};function mC(e=Rde){E.useRef(e),Rn(),E.useEffect(()=>{},[e])}function Ode(){Rn(),E.useRef(!1),E.useEffect(()=>{},[])}function s6({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,zoomOnDoubleClick:W,panOnDrag:P,autoPanOnSelection:te,onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneScroll:fe,onPaneContextMenu:ee,paneClickDistance:Ee,nodeClickDistance:ge,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ye,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G,viewport:Z,onViewportChange:he}){return mC(e),mC(t),Ode(),_de(n),Nde(Z),o.jsx(Wue,{onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneContextMenu:ee,onPaneScroll:fe,paneClickDistance:Ee,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:M,zoomOnPinch:O,zoomOnDoubleClick:W,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,panOnDrag:P,autoPanOnSelection:te,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,onViewportChange:he,isControlledViewport:!!Z,children:o.jsxs(vde,{children:[o.jsx(xde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,onlyRenderVisibleElements:R,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ye,defaultMarkerColor:C,noPanClassName:ve,disableKeyboardA11y:ct,rfId:G}),o.jsx(Ide,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(nde,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:ve,noDragClassName:ze,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}s6.displayName="GraphView";const Lde=E.memo(s6),Mde=n4(),gC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Hf;h4(g,w,y);const{nodesInitialized:k}=Ex(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const T=wh(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:S,y:R,zoom:I}=__(T,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Hf,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:au.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...XP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Mde,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},jde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Qce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:T}=m();y&&(await Lle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:T},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...gC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:T}=m(),{nodesInitialized:S,hasSelectedNodes:R}=Ex(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=T&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();h4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:T,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:j}=nce(w,b,x,_,k,N,R);j&&(Zle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const j=_.get(R),F=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(j&&N.inProgress&&N.fromNode.id===j.id){const L=yl(j,N.fromHandle,He.Left,!0);T({...N,from:L})}F&&j.parentId&&b.push({id:R,parentId:j.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(Y)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),j=I_(b,_,R,I);x.push(...j)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=O4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=L4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));_(N);return}_(mc(x,new Set([...w]),!0)),k(mc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));k(N);return}k(mc(b,new Set([...w]))),_(mc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),T=w||x,S=y||b,R=[];for(const j of T){if(!j.selected)continue;const F=_.get(j.id);F&&(F.selected=!1),R.push(Po(j.id,!1))}const I=[];for(const j of S)j.selected&&I.push(Po(j.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]),N=w.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:T}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(Ex(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:T}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return rce({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const T=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*T,y:_/2-y*T,zoom:T},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...XP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...gC()})}},Object.is);function O_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>jde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Zce,{value:m,children:o.jsx(vue,{children:p})})}function Dde({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(U0)?o.jsx(o.Fragment,{children:e}):o.jsx(O_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Pde={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Bde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onSelectionChange:Y,onSelectionDragStart:L,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onBeforeDelete:A,connectionMode:H,connectionLineType:W=Ya.Bezier,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,deleteKeyCode:ne="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:J=!1,selectionMode:fe=zf.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:Ee=Kf()?"Meta":"Control",zoomActivationKeyCode:ge=Kf()?"Meta":"Control",snapToGrid:xe,snapGrid:we,onlyRenderVisibleElements:Te=!1,selectNodesOnDrag:Re,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,nodeOrigin:ze=I4,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct=!0,defaultViewport:ht=due,minZoom:G=.5,maxZoom:Z=2,translateExtent:he=Hf,preventScrolling:De=!0,nodeExtent:qe,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:Et=!0,panOnScroll:Pt=!1,panOnScrollSpeed:Kt=.5,panOnScrollMode:Nt=rl.Free,zoomOnDoubleClick:rn=!0,panOnDrag:sn=!0,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Ae,onPaneContextMenu:pe,paneClickDistance:Je=1,nodeClickDistance:at=0,children:dn,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn=10,onNodesChange:ue,onEdgesChange:Se,noDragClassName:Ce="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ot="nopan",fitView:et,fitViewOptions:Ct,connectOnClick:Yt,attributionPosition:oe,proOptions:be,defaultEdgeOptions:ft,elevateNodesOnSelect:Ve=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:dt=!1,autoPanOnConnect:Wt,autoPanOnNodeDrag:cr,autoPanOnSelection:Yn=!0,autoPanSpeed:hn,connectionRadius:Ln,isValidConnection:Gt,onError:Jt,style:Ot,id:kn,nodeDragThreshold:Nn,connectionDragThreshold:en,viewport:tr,onViewportChange:Wn,width:pr,height:nr,colorMode:Si="light",debug:Xs,onScroll:Zr,ariaLabelConfig:Ar,zIndexMode:Ts="basic",...Qs},ka){const Ur=kn||"1",wo=mue(Si),Na=E.useCallback(Zs=>{Zs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zr==null||Zr(Zs)},[Zr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Qs,onScroll:Na,style:{...Ot,...Pde},ref:ka,className:or(["react-flow",s,wo]),id:kn,role:"application",children:o.jsxs(Dde,{nodes:e,edges:t,width:pr,height:nr,fitView:et,fitViewOptions:Ct,minZoom:G,maxZoom:Z,nodeOrigin:ze,nodeExtent:qe,zIndexMode:Ts,children:[o.jsx(pue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct,elevateNodesOnSelect:Ve,elevateEdgesOnSelect:Ke,minZoom:G,maxZoom:Z,nodeExtent:qe,onNodesChange:ue,onEdgesChange:Se,snapToGrid:xe,snapGrid:we,connectionMode:H,translateExtent:he,connectOnClick:Yt,defaultEdgeOptions:ft,fitView:et,fitViewOptions:Ct,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ot,nodeOrigin:ze,rfId:Ur,autoPanOnConnect:Wt,autoPanOnNodeDrag:cr,autoPanSpeed:hn,onError:Jt,connectionRadius:Ln,isValidConnection:Gt,selectNodesOnDrag:Re,nodeDragThreshold:Nn,connectionDragThreshold:en,onBeforeDelete:A,debug:Xs,ariaLabelConfig:Ar,zIndexMode:Ts}),o.jsx(Lde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,selectionKeyCode:ce,selectionOnDrag:J,selectionMode:fe,deleteKeyCode:ne,multiSelectionKeyCode:Ee,panActivationKeyCode:ee,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Te,defaultViewport:ht,translateExtent:he,minZoom:G,maxZoom:Z,preventScrolling:De,zoomOnScroll:Vt,zoomOnPinch:Et,zoomOnDoubleClick:rn,panOnScroll:Pt,panOnScrollSpeed:Kt,panOnScrollMode:Nt,panOnDrag:sn,autoPanOnSelection:Yn,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Ae,onPaneContextMenu:pe,paneClickDistance:Je,nodeClickDistance:at,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn,defaultMarkerColor:nt,noDragClassName:Ce,noWheelClassName:Qe,noPanClassName:ot,rfId:Ur,disableKeyboardA11y:dt,nodeExtent:qe,viewport:tr,onViewportChange:Wn}),o.jsx(uue,{onSelectionChange:Y}),dn,o.jsx(iue,{proOptions:be,position:oe}),o.jsx(sue,{rfId:Ur,disableKeyboardA11y:dt})]})})}var i6=j4(Bde);const Fde=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Ude({children:e}){const t=Rt(Fde);return t?vs.createPortal(e,t):null}function a6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>O4(s,i)),[]);return[t,n,r]}function o6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>L4(s,i)),[]);return[t,n,r]}const $de=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||!k_(n.userNode))return!1;return!0};function Hde(e={includeHiddenNodes:!1}){return Rt($de(e))}function zde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:or(["react-flow__background-pattern",n,r])})}function Vde({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:or(["react-flow__background-pattern","dots",t])})}var ao;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ao||(ao={}));const Kde={[ao.Dots]:1,[ao.Lines]:1,[ao.Cross]:6},Yde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function l6({id:e,variant:t=ao.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Rt(Yde,In),m=r||Kde[t],g=t===ao.Dots,w=t===ao.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:or(["react-flow__background",u]),style:{...c,...z0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Vde,{radius:x/2,className:d}):o.jsx(zde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}l6.displayName="Background";const c6=E.memo(l6);function Wde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Xde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Mp({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:or(["react-flow__controls-button",t]),...n,children:e})}const Zde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function u6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Rn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Rt(Zde,In),{zoomIn:x,zoomOut:_,fitView:k}=H0(),N=()=>{x(),i==null||i()},T=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs($0,{className:or(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Mp,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Wde,{})}),o.jsx(Mp,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(Gde,{})})]}),n&&o.jsx(Mp,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(qde,{})}),r&&o.jsx(Mp,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Qde,{}):o.jsx(Xde,{})}),d]})}u6.displayName="Controls";const d6=E.memo(u6);function Jde({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:or(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const efe=E.memo(Jde),tfe=e=>e.nodes.map(t=>t.id),Db=e=>e instanceof Function?e:()=>e;function nfe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=efe,onClick:a}){const l=Rt(tfe,In),c=Db(t),u=Db(e),d=Db(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(sfe,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function rfe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Rt(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=_a(w);return{node:w,x:y,y:b,width:x,height:_}},In);return!u||u.hidden||!k_(u)?null:o.jsx(l,{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 sfe=E.memo(rfe);var ife=E.memo(nfe);const afe=200,ofe=150,lfe=e=>!e.hidden,cfe=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?t4(wh(e.nodeLookup,{filter:lfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ufe="react-flow__minimap-desc";function f6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=Rn(),N=E.useRef(null),{boundingRect:T,viewBB:S,rfId:R,panZoom:I,translateExtent:j,flowWidth:F,flowHeight:Y,ariaLabelConfig:L}=Rt(cfe,In),U=(e==null?void 0:e.width)??afe,C=(e==null?void 0:e.height)??ofe,M=T.width/U,O=T.height/C,D=Math.max(M,O),A=D*U,H=D*C,W=_*D,P=T.x-(A-T.width)/2-W,te=T.y-(H-T.height)/2-W,X=A+W*2,ne=H+W*2,ce=`${ufe}-${R}`,J=E.useRef(0),fe=E.useRef();J.current=D,E.useEffect(()=>{if(N.current&&I)return fe.current=fce({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>J.current}),()=>{var xe;(xe=fe.current)==null||xe.destroy()}},[I]),E.useEffect(()=>{var xe;(xe=fe.current)==null||xe.update({translateExtent:j,width:F,height:Y,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,j,F,Y]);const ee=p?xe=>{var Re;const[we,Te]=((Re=fe.current)==null?void 0:Re.pointer(xe))||[0,0];p(xe,{x:we,y:Te})}:void 0,Ee=m?E.useCallback((xe,we)=>{const Te=k.getState().nodeLookup.get(we).internals.userNode;m(xe,Te)},[]):void 0,ge=y??L["minimap.ariaLabel"];return o.jsx($0,{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*D: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:or(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:U,height:C,viewBox:`${P} ${te} ${X} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:N,onClick:ee,children:[ge&&o.jsx("title",{id:ce,children:ge}),o.jsx(ife,{onClick:Ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-W},${te-W}h${X+W*2}v${ne+W*2}h${-X-W*2}z + M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}f6.displayName="MiniMap";const dfe=E.memo(f6),ffe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,hfe={[du.Line]:"right",[du.Handle]:"bottom-right"};function pfe({nodeId:e,position:t,variant:n=du.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=F4(),x=typeof e=="string"?e:b,_=Rn(),k=E.useRef(null),N=n===du.Handle,T=Rt(E.useCallback(ffe(N&&p),[N,p]),In),S=E.useRef(null),R=t??hfe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=Nce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,paneDomNode:C}},onChange:(j,F)=>{const{triggerNodeChanges:Y,nodeLookup:L,parentLookup:U,nodeOrigin:C}=_.getState(),M=[],O={x:j.x,y:j.y},D=L.get(x);if(D&&D.expandParent&&D.parentId){const A=D.origin??C,H=j.width??D.measured.width??0,W=j.height??D.measured.height??0,P={id:D.id,parentId:D.parentId,rect:{width:H,height:W,...r4({x:j.x??D.position.x,y:j.y??D.position.y},{width:H,height:W},D.parentId,L,A)}},te=I_([P],L,U,C);M.push(...te),O.x=j.x?Math.max(A[0]*H,j.x):void 0,O.y=j.y?Math.max(A[1]*W,j.y):void 0}if(O.x!==void 0&&O.y!==void 0){const A={id:x,type:"position",position:{...O}};M.push(A)}if(j.width!==void 0&&j.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};M.push(H)}for(const A of F){const H={...A,type:"position"};M.push(H)}Y(M)},onEnd:({width:j,height:F})=>{const Y={id:x,type:"dimensions",resizing:!1,dimensions:{width:j,height:F}};_.getState().triggerNodeChanges([Y])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var j;(j=S.current)==null||j.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:or(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(pfe);var h6=Object.defineProperty,mfe=(e,t,n)=>t in e?h6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gfe=(e,t)=>{for(var n in t)h6(e,n,{get:t[n],enumerable:!0})},yfe=(e,t,n)=>mfe(e,t+"",n),p6={};gfe(p6,{Graph:()=>qs,alg:()=>L_,json:()=>g6,version:()=>xfe});var bfe=Object.defineProperty,m6=(e,t)=>{for(var n in t)bfe(e,n,{get:t[n],enumerable:!0})},qs=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=Nd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=Efe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,yC(this._preds[i],s),yC(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?Pb(this._isDirected,e):Nd(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?Pb(this._isDirected,e):Nd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Pb(this._isDirected,e):Nd(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],bC(this._preds[a],i),bC(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 yC(e,t){e[t]?e[t]++:e[t]=1}function bC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Nd(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 Efe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function Pb(e,t){return Nd(e,t.v,t.w,t.name)}var xfe="4.0.1",g6={};m6(g6,{read:()=>kfe,write:()=>wfe});function wfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:vfe(e),edges:_fe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function vfe(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 _fe(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 kfe(e){let t=new qs(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 L_={};m6(L_,{CycleException:()=>Cg,bellmanFord:()=>y6,components:()=>Tfe,dijkstra:()=>Ag,dijkstraAll:()=>Ife,findCycles:()=>Rfe,floydWarshall:()=>Lfe,isAcyclic:()=>jfe,postorder:()=>Pfe,preorder:()=>Bfe,prim:()=>Ffe,shortestPaths:()=>Ufe,tarjan:()=>E6,topsort:()=>x6});var Nfe=()=>1;function y6(e,t,n,r){return Sfe(e,String(t),n||Nfe,r||function(s){return e.outEdges(s)})}function Sfe(e,t,n,r){let s={},i,a=0,l=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 Ag(e,t,n,r){let s=function(i){return e.outEdges(i)};return Cfe(e,String(t),n||Afe,r||s)}function Cfe(e,t,n,r){let s={},i=new b6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Ife(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Ag(e,s,t,n),r},{})}function E6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 Rfe(e){return E6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Ofe=()=>1;function Lfe(e,t,n){return Mfe(e,t||Ofe,n||function(r){return e.outEdges(r)})}function Mfe(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=w6(e,l,n==="post",a,i,r,s)}),s}function w6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=w6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function v6(e,t,n){return Dfe(e,t,n,function(r,s){return r.push(s),r},[])}function Pfe(e,t){return v6(e,t,"post")}function Bfe(e,t){return v6(e,t,"pre")}function Ffe(e,t){let n=new qs,r={},s=new b6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function Ufe(e,t,n,r){return $fe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function $fe(e,t,n,r){if(n===void 0)return Ag(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 _6(e){let t=new qs({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 EC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function kh(e){let t=Wf(N6(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 zfe(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=Pi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function Vfe(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Pi(Math.min,t),r=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function xC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),Cu(e,"border",s,t)}function Kfe(e,t=k6){let n=[];for(let r=0;rk6){let n=Kfe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function N6(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Pi(Math.max,t)}function Yfe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function S6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function T6(e,t){return t()}var Wfe=0;function M_(e){let t=++Wfe;return e+(""+t)}function Wf(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 Gfe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var K0="\0",qfe="3.0.0",Xfe=class{constructor(){yfe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return wC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&wC(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,Qfe)),n=n._prev;return"["+e.join(", ")+"]"}};function wC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Qfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Zfe=Xfe,Jfe=()=>1;function ehe(e,t){if(e.nodeCount()<=1)return[];let n=nhe(e,t||Jfe);return the(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function the(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)Bb(e,t,n,l);for(;l=i.dequeue();)Bb(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(Bb(e,t,n,l,!0)||[]);break}}}return s}function Bb(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,vx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,vx(t,n,d)}),e.removeNode(r.v),a}function nhe(e,t){let n=new qs,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=rhe(s+r+3).map(()=>new Zfe),a=r+1;return n.nodes().forEach(l=>{vx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function vx(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 rhe(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,M_("rev"))});function t(n){return r=>n.edge(r).weight}}function ihe(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 ahe(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 ohe(e){e.graph().dummyChains=[],e.edges().forEach(t=>lhe(e,t))}function lhe(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 j_(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):[],l=Pi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function hu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var A6=uhe;function uhe(e){let t=new qs({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(;dhe(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!hu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function fhe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=hu(t,r)),st.node(r).rank+=n)}var{preorder:phe,postorder:mhe}=L_,ghe=Sl;Sl.initLowLimValues=P_;Sl.initCutValues=D_;Sl.calcCutValue=C6;Sl.leaveEdge=R6;Sl.enterEdge=O6;Sl.exchangeEdges=L6;function Sl(e){e=Hfe(e),j_(e);let t=A6(e);P_(t),D_(t,e);let n,r;for(;n=R6(t);)r=O6(t,e,n),L6(t,e,n,r)}function D_(e,t){let n=mhe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>yhe(e,t,r))}function yhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=C6(e,t,n)}function C6(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 l=t.nodeEdges(n);return l&&l.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,Ehe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function P_(e,t){arguments.length<2&&(t=e.nodes()[0]),I6(e,{},1,t)}function I6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=I6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function R6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function O6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===vC(e,e.node(u.v),l)&&c!==vC(e,e.node(u.w),l)).reduce((u,d)=>hu(t,d)!e.node(s).parent);if(!n)return;let r=phe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function Ehe(e,t,n){return e.hasEdge(t,n)}function vC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var xhe=whe;function whe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":_C(e);break;case"tight-tree":_he(e);break;case"longest-path":vhe(e);break;case"none":break;default:_C(e)}}var vhe=j_;function _he(e){j_(e),A6(e)}function _C(e){ghe(e)}var khe=Nhe;function Nhe(e){let t=The(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=She(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 The(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(K0).forEach(r),t}function Ahe(e){let t=Cu(e,"root",{},"_root"),n=Che(e),r=Object.values(n),s=Pi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=Ihe(e)+1;e.children(K0).forEach(l=>M6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function M6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=xC(e,"_bt"),d=xC(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;M6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function Che(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(K0).forEach(r=>n(r,1)),t}function Ihe(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Rhe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Ohe=Lhe;function Lhe(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;iNC(e.node(t))),e.edges().forEach(t=>NC(e.edge(t)))}function NC(e){let t=e.width;e.width=e.height,e.height=t}function Dhe(e){e.nodes().forEach(t=>Fb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Fb),Object.hasOwn(r,"y")&&Fb(r)})}function Fb(e){e.y=-e.y}function Phe(e){e.nodes().forEach(t=>Ub(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Ub),Object.hasOwn(r,"x")&&Ub(r)})}function Ub(e){let t=e.x;e.x=e.y,e.y=t}function Bhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Pi(Math.max,r),i=Wf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function Fhe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function $he(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function Hhe(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 zhe(r)}function zhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Vhe(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=>Ig(s,["vs","i","barycenter","weight"]))}function Vhe(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 Khe(e,t){let n=Yfe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Yhe(!!t)),c=SC(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=SC(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function SC(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 Yhe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function D6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=$he(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=D6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&Ghe(h,p)}});let d=Hhe(u,n);Whe(d,c);let f=Khe(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function Whe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function Ghe(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 qhe(e,t,n,r){r||(r=e.nodes());let s=Xhe(e),i=new qs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function Xhe(e){let t;for(;e.hasNode(t=M_("_root")););return t}function Qhe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function P6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,P6);return}let n=N6(e),r=TC(e,Wf(1,n+1),"inEdges"),s=TC(e,Wf(n-1,-1,-1),"outEdges"),i=Bhe(e);if(AC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Zhe(u%2?r:s,u%4>=2,c),i=kh(e);let f=Fhe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return qhe(e,i,n,r.get(i)||[])})}function Zhe(e,t,n){let r=new qs;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=D6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Qhe(s,r,a.vs)})}function AC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function Jhe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=tpe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&B6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function tpe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function B6(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 npe(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 rpe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function ipe(e,t,n,r){let s=new qs,i=e.graph(),a=upe(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 ape(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=dpe(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=r-Pi(Math.min,u);a!=="l"&&(d=s-Pi(Math.max,u)),d&&(e[l]=V0(c,f=>f+d))})})}function lpe(e,t=void 0){let n=e.ul;return n?V0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function cpe(e){let t=kh(e),n=Object.assign(Jhe(e,t),epe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=rpe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=spe(e,s,c.root,c.align,l==="r");l==="r"&&(u=V0(u,d=>-d)),r[a+l]=u})});let i=ape(e,r);return ope(r,i),lpe(r,e.graph().align)}function upe(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function dpe(e,t){return e.node(t).width}function fpe(e){e=_6(e),hpe(e),Object.entries(cpe(e)).forEach(([t,n])=>e.node(t).x=n)}function hpe(e){let t=kh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function ppe(e,t={}){let n=t.debugTiming?S6:T6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>kpe(e));return n(" runLayout",()=>mpe(r,n,t)),n(" updateInputGraph",()=>gpe(e,r)),r})}function mpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>Npe(e)),t(" removeSelfEdges",()=>Mpe(e)),t(" acyclic",()=>she(e)),t(" nestingGraph.run",()=>Ahe(e)),t(" rank",()=>xhe(_6(e))),t(" injectEdgeLabelProxies",()=>Spe(e)),t(" removeEmptyRanks",()=>Vfe(e)),t(" nestingGraph.cleanup",()=>Rhe(e)),t(" normalizeRanks",()=>zfe(e)),t(" assignRankMinMax",()=>Tpe(e)),t(" removeEdgeLabelProxies",()=>Ape(e)),t(" normalize.run",()=>ohe(e)),t(" parentDummyChains",()=>khe(e)),t(" addBorderSegments",()=>Ohe(e)),t(" order",()=>P6(e,n)),t(" insertSelfEdges",()=>jpe(e)),t(" adjustCoordinateSystem",()=>Mhe(e)),t(" position",()=>fpe(e)),t(" positionSelfEdges",()=>Dpe(e)),t(" removeBorderNodes",()=>Lpe(e)),t(" normalize.undo",()=>che(e)),t(" fixupEdgeLabelCoords",()=>Rpe(e)),t(" undoCoordinateSystem",()=>jhe(e)),t(" translateGraph",()=>Cpe(e)),t(" assignNodeIntersects",()=>Ipe(e)),t(" reversePoints",()=>Ope(e)),t(" acyclic.undo",()=>ahe(e))}function gpe(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 ype=["nodesep","edgesep","ranksep","marginx","marginy"],bpe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Epe=["acyclicer","ranker","rankdir","align","rankalign"],xpe=["width","height","rank"],CC={width:0,height:0},wpe=["minlen","weight","width","height","labeloffset"],vpe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_pe=["labelpos"];function kpe(e){let t=new qs({multigraph:!0,compound:!0}),n=Hb(e.graph());return t.setGraph(Object.assign({},bpe,$b(n,ype),Ig(n,Epe))),e.nodes().forEach(r=>{let s=Hb(e.node(r)),i=$b(s,xpe);Object.keys(CC).forEach(l=>{i[l]===void 0&&(i[l]=CC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Hb(e.edge(r));t.setEdge(r,Object.assign({},vpe,$b(s,wpe),Ig(s,_pe)))}),t}function Npe(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 Spe(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};Cu(e,"edge-proxy",s,"_ep")}})}function Tpe(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 Ape(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 Cpe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function Ipe(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(EC(r,i)),n.points.push(EC(s,a))})}function Rpe(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 Ope(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Lpe(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 Mpe(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 jpe(e){kh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{Cu(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 Dpe(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function $b(e,t){return V0(Ig(e,t),Number)}function Hb(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Ppe(e){let t=kh(e),n=new qs({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Bpe={graphlib:p6,version:qfe,layout:ppe,debug:Ppe,util:{time:S6,notime:T6}},IC=Bpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const Sd={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:cl},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:LM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:NM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:kv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:h0}},_x=220,kx=88,RC=96,OC=34,tf=64,zb=310,gc=24,F6=56,Nx=40,LC=40,Fpe=18,Upe=58,$pe=!1,Hpe=e=>e==="sequential"||e==="parallel"||e==="loop";function Sx(e,t){const n=e.agentType??"llm";return Hpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Tx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!Sx(e,t))return{width:_x,height:kx};if(r&&e.subAgents.length===0)return{width:zb,height:tf};const i=e.subAgents.map((f,h)=>Tx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?F6:gc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?Fpe+LC:s==="loop"?Upe:0:LC;return u?{width:Math.max(zb,i.reduce((f,h)=>f+h.width,0)+Nx*Math.max(0,i.length-1)+c*2),height:tf+gc+l+d+gc}:{width:Math.max(zb,a+gc*2),height:tf+c+i.reduce((f,h)=>f+h.height,0)+Nx*Math.max(0,i.length-1)+d+c}}function ld(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function zpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function MC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function cd(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:ou.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 jC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=ld(f);return Sx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=ld(f),y=Tx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":Sd[g].label),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((T,S)=>Tx(T,[...f,S],t,n)),x=b.length&&g!=="parallel"?F6:gc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((T,S)=>{const R=b[S],I=_?{x:k,y:tf+gc}:{x:(y.width-R.width)/2,y:tf+k};return k+=(_?R.width:R.height)+Nx,i(T,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let T=0;T1&&s.push(cd(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=ld(f);if(Sx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||Sd[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=ld(y);s.push(cd(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=ld([]),u=l(e,[]);return s.push(cd("terminal-input",c)),u.forEach(d=>s.push(cd(d,"terminal-output"))),Vpe(r,s,t)}function Vpe(e,t,n){const r=new IC.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?RC:i.data.layoutWidth??_x,height:a?OC:i.data.layoutHeight??kx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),IC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?RC:i.data.layoutWidth??_x,u=l?OC:i.data.layoutHeight??kx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const Y0=E.createContext(null),W0=E.createContext("horizontal");function Kpe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(Y0),[h,p]=E.useState(!1),[m,g,w]=Sg({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(_h,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Ude,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(kr,{})})]})})]})}function Ype({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"llm",c=Sd[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Wpe({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(kr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(kr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(kr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(kr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Gpe({data:e}){const t=E.useContext(W0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Dr,{type:"target",position:t==="vertical"?He.Top:He.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Dr,{type:"source",position:t==="vertical"?He.Bottom:He.Right,className:"abc-handle"})]})}const qpe={agent:Ype,group:Wpe,terminal:Gpe},Xpe={insertStep:Kpe};function Qpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>jC(e,c,a),[]),[d,f,h]=a6(u.nodes),[p,m,g]=o6(u.edges),w=Hde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${MC(e)}`),b=E.useRef(null),{fitView:x}=H0(),_=E.useMemo(()=>jC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(T))})},[T,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),j=F=>N(F.matches);return I.addEventListener("change",j),()=>I.removeEventListener("change",j)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${MC(e)}`,j=I!==y.current;y.current=I,m(_.edges),f(F=>{const Y=new Map(F.map(L=>[L.id,L.position]));return _.nodes.map(L=>({...L,position:!j&&Y.get(L.id)?Y.get(L.id):L.position,selected:L.data.kind==="agent"&&!!L.data.path&&zpe(L.data.path,t)}))}),j&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(W0.Provider,{value:c,children:o.jsx(Y0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(i6,{nodes:d,edges:p,nodeTypes:qpe,edgeTypes:Xpe,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,j)=>{!a&&j.data.kind==="agent"&&j.data.path&&n(j.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(d6,{showInteractive:!1}),$pe]})})})})})}function Rg(e){return o.jsx(O_,{children:o.jsx(Qpe,{...e})})}const Zpe="doubao-seed-2-1-pro-260628",Jpe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",eme=`你是一个专业、可靠的智能助手。 + +你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 + +约束: +- 信息不足时主动提问澄清,不要臆造事实。 +- 需要时合理调用可用的工具,并说明关键结论。 +- 保持礼貌、专业的语气。`;function Wr(){return{name:"",description:Jpe,instruction:eme,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:Zpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Zc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}function tme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function nme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function U6({title:e,description:t,confirmLabel:n,cancelLabel:r="取消",closeLabel:s="关闭确认框",variant:i="warning",busy:a=!1,onCancel:l,onConfirm:c}){const u=E.useId(),d=E.useId(),f=E.useRef(null),h=E.useRef(a),p=E.useRef(l);return E.useEffect(()=>{h.current=a,p.current=l},[a,l]),E.useEffect(()=>{var y;const m=document.body.style.overflow,g=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(y=f.current)==null||y.focus();const w=b=>{b.key==="Escape"&&!h.current&&p.current()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=m,window.removeEventListener("keydown",w),g!=null&&g.isConnected&&g.focus()}},[]),vs.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&!a&&l()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${i}`,role:"alertdialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":d,"aria-busy":a||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(tme,{})}),o.jsx("h2",{id:u,children:e})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:l,disabled:a,"aria-label":s,children:o.jsx(nme,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:d,children:t})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:f,type:"button",onClick:l,disabled:a,children:r}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:c,disabled:a,children:n})]})]})}),document.body)}const rme=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],sme=[{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"}]}],ime=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function $6(e){const t=e.tools??[],n=dl.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Wr(),name:e.name,description:e.description,instruction:e.instruction||Wr().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($6)}}function ame(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?$6(e.graph):{...Wr(),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 H6(e){return e?1+e.children.reduce((t,n)=>t+H6(n),0):1}function z6(e){return 1+e.subAgents.reduce((t,n)=>t+z6(n),0)}function Ax(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function ome(e){const t=Ax(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function lme(e,t){return e.find(n=>n.kind===t)}function cme(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Og=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],ume=Og.findIndex(e=>e.phase==="build");function V6(e){if(e.status==="success")return Og.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Og.findIndex(r=>r.phase===t);return n<0?0:n}function dme(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function fme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&V6(e)===ume,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` +`),f=s?u:d.slice(-36).join(` +`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=dme(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Gs,{"aria-hidden":!0}):o.jsx(d0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function hme({task:e}){const t=V6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx($t,{className:"spin"}):e.status==="success"?o.jsx(CM,{}):e.status==="error"?o.jsx(u0,{}):o.jsx(TE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Og.map((s,i)=>{const a=e.status==="success"||inew Set),[ze,le]=E.useState(()=>new Set),[ve,ct]=E.useState(!1),[ht,G]=E.useState(""),[Z,he]=E.useState(null),[De,qe]=E.useState([]),[nt,Vt]=E.useState([]),[Et,Pt]=E.useState(!1),[Kt,Nt]=E.useState(""),[rn,sn]=E.useState(0),[_t,rt]=E.useState(!1),[Oe,gt]=E.useState(()=>new Set),[Ae,pe]=E.useState(!1),[Je,at]=E.useState(""),[dn,an]=E.useState(""),[pt,Lt]=E.useState(()=>new Set),on=E.useRef(!1),On=E.useRef(""),lr=E.useRef(null),[fn,Bt]=E.useState(sme),[Kn,ue]=E.useState("");E.useEffect(()=>{e.length!==0&&Bt(z=>z.map((se,ye)=>ye===0&&se.agentIds.length===0?{...se,agentIds:e.slice(0,2).map(Ue=>Ue.id)}:se))},[e]);const Se=E.useMemo(()=>{const z=new Map;for(const se of e)se.runtimeId&&z.set(se.runtimeId,se);return z},[e]),Ce=E.useMemo(()=>{var se;const z=new Map;for(const ye of t){const Ue=(se=ye.deploymentTarget)==null?void 0:se.runtimeId;if(!Ue||!Se.has(Ue))continue;const It=z.get(Ue);(!It||ye.updatedAt>It.updatedAt)&&z.set(Ue,ye)}return z},[Se,t]),Qe=E.useMemo(()=>{const z=new Map;for(const se of d){if(!se.runtimeId)continue;const ye=z.get(se.runtimeId);(!ye||se.startedAt>ye.startedAt)&&z.set(se.runtimeId,se)}return z},[d]),ot=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?e.filter(se=>{const ye=se.runtimeId?Ce.get(se.runtimeId):void 0,Ue=se.runtimeId?Qe.get(se.runtimeId):void 0;return[se.label,se.app,se.host??"",(ye==null?void 0:ye.draft.name)??"",(ye==null?void 0:ye.draft.description)??"",(Ue==null?void 0:Ue.runtimeName)??""].join(" ").toLowerCase().includes(z)}):e},[e,Qe,X,Ce]),et=E.useMemo(()=>{const z=X.trim().toLowerCase();return t.filter(se=>{var Ue;const ye=(Ue=se.deploymentTarget)==null?void 0:Ue.runtimeId;return ye&&Se.has(ye)?!1:z?`${se.draft.name} ${se.draft.description}`.toLowerCase().includes(z):!0})},[Se,t,X]),Ct=E.useMemo(()=>t.filter(z=>{var ye;const se=(ye=z.deploymentTarget)==null?void 0:ye.runtimeId;return!se||!Se.has(se)}).length,[Se,t]),Yt=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?fn.filter(se=>se.name.toLowerCase().includes(z)):fn},[fn,X]),oe=e.find(z=>z.id===U),be=t.find(z=>z.id===M),ft=f?d.find(z=>z.id===f):void 0,Ve=oe!=null&&oe.runtimeId?Ce.get(oe.runtimeId):void 0,Ke=g?H:U&&s===U?r:null,dt=E.useMemo(()=>{const z=new Map(e.map((ye,Ue)=>[ye.id,Ue])),se=new Map(n.map((ye,Ue)=>[ye,Ue]));return[...ot].sort((ye,Ue)=>{const It=ye.runtimeId?Qe.get(ye.runtimeId):void 0,Qt=Ue.runtimeId?Qe.get(Ue.runtimeId):void 0,Sn=(It==null?void 0:It.status)==="running"?It.startedAt:0,Mn=(Qt==null?void 0:Qt.status)==="running"?Qt.startedAt:0;if(Sn!==Mn)return Mn-Sn;const Ft=se.get(ye.id),qt=se.get(Ue.id);return Ft!=null&&qt!=null?Ft-qt:Ft!=null?-1:qt!=null?1:(z.get(ye.id)??0)-(z.get(Ue.id)??0)})},[n,e,ot,Qe]),Wt=(oe==null?void 0:oe.label)||(Ke==null?void 0:Ke.name)||(be==null?void 0:be.draft.name)||(ft==null?void 0:ft.runtimeName)||"未选择智能体",cr=fn.find(z=>z.id===Kn),Yn=dt.filter(z=>z.canDelete===!0),hn=dt.filter(z=>bt.has(z.id)&&z.canDelete===!0),Ln=et.filter(z=>ze.has(z.id)),Gt=Yn.length+et.length,Jt=hn.length+Ln.length,Ot=E.useMemo(()=>(ft==null?void 0:ft.agentDraft)??(be==null?void 0:be.draft)??(Ve==null?void 0:Ve.draft)??ame(Ke,(oe==null?void 0:oe.label)??"agent"),[Ke,oe==null?void 0:oe.label,Ve==null?void 0:Ve.draft,be==null?void 0:be.draft,ft==null?void 0:ft.agentDraft]),kn=E.useMemo(()=>{if(Ke)return Ke.tools;const z=(Ot.builtinTools??[]).map(se=>{var ye;return((ye=dl.find(Ue=>Ue.id===se))==null?void 0:ye.label)??se});return Array.from(new Set([...Ot.tools,...z,...(Ot.customTools??[]).map(se=>se.name),...(Ot.mcpTools??[]).map(se=>se.name)].filter(Boolean)))},[Ot,Ke]),Nn=E.useMemo(()=>Ke?Ke.skillsPreviewSupported?Ke.skills.map(z=>z.name):null:Array.from(new Set([...(Ot.selectedSkills??[]).map(z=>z.name),...Ot.skills].filter(Boolean))),[Ot,Ke]),en=E.useMemo(()=>{if(ft)return ft;if(be)return d.filter(z=>{var se,ye;return((se=z.agentDraft)==null?void 0:se.name)===be.draft.name||z.runtimeName===be.draft.name||!!((ye=be.deploymentTarget)!=null&&ye.runtimeId)&&z.runtimeId===be.deploymentTarget.runtimeId}).sort((z,se)=>se.startedAt-z.startedAt)[0];if(oe)return d.filter(z=>!!oe.runtimeId&&z.runtimeId===oe.runtimeId||z.runtimeName===oe.label).sort((z,se)=>se.startedAt-z.startedAt)[0]},[d,oe,be,ft]),tr=!!(f&&en&&en.id===f),Wn=!!(en&&(en.status!=="success"||tr)),pr=E.useMemo(()=>cme(Ot),[Ot]),nr=(oe==null?void 0:oe.currentVersion)??(D==null?void 0:D.currentVersion)??null,Si=nr??(ft==null?void 0:ft.startedAt)??"unknown",Xs=Ke?`runtime:${(oe==null?void 0:oe.runtimeId)??Ke.name}:v${Si}:${pr}`:`draft:${(ft==null?void 0:ft.id)??(be==null?void 0:be.id)??(oe==null?void 0:oe.id)??Wt}:${pr}`,Zr=!!(g&&(oe!=null&&oe.runtimeId)&&!P);E.useEffect(()=>{if(!f)return;const z=d.find(ye=>ye.id===f),se=z!=null&&z.runtimeId?Se.get(z.runtimeId):void 0;if(se){O(""),C(se.id),L("basic");return}C(""),O(""),L("basic")},[Se,d,f]),E.useEffect(()=>{if(!h){On.current="";return}const z=`${h}:${p}:${m}`;On.current!==z&&e.some(se=>se.id===h)&&(On.current=z,O(""),C(h),L(p),p==="evaluations"&&(J(m),ee("")))},[e,h,p,m]),E.useEffect(()=>{let z=!1;if(W(null),te(!g||!(oe!=null&&oe.runtimeId)||!oe.region),!(!g||!(oe!=null&&oe.runtimeId)||!oe.region))return jv(oe.runtimeId,oe.region,oe.runtimeApp).then(se=>{z||W(se)}).catch(()=>{z||W(null)}).finally(()=>{z||te(!0)}),()=>{z=!0}},[g,oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeApp,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(A(null),!(!(oe!=null&&oe.runtimeId)||!oe.region))return Dv(oe.runtimeId,oe.region).then(se=>{z||A(se)}).catch(()=>{z||A(null)}),()=>{z=!0}},[oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(qe([]),Vt([]),Nt(""),Y!=="evaluations"||!(oe!=null&&oe.runtimeId)||!oe.region){Pt(!1);return}return Pt(!0),WM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,pageSize:100}).then(se=>{z||(Vt(se.sets),qe(se.items.map(ye=>({...ye,tag:ye.kind==="good"?"Good case":"Bad case"})).sort((ye,Ue)=>Ax(Ue.createdAt)-Ax(ye.createdAt))))}).catch(se=>{z||Nt(se instanceof Error?se.message:String(se))}).finally(()=>{z||Pt(!1)}),()=>{z=!0}},[rn,Y,oe==null?void 0:oe.app,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(De.map(se=>se.id));gt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),Lt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),dn&&!z.has(dn)&&an("")},[De,dn]),E.useEffect(()=>{rt(!1),gt(new Set),Lt(new Set),at(""),an("")},[oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(dt.filter(se=>se.canDelete===!0).map(se=>se.id));Ze(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[dt]),E.useEffect(()=>{const z=new Set(et.map(se=>se.id));le(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[et]);const Ar=oe!=null&&oe.runtimeId?De:rme,Ts=Ar.filter(z=>{if(z.kind!==ce)return!1;const se=fe.trim().toLowerCase();return se?[z.input,z.output,z.referenceOutput,z.comment,z.tag??"",z.sessionId,z.messageId,z.userId,z.evaluationSetName].join(" ").toLowerCase().includes(se):!0}),Qs=Ts.filter(z=>Oe.has(z.id)),ka=!!(oe!=null&&oe.runtimeId),Ur=z=>{J(z),ee(""),at("");const se=Ar.find(ye=>ye.kind===z);an((se==null?void 0:se.id)??""),window.setTimeout(()=>{var ye;(ye=lr.current)==null||ye.scrollIntoView({behavior:"smooth",block:"start"})},0)},wo=z=>{at(""),gt(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},Na=()=>{at(""),gt(new Set(Ts.map(z=>z.id)))},Zs=()=>{at(""),gt(new Set),rt(!1)},Cl=z=>{Lt(se=>{const ye=new Set(se);return ye.has(z)?ye.delete(z):ye.add(z),ye})},Js=z=>{an(z.id),at(""),!(!z.sessionId||!z.messageId)&&(N==null||N(z))},Il=async z=>{if(!(oe!=null&&oe.runtimeId)||!oe.region||Ae||z.length===0)return;const se=z.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${z.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(se))return;const ye=z.map(It=>It.id),Ue=new Set(ye);pe(!0),at("");try{await GM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,itemIds:ye});const It=new Map;for(const Qt of z)It.set(Qt.kind,(It.get(Qt.kind)??0)+1);qe(Qt=>Qt.filter(Sn=>!Ue.has(Sn.id))),Vt(Qt=>Qt.map(Sn=>({...Sn,itemCount:Math.max(0,Sn.itemCount-(It.get(Sn.kind)??0))}))),gt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),Lt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),dn&&Ue.has(dn)&&an(""),z.length>1&&rt(!1),T==null||T(z)}catch(It){at(It instanceof Error?It.message:String(It))}finally{pe(!1)}},vo=z=>{Bt(se=>se.map(ye=>ye.id===z.id?z:ye))},_o=()=>{const z=new Set(e.map(Ue=>Ue.id)),se=n.filter(Ue=>z.has(Ue)),ye=new Set(se);return[...se,...e.filter(Ue=>!ye.has(Ue.id)).map(Ue=>Ue.id)]},Sa=(z,se,ye)=>{if(!y||z===se)return;const Ue=_o().filter(Sn=>Sn!==z),It=Ue.indexOf(se),Qt=It<0?Ue.length:ye==="after"?It+1:It;Ue.splice(Qt,0,z),y(Ue)},mr=(z,se)=>{if(!Ee||Ee===se)return;const ye=z.currentTarget.getBoundingClientRect();we(se),Re(z.clientY>ye.top+ye.height/2?"after":"before")},ko=(z,se)=>{if(!y)return;const ye=_o(),Ue=ye.indexOf(z),It=Math.max(0,Math.min(ye.length-1,Ue+se));Ue<0||Ue===It||(ye.splice(Ue,1),ye.splice(It,0,z),y(ye))},No=z=>{z.canDelete===!0&&(G(""),Ze(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye}))},Rl=z=>{G(""),le(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},ju=()=>{G(""),Ze(new Set(Yn.map(z=>z.id))),le(new Set(et.map(z=>z.id)))},As=()=>{G(""),Ze(new Set),le(new Set),Le(!1)},Cs=()=>{if(Jt===0||ve)return;const z=hn.length,se=Ln.length;G(""),he({kind:"selection",title:z===1&&se===0?"删除 Agent?":z===0&&se===1?"删除草稿?":"删除所选项目?",description:z===1&&se===0?`"${hn[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:z===0&&se===1?`"${Ln[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${Jt} 个项目。${z>0?`${z} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:z===0&&se===1?"删除草稿":"删除所选",agents:hn,drafts:Ln})},Ta=async()=>{if(!(!Z||ve)){ct(!0),G("");try{if(Z.kind==="selection"){const{agents:z,drafts:se}=Z;if(z.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(z)}se.length>0&&(x==null||x(se)),Ze(new Set),le(new Set),Le(!1),z.some(ye=>ye.id===U)&&C(""),se.some(ye=>ye.id===M)&&O("")}else if(Z.kind==="agent"){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b([Z.agent]),U===Z.agent.id&&C("")}else{if(!x)throw new Error("当前页面不支持删除草稿。");x([Z.draft]),M===Z.draft.id&&O("")}he(null)}catch(z){G(z instanceof Error?z.message:String(z))}finally{ct(!1)}}},Ol=z=>{!b||z.canDelete!==!0||ve||(G(""),he({kind:"agent",title:"删除 Agent?",description:`"${z.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:z}))},So=z=>{if(!x||ve)return;const se=z.draft.name||"未命名 Agent";G(""),he({kind:"draft",title:"删除草稿?",description:`"${se}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:z})},ei=()=>{const z=`eval-${Date.now()}`,se={id:z,name:`新评测组 ${fn.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Bt(ye=>[se,...ye]),ue(z)},xt=z=>{vo({...z,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+z.history.length%7,status:"completed"},...z.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:j==="library"?"is-active":"","aria-pressed":j==="library",onClick:()=>{F("library"),ne("")},children:"智能体库"}),o.jsx("button",{type:"button",className:j==="evaluation"?"is-active":"","aria-pressed":j==="evaluation",onClick:()=>{F("evaluation"),ne("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":j==="evaluation"||void 0,ref:z=>z==null?void 0:z.toggleAttribute("inert",j==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":j==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{value:X,onChange:z=>ne(z.currentTarget.value),placeholder:j==="library"?"搜索智能体":"搜索评测组","aria-label":j==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:j==="library"?S:ei,disabled:j==="library"&&!a,children:[o.jsx(kr,{"aria-hidden":!0}),o.jsx("span",{children:j==="library"?"新建 Agent":"新建评测组"})]}),j==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${Ye?" is-active":""}`,children:Ye?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Jt," 个"]}),o.jsx("button",{type:"button",onClick:ju,disabled:Gt===0||ve,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Cs(),disabled:Jt===0||ve,children:ve?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:As,disabled:ve,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{G(""),Le(!0)},disabled:Gt===0,children:"选择"})}),j==="library"&&ht&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ht}),o.jsx("div",{className:"aw-agent-list",children:j==="evaluation"?Yt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Yt.map(z=>o.jsxs("button",{type:"button",className:`aw-agent-item${z.id===Kn?" is-active":""}`,onClick:()=>ue(z.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:z.name}),o.jsxs("small",{children:[z.agentIds.length," 个智能体 · ",z.history.length," 次运行"]})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)):c&&dt.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&dt.length===0&&et.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):dt.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[et.map(z=>{const se=d.filter(Ue=>{var It,Qt;return((It=Ue.agentDraft)==null?void 0:It.name)===z.draft.name||Ue.runtimeName===z.draft.name||!!((Qt=z.deploymentTarget)!=null&&Qt.runtimeId)&&Ue.runtimeId===z.deploymentTarget.runtimeId}).sort((Ue,It)=>It.startedAt-Ue.startedAt)[0],ye=ze.has(z.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Ye?"is-selecting":"",ye?"is-selected-for-delete":"",z.id===M?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Ye?ye:void 0,onClick:()=>{if(Ye){Rl(z);return}C(""),O(z.id),L("basic")},children:[Ye&&o.jsx("span",{className:`aw-select-marker${ye?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(se==null?void 0:se.status)==="running"?" is-deploying":""}`,children:(se==null?void 0:se.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:z.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)}),dt.map(z=>{const se=z.runtimeId?Qe.get(z.runtimeId):void 0,ye=z.runtimeId?Ce.get(z.runtimeId):void 0,Ue=bt.has(z.id),It=z.canDelete===!0,Qt=(se==null?void 0:se.status)==="running"?{label:"部署中",className:" is-deploying"}:(se==null?void 0:se.status)==="error"?{label:"失败",className:" is-error"}:(se==null?void 0:se.status)==="cancelled"?{label:"已取消",className:" is-muted"}:ye?{label:"待更新",className:""}:null,Sn=(se==null?void 0:se.status)==="running"?"正在更新部署":ye?"待更新":z.remote?z.host||"远程智能体":"本地智能体",Mn=["aw-agent-item","aw-agent-item--sortable",z.id===U?"is-active":"",Ye?"is-selecting":"",Ue?"is-selected-for-delete":"",Ye&&!It?"is-selection-disabled":"",z.id===Ee?"is-dragging":"",z.id===xe&&z.id!==Ee?`is-drop-target is-drop-${Te}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!Ye,className:Mn,"aria-pressed":Ye?Ue:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ft=>{y&&(on.current=!0,ge(z.id),Ft.dataTransfer.effectAllowed="move",Ft.dataTransfer.setData("text/plain",z.id))},onDragEnter:Ft=>{mr(Ft,z.id)},onDragOver:Ft=>{!Ee||Ee===z.id||(Ft.preventDefault(),Ft.dataTransfer.dropEffect="move",mr(Ft,z.id))},onDragLeave:Ft=>{const qt=Ft.relatedTarget;qt instanceof Node&&Ft.currentTarget.contains(qt)||xe===z.id&&we("")},onDrop:Ft=>{Ft.preventDefault();const qt=Ft.dataTransfer.getData("text/plain")||Ee;Sa(qt,z.id,Te),ge(""),we(""),Re("before")},onDragEnd:()=>{ge(""),we(""),Re("before"),window.setTimeout(()=>{on.current=!1},0)},onKeyDown:Ft=>{Ft.altKey&&(Ft.key==="ArrowUp"?(Ft.preventDefault(),ko(z.id,-1)):Ft.key==="ArrowDown"&&(Ft.preventDefault(),ko(z.id,1)))},onClick:Ft=>{if(Ye){Ft.preventDefault(),No(z);return}if(on.current){Ft.preventDefault(),on.current=!1;return}O(""),C(z.id),L("basic"),_(z.id)},children:[Ye&&o.jsx("span",{className:`aw-select-marker${Ue?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.label}),z.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",z.currentVersion]}),Qt&&o.jsx("span",{className:`aw-draft-badge${Qt.className}`,children:Qt.label})]}),o.jsx("small",{children:Sn})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",j==="library"?e.length+Ct:fn.length," 个"]})]}),j==="evaluation"&&cr?o.jsx(gme,{group:cr,agents:e,cases:Ar,onChange:vo,onRun:xt}):j==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!oe&&!be&&!ft?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[oe&&!Ke&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Wt}),nr!=null&&o.jsxs("span",{children:["v",nr]}),be&&o.jsx("span",{children:"草稿"}),Ve&&o.jsx("span",{children:"待更新"}),!oe&&!be&&ft&&o.jsx("span",{children:ft.label})]}),o.jsx("p",{children:Ot.description||(i||g&&!P?"正在读取智能体信息…":"暂无描述")})]}),(be||Ve||(oe==null?void 0:oe.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(be||Ve)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const z=be??Ve;z&&So(z)},disabled:ve,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(oe==null?void 0:oe.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void Ol(oe),disabled:ve,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:ve?"删除中…":"删除 Agent"})]})]})]}),en&&Wn&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(hme,{task:en})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:ime.map(z=>o.jsx("button",{type:"button",className:Y===z.id?"is-active":"","aria-pressed":Y===z.id,onClick:()=>L(z.id),children:z.label},z.id))}),o.jsxs("div",{className:"aw-content",children:[Y==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(D==null?void 0:D.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(D==null?void 0:D.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(D==null?void 0:D.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(D==null?void 0:D.region)||(oe==null?void 0:oe.region)||(en==null?void 0:en.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:D!=null&&D.networkTypes.length?D.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:Zr?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Rg,{draft:Ot,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Xs)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(Ke==null?void 0:Ke.model)||Ot.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:Ke!=null&&Ke.graph?H6(Ke.graph):z6(Ot)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:kn.length?kn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:Nn===null?"暂不支持预览":Nn.length?Nn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:nr!=null?`v${nr}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:be?"草稿":(en==null?void 0:en.status)==="error"?"部署失败":(en==null?void 0:en.status)==="cancelled"?"已取消":Ve?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([z,se])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:z}),o.jsx("small",{children:se})]})]},z))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),Y==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[oe!=null&&oe.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(z=>{const se=lme(nt,z),ye=(se==null?void 0:se.itemCount)??De.filter(Ue=>Ue.kind===z).length;return o.jsxs("button",{type:"button",onClick:()=>Ur(z),children:[o.jsx("strong",{children:ye}),o.jsx("span",{children:z==="good"?"Good cases":"Bad cases"})]},z)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(z=>o.jsx("button",{type:"button",className:ce===z?"is-active":"","aria-pressed":ce===z,onClick:()=>J(z),children:z==="good"?"Good case":"Bad case"},z))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:fe,onChange:z=>ee(z.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),ka&&o.jsx("div",{className:`aw-case-toolbar${_t?" is-active":""}`,children:_t?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Qs.length," 条"]}),o.jsx("button",{type:"button",onClick:Na,disabled:Ts.length===0||Ae,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Il(Qs),disabled:Qs.length===0||Ae,children:Ae?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Zs,disabled:Ae,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{at(""),rt(!0)},disabled:Ts.length===0||Ae,children:"选择案例"})}),Je&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Je}),o.jsx("div",{ref:lr,children:o.jsx(mme,{cases:Ts,loading:Et,error:Kt,runtimeBacked:!!(oe!=null&&oe.runtimeId),selectionMode:_t,selectedCaseIds:Oe,focusedCaseId:dn,expandedCaseIds:pt,deleting:Ae,canDelete:ka,onOpenCase:Js,onToggleCase:wo,onToggleExpanded:Cl,onDeleteCase:z=>void Il([z]),onRetry:()=>sn(z=>z+1)})})]})]}),Y==="basic"&&(oe||be)&&o.jsxs("div",{className:"aw-basic-actions",children:[oe&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(oe.id),children:[o.jsx(cV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:be||Ve?!a:!(oe!=null&&oe.runtimeId)||!l||!i&&!Ke,onClick:()=>be?I==null?void 0:I(be):Ve?I==null?void 0:I(Ve):R(Ot),children:be||Ve?"继续编辑":"更新"})]})]})]}),j==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),Z&&o.jsx(U6,{variant:"danger",title:Z.title,description:Z.description,confirmLabel:ve?"删除中...":Z.confirmLabel,closeLabel:"关闭删除确认",busy:ve,onCancel:()=>he(null),onConfirm:()=>void Ta()})]})}function mme({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(Vi,{"aria-hidden":!0})})]}),o.jsx("small",{children:ome(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function gme({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Zz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Gs,{}),"已完成"]}),o.jsx(Hd,{"aria-hidden":!0})]},f.id))})]})})]})}const DC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],yme=100,bme=3e4,yc=new Map,Lc=new Map,Eme=new Set;function PC(e){if(!e){yc.clear(),Lc.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,r]of Lc)r.page.runtimes.some(s=>t.has(s.runtimeId))&&Lc.delete(n);yc.clear()}}function xme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function wme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function vme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _me(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function kme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function BC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:kme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function Nme(e,t,n){const r=`${e}:${t}`,s=Lc.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(BC)),s.page.nextToken;s&&Lc.delete(r);let i=yc.get(r);i||(i=Cc({scope:"mine",region:e,pageSize:yme,nextToken:t}),yc.set(r,i),i.then(()=>yc.delete(r),()=>yc.delete(r)));const a=await i;return Lc.set(r,{page:a,expiresAt:Date.now()+bme}),n(a.runtimes.map(BC)),a.nextToken}function Sme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function Tme({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s="",hiddenRuntimeIds:i=Eme}){const a=E.useRef(null),l=E.useRef(null),c=E.useRef(0),[u,d]=E.useState("general"),[f,h]=E.useState("cn-beijing"),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState([]),[x,_]=E.useState(""),[k,N]=E.useState(!0),[T,S]=E.useState(""),[R,I]=E.useState(""),j=E.useCallback((H,W)=>{const P=++c.current;return N(!0),S(""),Nme(f,H,te=>{c.current===P&&b(X=>W?te:[...X,...te])}).then(te=>{c.current===P&&_(te)}).catch(te=>{c.current===P&&S(te instanceof Error?te.message:String(te))}).finally(()=>{c.current===P&&N(!1)})},[f]);E.useEffect(()=>(b([]),_(""),j("",!0),()=>{c.current+=1}),[j]),E.useEffect(()=>{const H=l.current,W=a.current;if(!H||!W||u!=="general"||!x||k)return;const P=new IntersectionObserver(([te])=>{te.isIntersecting&&j(x,!1)},{root:W,rootMargin:"180px 0px",threshold:.01});return P.observe(H),()=>P.disconnect()},[u,j,k,x]);const F=E.useCallback(async H=>{if(!R){I(H.id);try{await new Promise(W=>requestAnimationFrame(()=>W())),await n(H)}finally{I("")}}},[R,n]),Y=E.useMemo(()=>{if(u!=="general")return[];const H=g.trim().toLocaleLowerCase(),W=H?y.filter(X=>X.name.toLocaleLowerCase().includes(H)):y,P=i.size>0?W.filter(X=>!X.runtime||!i.has(X.runtime.runtimeId)):W,te=P.findIndex(X=>{var ne;return((ne=X.runtime)==null?void 0:ne.runtimeId)===s});return te<=0?P:[P[te],...P.slice(0,te),...P.slice(te+1)]},[u,s,i,g,y]),L=DC.find(H=>H.id===u),U=(L==null?void 0:L.label)??"智能体",C=(L==null?void 0:L.createLabel)??"添加智能体",M=u==="general"&&k&&y.length===0,O=!M&&Y.length===0,D=u==="openclaw"||u==="hermes"?"暂未开放":g.trim()?"没有匹配的智能体":`${U}暂无内容`,A=u==="general"?()=>e(f):u==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:H=>{H.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(H=>!H),children:[o.jsx("span",{children:f==="cn-beijing"?"北京":"上海"}),o.jsx(vme,{className:`my-agents-region-chevron${p?" is-open":""}`})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(H=>{const W=H.value===f;return o.jsxs("button",{type:"button",role:"option","aria-selected":W,className:`my-agents-region-option${W?" is-selected":""}`,onClick:()=>{h(H.value),m(!1)},children:[o.jsx("span",{children:H.label}),W&&o.jsx(_me,{})]},H.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(xme,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:g,onChange:H=>w(H.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:DC.map(H=>o.jsx("button",{type:"button",className:`my-agent-type-pill${u===H.id?" is-active":""}`,"aria-pressed":u===H.id,onClick:()=>d(H.id),children:H.label},H.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!A,onClick:()=>A==null?void 0:A(),children:[o.jsx(wme,{}),C]})]}),o.jsxs("section",{className:"my-agent-results",ref:a,"aria-label":`${U}列表`,children:[M?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):T&&u==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T}),o.jsx("button",{type:"button",onClick:()=>void j("",!0),children:"重新加载"})]}):O?o.jsxs("div",{className:"my-agent-empty",children:[!g.trim()&&u==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(f),children:"点此创建"})]}):o.jsx("p",{children:D}),g.trim()&&u!=="openclaw"&&u!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:Y.map(H=>{var W;return o.jsx(Sme,{agent:H,onUse:F,onViewDetails:r,connecting:H.id===R,connected:((W=H.runtime)==null?void 0:W.runtimeId)===s},H.id)})}),u==="general"&&Y.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:l,"aria-live":"polite",children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):x?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const Ame={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 Cme(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 Ime(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Rme(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function B_(e,t){if(Ime(e))return Cme(t,e.path);if(Rme(e)){const n=Ame[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=B_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Ome(e,t){const n=B_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const K6=new Map;function Tl(e,t){K6.set(e,t)}function Lme(e){return K6.get(e)}function Mme(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;iB_(r,e.dataModel),resolveString:r=>Ome(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Lme(s.component)??jme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Pme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 F_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(ul,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(Tr,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(TM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(Tr,{})}):null]}):null]})}function U_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function W6(e){var n,r,s,i;const t=U_(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 G6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function q6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?ej(t,e.uri):""}function Bme({kind:e}){return e==="image"?o.jsx(_v,{}):e==="video"?o.jsx(IM,{}):e==="pdf"?o.jsx(Xz,{}):o.jsx(wv,{})}function $_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=U_(a.mimeType),c=q6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(yV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Bme,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:W6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":G6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(Ac,{className:"media-card-open"}):null]});return o.jsxs(nn.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(_M,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(Tr,{})}):null]},a.id)})}),o.jsx(di,{children:s?o.jsx(Fme,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function Fme({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>q6(t,e),[e,t]),s=U_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[W6(t),t.sizeBytes?` · ${G6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(Tr,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx($t,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(yh,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Ume(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 $me(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 X6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Hme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function zme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Vme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function Kme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Yme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function Q6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Wme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(Ea,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(Q6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Gme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Ume},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Yme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:$me},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:X6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:Hme},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:zme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Vme},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:Kme}};function qme(e){return Gme[e]}const Z6="send_a2ui_json_to_client",Xme=28;function Qme(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Zme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function J6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function Jme({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 ege(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 tge(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 e5({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=J6(c,!t||n,r),{ref:d,onScroll:f}=Pme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(Jme,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(Ea,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx($s,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function t5(){return o.jsx(e5,{text:"",done:!1})}const nge=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=J6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:s})}):null});function rge({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===Z6?"渲染 UI":e,l=qme(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 o.jsxs(nn.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(Wme,{definition:l,label:tge(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(ege,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(Ea,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(Q6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function sge({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(wv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(xv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(f0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(Tr,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function ige({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(nn.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(hT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(nn.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(hT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function H_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(e5,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(nge,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx($_,{appName:t,items:c.files},u);case"artifact":return o.jsx(sge,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(F_,{value:c.value},u);case"tool":return c.name===Z6&&c.done?null:o.jsx(rge,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(ige,{block:c,onAuth:i},u);case"a2ui":return Y6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(nn.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Dme,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function n5(e){return e.isComposing||e.keyCode===229}const age="/assets/arkclaw-DG3MhHYM.png",oge="/assets/codex-Csw-JJxq.png",lge="/assets/hermes-C6L-CfGS.png",si=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],cge=[{label:"ArkClaw",logo:age},{label:"Hermes 智能体",logo:lge}];function FC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Xc,{className:"new-chat-mode__agent-icon"})}function uge(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function dge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>si.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=si.find(k=>k.value===e)??si[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var T;(T=f.current)!=null&&T.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+si.length)%si.length;while(w(si[N]));d(N),c(si[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(si.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(si[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(FC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(si[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:si.map((k,N)=>{const T=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(FC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),T?o.jsx(uge,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:oge,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),cge.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const r5={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},fge={ppt:[],image:[],video:["video_task_query"]},z_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function UC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function hge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function pge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function mge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const gge=[{icon:hge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:pge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:mge,text:"帮我整理并润色一段内容,让表达更清晰"}],$C=[{value:"ppt",label:"PPT",icon:hV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:_v,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:X6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function yge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:T,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:j=!1,builtinTools:F=[]}){const Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null),C=E.useRef(null),[M,O]=E.useState(!1),[D,A]=E.useState(null),[H,W]=E.useState(0),[P,te]=E.useState(!1);async function X(){if(e)try{await navigator.clipboard.writeText(e),te(!0),setTimeout(()=>te(!1),1500)}catch{te(!1)}}E.useLayoutEffect(()=>{const le=Y.current;le&&(le.style.height="auto",le.style.height=`${Math.min(le.scrollHeight,200)}px`)},[s]);const ne=x==="skill-create";E.useEffect(()=>{ne&&(O(!1),A(null))},[ne]);const ce=!ne&&d.some(le=>le.status!=="ready"),J=!l&&!c&&!ce&&(s.trim().length>0||!ne&&d.length>0),fe=(D==null?void 0:D.query.toLocaleLowerCase())??"",ee=(D==null?void 0:D.kind)==="skill"?f.filter(le=>!p.skills.some(ve=>ve.name===le.name)).filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"skill",value:le})):(D==null?void 0:D.kind)==="agent"?h.filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"agent",value:le})):[];function Ee(le){var ve;O(!1),A(null),(ve=le.current)==null||ve.click()}function ge(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(le.length,le.length)})}function xe(le){S==null||S(le.value),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(s.length,s.length)})}function we(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ht,G,Z;(ht=Y.current)==null||ht.focus();const ve=le.indexOf("【"),ct=le.indexOf("】",ve+1);ve>=0&&ct>ve?(G=Y.current)==null||G.setSelectionRange(ve+1,ct):(Z=Y.current)==null||Z.setSelectionRange(le.length,le.length)})}function Te(){S==null||S(null),i(""),O(!1),A(null),requestAnimationFrame(()=>{var le,ve;(le=Y.current)==null||le.focus(),(ve=Y.current)==null||ve.setSelectionRange(0,0)})}const Re=$C.find(le=>le.value===_),Ye=$C.filter(le=>r5[le.value].every(ve=>F.includes(ve)));function Le(le,ve){const ct=le.slice(0,ve),ht=/(^|\s)([/@])([^\s/@]*)$/.exec(ct);if(!ht){A(null);return}const G=ht[2].length+ht[3].length,Z={kind:ht[2]==="/"?"skill":"agent",query:ht[3],start:ve-G,end:ve},he=!D||D.kind!==Z.kind||D.query!==Z.query||D.start!==Z.start||D.end!==Z.end;A(Z),he&&W(0),O(!1)}function bt(le){if(!D)return;const ve=s.slice(0,D.start)+s.slice(D.end);i(ve),le.kind==="skill"?w({...p,skills:[...p.skills,le.value]}):w({skills:[],targetAgent:le.value});const ct=D.start;A(null),requestAnimationFrame(()=>{var ht,G;(ht=Y.current)==null||ht.focus(),(G=Y.current)==null||G.setSelectionRange(ct,ct)})}function Ze(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function ze(le){const ve=le.target.files?Array.from(le.target.files):[];ve.length&&y(ve),le.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${ne?" composer--skill-mode":""}${Re?` composer--has-task composer--task-${Re.value}`:""}`,children:[ne?null:o.jsx(F_,{value:p,onRemoveSkill:le=>w({...p,skills:p.skills.filter(ve=>ve.name!==le)}),onRemoveAgent:()=>w({skills:[]})}),!ne&&d.length>0&&o.jsx($_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[D?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":D.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[D.kind==="skill"?o.jsx(ul,{}):o.jsx(TM,{}),o.jsx("span",{children:D.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:D.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx($t,{className:"spin"})," 正在读取 Agent 能力…"]}):ee.length===0?o.jsx("div",{className:"composer-command-empty",children:D.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:ee.map((le,ve)=>o.jsxs("button",{type:"button",role:"option","aria-selected":ve===H,className:`composer-command-item${ve===H?" is-active":""}`,onMouseDown:ct=>{ct.preventDefault(),bt(le)},onMouseEnter:()=>W(ve),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${le.kind}`,children:le.kind==="skill"?o.jsx(ul,{}):o.jsx(cl,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[le.kind==="skill"?"/":"@",le.value.name]}),o.jsx("span",{children:le.value.description||(le.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:ve===H?"↵":le.kind==="skill"?"技能":"Agent"})]},`${le.kind}-${le.value.name}`))})]}):null,ne?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{A(null),O(le=>!le)},children:o.jsx(kr,{className:"icon"})}),M&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>O(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(L),children:[o.jsx(_v,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(U),children:[o.jsx(wv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(C),children:[o.jsx(IM,{className:"icon"}),"上传视频"]})]})]})]}),N&&T?o.jsx(dge,{value:x,onChange:T,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Re&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Re.value}`,"aria-label":`取消${Re.label}任务`,disabled:c,onClick:Te,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Re.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(Tr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Re.label})]}):null,k&&ne&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(UC,{className:"new-chat-task-chip__task-icon"}),o.jsx(Tr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:Y,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:ne?`描述你想创建的 Skill,将使用 ${z_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!D,onChange:le=>{i(le.target.value),ne||Le(le.target.value,le.target.selectionStart)},onSelect:le=>{ne||Le(le.currentTarget.value,le.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:le=>{if(!n5(le.nativeEvent)){if(D){if(le.key==="ArrowDown"&&ee.length>0){le.preventDefault(),W(ve=>(ve+1)%ee.length);return}if(le.key==="ArrowUp"&&ee.length>0){le.preventDefault(),W(ve=>(ve-1+ee.length)%ee.length);return}if((le.key==="Enter"||le.key==="Tab")&&ee[H]){le.preventDefault(),bt(ee[H]);return}if(le.key==="Escape"){le.preventDefault(),A(null);return}}if(le.key==="Backspace"&&!s&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){Ze();return}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),J&&a())}}})}),o.jsx(nn.button,{type:"button",className:"comp-send",disabled:!J,onClick:a,"aria-label":"发送",whileTap:J?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx($t,{className:"icon spin"}):o.jsx(SM,{className:"icon"})})]}),k&&x==="agent"&&j&&!Re?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ye.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>xe(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le.label})]},le.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(UC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Re?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Re.label}企业提示词`,children:Re.prompts.map(le=>{const ve=Re.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>we(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le})]},le)})}):null,k&&x==="agent"&&!j&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:gge.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ge(le.text),children:[o.jsx(ve,{}),o.jsx("span",{children:le.text})]},le.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:P?"已复制":"复制会话 ID","aria-label":P?"已复制会话 ID":"复制会话 ID",onClick:()=>void X(),children:P?o.jsx(Gs,{}):o.jsx(d0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:L,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:U,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ze})]})}function s5({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(nn.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx($s,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const V_=Symbol.for("yaml.alias"),Cx=Symbol.for("yaml.document"),oo=Symbol.for("yaml.map"),i5=Symbol.for("yaml.pair"),Ki=Symbol.for("yaml.scalar"),Iu=Symbol.for("yaml.seq"),Ys=Symbol.for("yaml.node.type"),Ru=e=>!!e&&typeof e=="object"&&e[Ys]===V_,Nh=e=>!!e&&typeof e=="object"&&e[Ys]===Cx,Sh=e=>!!e&&typeof e=="object"&&e[Ys]===oo,er=e=>!!e&&typeof e=="object"&&e[Ys]===i5,bn=e=>!!e&&typeof e=="object"&&e[Ys]===Ki,Th=e=>!!e&&typeof e=="object"&&e[Ys]===Iu;function Zn(e){if(e&&typeof e=="object")switch(e[Ys]){case oo:case Iu:return!0}return!1}function Jn(e){if(e&&typeof e=="object")switch(e[Ys]){case V_:case oo:case Ki:case Iu:return!0}return!1}const a5=e=>(bn(e)||Zn(e))&&!!e.anchor,Bo=Symbol("break visit"),bge=Symbol("skip children"),nf=Symbol("remove node");function Ou(e,t){const n=Ege(t);Nh(e)?bc(null,e.contents,n,Object.freeze([e]))===nf&&(e.contents=null):bc(null,e,n,Object.freeze([]))}Ou.BREAK=Bo;Ou.SKIP=bge;Ou.REMOVE=nf;function bc(e,t,n,r){const s=xge(e,t,n,r);if(Jn(s)||er(s))return wge(e,r,s),bc(e,s,n,r);if(typeof s!="symbol"){if(Zn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>vge[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+_ge(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&&Jn(t.contents)){const i={};Ou(t.contents,(a,l)=>{Jn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` +`)}}Kr.defaultYaml={explicit:!1,version:"1.2"};Kr.defaultTags={"!!":"tag:yaml.org,2002:"};function o5(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 l5(e){const t=new Set;return Ou(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function c5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function kge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=l5(e));const a=c5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(bn(a.node)||Zn(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function Ec(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;szs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!a5(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 K_{constructor(t){Object.defineProperty(this,Ys,{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(!Nh(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},l=zs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?Ec(i,{"":l},"",l):l}}class Y_ extends K_{constructor(t){super(V_),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=[],Ou(t,{Node:(i,a)=>{(Ru(a)||a5(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 l=r.get(a);if(l||(zs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=xm(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(o5(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 xm(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(Zn(t)){let r=0;for(const s of t.items){const i=xm(e,s,n);i>r&&(r=i)}return r}else if(er(t)){const r=xm(e,t.key,n),s=xm(e,t.value,n);return Math.max(r,s)}return 1}const u5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends K_{constructor(t){super(Ki),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:zs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const Nge="tag:yaml.org,2002:";function Sge(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 Gf(e,t,n){var f,h,p;if(Nh(e)&&(e=e.contents),Jn(e))return e;if(er(e)){const m=(h=(f=n.schema[oo]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new Y_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Nge+t.slice(2));let u=Sge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[oo]:Symbol.iterator in Object(e)?a[Iu]:a[oo]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Lg(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 Gf(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 Td=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class d5 extends K_{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=>Jn(r)||er(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Td(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Zn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(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(Zn(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&&bn(i)?i.value:i:Zn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!er(n))return!1;const r=n.value;return r==null||t&&bn(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 Zn(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(Zn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Tge=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ca(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Go=(e,t,n)=>e.endsWith(` +`)?ca(n,t):n.includes(` +`)?` +`+ca(n,t):(e.endsWith(" ")?"":" ")+n,f5="flow",Ix="block",wm="quoted";function G0(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,g=-1,w=-1,y=-1;n===Ix&&(g=HC(e,g,t.length),g!==-1&&(f=g+c));for(let x;x=e[g+=1];){if(n===wm&&x==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(x===` +`)n===Ix&&(g=HC(e,g,t.length)),f=g+t.length+c,h=void 0;else{if(x===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const _=e[g+1];_&&_!==" "&&_!==` +`&&_!==" "&&(h=g)}if(g>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===wm){for(;p===" "||p===" ";)p=x,x=e[g+=1],m=!0;const _=g>y+1?g-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=x}if(m&&l&&l(),u.length===0)return e;a&&a();let b=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),X0=e=>/^(%|---|\.\.\.)/m.test(e);function Age(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 rf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(X0(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,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,l=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(Ox,`$&${u}`));let g=!1,w,y=-1;for(w=0;w{N=!0});const S=G0(`${b}${k}${p}`,u,Ix,T);if(!N)return`>${_} +${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} +${u}${b}${n}${p}`}function Cge(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` +`)||d&&/[[\]{},]/.test(i))return xc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` +`)?xc(i,t):vm(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` +`))return vm(e,t,n,r);if(X0(i)){if(c==="")return t.forceBlockIndent=!0,vm(e,t,n,r);if(l&&c===u)return xc(i,t)}const f=i.replace(/\n+/g,`$& +${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return xc(i,t)}return l?f:G0(f,c,f5,q0(t,!1))}function W_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?xc(a.value,t):vm(a,t,n,r);case yt.QUOTE_DOUBLE:return rf(a.value,t);case yt.QUOTE_SINGLE:return Rx(a.value,t);case yt.PLAIN:return Cge(a,t,n,r);default:return null}};let u=c(l);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 h5(e,t){const n=Object.assign({blockQuote:!0,commentString:Tge,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 Ige(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(bn(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 Rge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(bn(e)||Zn(e))&&e.anchor;i&&o5(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 pu(e,t,n,r){var c;if(er(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=Jn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Ige(t.doc.schema.tags,i));const a=Rge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):bn(i)?W_(i,t,n,r):i.toString(t,n,r);return a?bn(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function Oge({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Jn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Zn(e)||!Jn(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||Zn(e)||(bn(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=pu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Go(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Go(w,n.indent,u(h))),w=`? ${w} +${l}:`):(w=`${w}:`,h&&(w+=Go(w,n.indent,u(h))));let y,b,x;Jn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&bn(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&Th(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=pu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` +`:"",b){const T=u(b);N+=` +${ca(T,n.indent)}`}k===""&&!n.inFlow?N===` +`&&x&&(N=` + +`):N+=` +${n.indent}`}else if(!p&&Zn(t)){const T=k[0],S=k.indexOf(` +`),R=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let j=!1;if(R&&(T==="&"||T==="!")){let F=k.indexOf(" ");T==="&"&&F!==-1&&Fe===jp||typeof e=="symbol"&&e.description===jp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(jp)),{addToJSMap:m5}),stringify:()=>jp},Lge=(e,t)=>(ha.identify(t)||bn(t)&&(!t.type||t.type===yt.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function m5(e,t,n){const r=g5(e,n);if(Th(r))for(const s of r.items)Vb(e,t,s);else if(Array.isArray(r))for(const s of r)Vb(e,t,s);else Vb(e,t,r)}function Vb(e,t,n){const r=g5(e,n);if(!Sh(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 g5(e,t){return e&&Ru(t)?t.resolve(e.doc,e):t}function y5(e,t,{key:n,value:r}){if(Jn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Lge(e,n))m5(e,t,r);else{const s=zs(n,"",e);if(t instanceof Map)t.set(s,zs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Mge(n,s,e),a=zs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Mge(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Jn(e)&&(n!=null&&n.doc)){const r=h5(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)+'..."'),p5(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 G_(e,t,n){const r=Gf(e,void 0,n),s=Gf(t,void 0,n);return new qr(r,s)}class qr{constructor(t,n=null){Object.defineProperty(this,Ys,{value:i5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Jn(n)&&(n=n.clone(t)),Jn(r)&&(r=r.clone(t)),new qr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return y5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Oge(this,t,n,r):JSON.stringify(this)}}function b5(e,t,n){return(t.inFlow??e.flow?Dge:jge)(e,t,n)}function jge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Go(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||y.includes(` +`)),m0&&(u||(u=f.reduce((b,x)=>b+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),w&&(y+=Go(y,r,l(w))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const g of f)m+=g?` +${i}${s}${g}`:` +`;return`${m} +${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Mg({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=ca(t(r),e);n.push(i.trimStart())}}function qo(e,t){const n=bn(t)?t.value:t;for(const r of e)if(er(r)&&(r.key===t||r.key===n||bn(r.key)&&r.key.value===n))return r}class Fs extends d5{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(oo,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),l=(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(G_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;er(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new qr(t,t==null?void 0:t.value):r=new qr(t.key,t.value);const s=qo(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`);bn(s.value)&&u5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=qo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=qo(this.items,t),s=r==null?void 0:r.value;return(!n&&bn(s)?s.value:s)??void 0}has(t){return!!qo(this.items,t)}set(t,n){this.add(new qr(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)y5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!er(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})),b5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Lu={collection:"map",default:!0,nodeClass:Fs,tag:"tag:yaml.org,2002:map",resolve(e,t){return Sh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Fs.from(e,t,n)};class bl extends d5{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Iu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Dp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Dp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&bn(s)?s.value:s}has(t){const n=Dp(t);return typeof n=="number"&&n=0?t:null}const Mu={collection:"seq",default:!0,nodeClass:bl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Th(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>bl.from(e,t,n)},Q0={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),W_(e,t,n,r)}},Z0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&Z0.test.test(e)?e:t.options.nullStr},q_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&q_.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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const E5={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},x5={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)}},w5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ni},J0=e=>typeof e=="bigint"||Number.isInteger(e),X_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function v5(e,t,n){const{value:r}=e;return J0(r)&&r>=0?n+r.toString(t):Ni(e)}const _5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>X_(e,2,8,n),stringify:e=>v5(e,8,"0o")},k5={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>X_(e,0,10,n),stringify:Ni},N5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>X_(e,2,16,n),stringify:e=>v5(e,16,"0x")},Pge=[Lu,Mu,Q0,Z0,q_,_5,k5,N5,E5,x5,w5];function zC(e){return typeof e=="bigint"||Number.isInteger(e)}const Pp=({value:e})=>JSON.stringify(e),Bge=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Pp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Pp},{identify:zC,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})=>zC(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:Pp}],Fge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Uge=[Lu,Mu].concat(Bge,Fge),Q_={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 qr(new yt(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]=er(r)?r:new qr(r)}}else t("Expected a sequence for this tag");return e}function T5(e,t,n){const{replacer:r}=n,s=new bl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(G_(l,c,n))}return s}const Z_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:S5,createNode:T5};class Mc extends bl{constructor(){super(),this.add=Fs.prototype.add.bind(this),this.delete=Fs.prototype.delete.bind(this),this.get=Fs.prototype.get.bind(this),this.has=Fs.prototype.has.bind(this),this.set=Fs.prototype.set.bind(this),this.tag=Mc.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(er(s)?(i=zs(s.key,"",n),a=zs(s.value,i,n)):i=zs(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=T5(t,n,r),i=new this;return i.items=s.items,i}}Mc.tag="tag:yaml.org,2002:omap";const J_={collection:"seq",identify:e=>e instanceof Map,nodeClass:Mc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=S5(e,t),r=[];for(const{key:s}of n.items)bn(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Mc,n)},createNode:(e,t,n)=>Mc.from(e,t,n)};function A5({value:e,source:t},n){return t&&(e?C5:I5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const C5={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 yt(!0),stringify:A5},I5={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 yt(!1),stringify:A5},$ge={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},Hge={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)}},zge={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 yt(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},Ah=e=>typeof e=="bigint"||Number.isInteger(e);function ey(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 ek(e,t,n){const{value:r}=e;if(Ah(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Ni(e)}const Vge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ey(e,2,2,n),stringify:e=>ek(e,2,"0b")},Kge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ey(e,1,8,n),stringify:e=>ek(e,8,"0")},Yge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ey(e,0,10,n),stringify:Ni},Wge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ey(e,2,16,n),stringify:e=>ek(e,16,"0x")};class jc extends Fs{constructor(t){super(t),this.tag=jc.tag}add(t){let n;er(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new qr(t.key,null):n=new qr(t,null),qo(this.items,n.key)||this.items.push(n)}get(t,n){const r=qo(this.items,t);return!n&&er(r)?bn(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=qo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new qr(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(G_(a,null,r));return i}}jc.tag="tag:yaml.org,2002:set";const tk={collection:"map",identify:e=>e instanceof Set,nodeClass:jc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>jc.from(e,t,n),resolve(e,t){if(Sh(e)){if(e.hasAllNullValues(!0))return Object.assign(new jc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function nk(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function R5(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 O5={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})=>nk(e,n),stringify:R5},L5={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=>nk(e,!1),stringify:R5},ty={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(ty.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=nk(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$/,""))??""},VC=[Lu,Mu,Q0,Z0,C5,I5,Vge,Kge,Yge,Wge,$ge,Hge,zge,Q_,ha,J_,Z_,tk,O5,L5,ty],KC=new Map([["core",Pge],["failsafe",[Lu,Mu,Q0]],["json",Uge],["yaml11",VC],["yaml-1.1",VC]]),YC={binary:Q_,bool:q_,float:w5,floatExp:x5,floatNaN:E5,floatTime:L5,int:k5,intHex:N5,intOct:_5,intTime:O5,map:Lu,merge:ha,null:Z0,omap:J_,pairs:Z_,seq:Mu,set:tk,timestamp:ty},Gge={"tag:yaml.org,2002:binary":Q_,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":J_,"tag:yaml.org,2002:pairs":Z_,"tag:yaml.org,2002:set":tk,"tag:yaml.org,2002:timestamp":ty};function Kb(e,t,n){const r=KC.get(t);if(r&&!e)return n&&!r.includes(ha)?r.concat(ha):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(KC.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(ha)),s.reduce((i,a)=>{const l=typeof a=="string"?YC[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(YC).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const qge=(e,t)=>e.keyt.key?1:0;class rk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?Kb(t,"compat"):t?Kb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Gge:{},this.tags=Kb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,oo,{value:Lu}),Object.defineProperty(this,Ki,{value:Q0}),Object.defineProperty(this,Iu,{value:Mu}),this.sortMapEntries=typeof a=="function"?a:a===!0?qge:null}clone(){const t=Object.create(rk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Xge(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=h5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ca(u,""))}let a=!1,l=null;if(e.contents){if(Jn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ca(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=pu(e.contents,s,()=>l=null,u);l&&(d+=Go(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(pu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +`)?(n.push("..."),n.push(ca(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(ca(i(u),"")))}return n.join(` +`)+` +`}class Ch{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ys,{value:Cx});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(Ch.prototype,{[Ys]:{value:Cx}});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=Jn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){$l(this.contents)&&this.contents.add(t)}addIn(t,n){$l(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=l5(this);t.anchor=!n||r.has(n)?c5(n||"a",r):n}return new Y_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=kge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=Gf(t,d,m);return l&&Zn(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new qr(s,i)}delete(t){return $l(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Td(t)?this.contents==null?!1:(this.contents=null,!0):$l(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Zn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Td(t)?!n&&bn(this.contents)?this.contents.value:this.contents:Zn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Zn(this.contents)?this.contents.has(t):!1}hasIn(t){return Td(t)?this.contents!==void 0:Zn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Lg(this.schema,[t],n):$l(this.contents)&&this.contents.set(t,n)}setIn(t,n){Td(t)?this.contents=n:this.contents==null?this.contents=Lg(this.schema,Array.from(t),n):$l(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 rk(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=zs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?Ec(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 Xge(this,t)}}function $l(e){if(Zn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class M5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ad extends M5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Qge extends M5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const WC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… +`),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(l=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`: + +${a} +${u} +`}};function mu(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",p=!1,m=!1,g=null,w=null,y=null,b=null,x=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),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(w||y)&&(b=S),d=!0;break;case"anchor":w&&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),w=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{y&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),y=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(w||y)&&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){x&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=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],T=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"),g&&(u&&g.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:_,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:y,newlineAfterProp:b,end:T,start:k??T}}function qf(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(qf(t.key)||qf(t.value))return!0}return!1;default:return!0}}function Lx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&qf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function j5(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||bn(i)&&bn(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const GC="All mapping items must start at the same column";function Zge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Fs,l=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:g}=f,w=mu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",GC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` +`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||qf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",GC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Lx(r.indent,p,s),n.atKey=!1,j5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=mu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Lx(r.indent,g,s),c=k.range[2];const N=new qr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` +`+_.comment:x.comment=_.comment);const k=new qr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function e0e({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Fs:bl),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 y=0;y0){const y=Ih(m,g,n.options.strict,s);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Gb(e,t,n,r,s,i){const a=n.type==="block-map"?Zge(e,t,n,r,i):n.type==="block-seq"?Jge(e,t,n,r,i):e0e(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function t0e(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gb(e,t,n,s,a)}const u=Gb(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=Jn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function n0e(e,t,n){const r=t.offset,s=r0e(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?s0e(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` +`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let g=0;gc&&(c=w.length);else{w.length=l;--g)a[g][0].length>c&&(l=g+1);let f="",h="",p=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` +`:!p&&h===` +`&&(h=` + +`),f+=h+w.slice(c)+y,h=` +`,p=!0):y===""?h===` +`?f+=` +`:h=` +`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=l;gn(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=a0e(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=o0e(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=l0e(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=Ih(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function a0e(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}`),D5(e)}function o0e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),D5(e.slice(1,-1)).replace(/''/g,"'")}function D5(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 c0e(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 u0e={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function d0e(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 l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function P5(e,t,n,r){const{value:s,type:i,comment:a,range:l}=t.type==="block-scalar"?n0e(e,t,r):i0e(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[Ki]:c?u=f0e(e.schema,s,c,n,r):t.type==="scalar"?u=h0e(e,s,t,r):u=e.schema[Ki];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=bn(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function f0e(e,t,n,r,s){var l;if(n==="!")return e[Ki];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((l=c.test)!=null&&l.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[Ki])}function h0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[Ki];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[Ki];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function p0e(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 m0e={composeNode:B5,composeEmptyNode:sk};function B5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=g0e(e,t,r),(l||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=P5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=t0e(m0e,e,t,n,r),l&&(u.anchor=l.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=sk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!bn(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 sk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:p0e(t,n,r),indent:-1,source:""},f=P5(e,d,l,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 g0e({options:e},{offset:t,source:n,end:r},s){const i=new Y_(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,l=Ih(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function y0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new Ch(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=mu(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?B5(u,s,d,a):sk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Ih(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function ud(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 qC(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=ud(n);i?this.warnings.push(new Qge(a,r,s)):this.errors.push(new Ad(a,r,s))},this.directives=new Kr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qC(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(Zn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];er(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${r} +${l}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} +${a}`:r}}if(n){for(let i=0;i{const i=ud(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=y0e(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 Ad(ud(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 Ad(ud(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Ih(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 Ad(ud(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 Ch(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 F5="\uFEFF",U5="",$5="",Mx="";function E0e(e){switch(e){case F5:return"byte-order-mark";case U5:return"doc-mode";case $5:return"flow-error-end";case Mx: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 ii(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const XC=new Set("0123456789ABCDEFabcdef"),x0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bp=new Set(",[]{}"),w0e=new Set(` ,[]{} +\r `),qb=e=>!e||w0e.has(e);class v0e{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==="...")&&ii(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ii(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===":")&&ii(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(qb),"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=>ii(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 l=i;for(;a===" ";)a=this.buffer[--i];if(a===` +`&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield Mx,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(ii(i)||t&&Bp.has(i))break;n=r}else if(ii(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`?(r+=1,s=` +`,i=this.buffer[r+1]):n=r),i==="#"||t&&Bp.has(i))break;if(s===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Bp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Mx,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(qb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ii(r)||n&&Bp.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(;!ii(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(x0e.has(n))n=this.buffer[++t];else if(n==="%"&&XC.has(this.buffer[t+1])&&XC.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 _0e{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 jg(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"&&ZC(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&&QC(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 l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(za(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(H5(n.key)&&!za(n.sep,"newline")){const l=Hl(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:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(za(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Hl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):za(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!za(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(l);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)){jg(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||za(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=Fp(r),i=Hl(s);ZC(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={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]=l}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=Fp(t),r=Hl(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=Fp(t),r=Hl(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 N0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new _0e||null,prettyErrors:t}}function S0e(e,t={}){const{lineCounter:n,prettyErrors:r}=N0e(t),s=new k0e(n==null?void 0:n.addNewLine),i=new b0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Ad(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(WC(e,n)),a.warnings.forEach(WC(e,n))),a}function T0e(e,t,n){let r;const s=S0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>p5(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 A0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Nh(e)&&!r?e.toString(n):new Ch(e,r,n).toString(n)}const z5=new Set(["local","sqlite","mysql","postgresql"]),V5=new Set(["local","opensearch","redis","viking","mem0"]),K5=new Set(["opensearch","viking","context_search"]),Y5=new Set(["apmplus","cozeloop","tls"]),W5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),C0e=new Set(["llm","sequential","parallel","loop","a2a"]);function vt(e,t=""){return typeof e=="string"?e:t}function Bs(e){return e===!0}function sf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function G5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:vt(t.name),description:vt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Dc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function q5(e){return typeof e=="string"&&C0e.has(e)?e:"llm"}function X5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function Q5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Bs(t.enabled),registrySpaceId:vt(t.registrySpaceId),registryTopK:vt(t.registryTopK),registryRegion:vt(t.registryRegion),registryEndpoint:vt(t.registryEndpoint)}}function Z5(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=Q5(n.a2aRegistry),i=q5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Wr(),name:vt(n.name),description:vt(n.description),instruction:vt(n.instruction),agentType:a,maxIterations:X5(n.maxIterations),a2aUrl:vt(n.a2aUrl),modelName:vt(n.modelName),modelProvider:vt(n.modelProvider),modelApiBase:vt(n.modelApiBase),builtinTools:sf(n.builtinTools).filter(l=>W5.has(l)),customTools:G5(n.customTools),memory:{shortTerm:Bs(r.shortTerm),longTerm:Bs(r.longTerm)},shortTermBackend:Dc(n.shortTermBackend,z5,"local"),longTermBackend:Dc(n.longTermBackend,V5,"local"),autoSaveSession:Bs(n.autoSaveSession),knowledgebase:Bs(n.knowledgebase),knowledgebaseBackend:Dc(n.knowledgebaseBackend,K5,Zc),knowledgebaseIndex:vt(n.knowledgebaseIndex),tracing:Bs(n.tracing),tracingExporters:sf(n.tracingExporters).filter(l=>Y5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:Z5(n.subAgents),selectedSkills:J5(n)}}):[]}function J5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=vt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=vt(r.name)||vt(r.slug)||vt(r.skillName)||vt(r.skillId)||"skill",l=vt(r.folder)||a,c=vt(r.description);if(i==="skillhub"){const f=vt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:vt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=vt(m.path),w=vt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=vt(r.skillSpaceId),d=vt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:vt(r.skillSpaceName),skillId:d,version:vt(r.version)})}return t}function ik(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=Q5(t.a2aRegistry),i=q5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:vt(u.name),transport:d,url:vt(u.url),authToken:vt(u.authToken),command:vt(u.command),args:sf(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Wr(),name:vt(t.name)||"my_agent",description:vt(t.description),instruction:vt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:X5(t.maxIterations),a2aUrl:vt(t.a2aUrl),modelName:vt(t.modelName),modelProvider:vt(t.modelProvider),modelApiBase:vt(t.modelApiBase),builtinTools:sf(t.builtinTools).filter(c=>W5.has(c)),customTools:G5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Bs(n.shortTerm),longTerm:Bs(n.longTerm)},shortTermBackend:Dc(t.shortTermBackend,z5,"local"),longTermBackend:Dc(t.longTermBackend,V5,"local"),autoSaveSession:Bs(t.autoSaveSession),knowledgebase:Bs(t.knowledgebase),knowledgebaseBackend:Dc(t.knowledgebaseBackend,K5,Zc),knowledgebaseIndex:vt(t.knowledgebaseIndex),tracing:Bs(t.tracing),tracingExporters:sf(t.tracingExporters).filter(c=>Y5.has(c)),deployment:{feishuEnabled:Bs(r.feishuEnabled)},subAgents:Z5(t.subAgents),selectedSkills:J5(t)}}function eB(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||Ei.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||Ei.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||Ei.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),(l=e.modelName)!=null&&l.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,T,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(T=_.authToken)!=null&&T.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(eB)),t}function I0e(e){return`# VeADK Agent 结构配置 +# 可在「创建 Agent」页通过「导入 YAML」重新载入。 +`+A0e(eB(e))}function R0e(e){const t=T0e(e);return ik(t)}const O0e=[{kind:"custom",icon:SV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:uV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:iV,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:TV,title:"工作流",desc:"敬请期待",disabled:!0}];function L0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=O0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(R0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(s5,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(kV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const M0e="modulepreload",j0e=function(e){return"/"+e},JC={},Pc=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=j0e(c),c in JC)return;JC[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":M0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function tB(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 D0e(e,t){return tB([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function nB(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 eI(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const P0e="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",B0e=(()=>{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 F0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Dn(e,t){e.push(t&255,t>>>8&255)}function hs(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const tI=2048,Xb=20,nI=0;function U0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=F0e(g),y=g.length,b=[];hs(b,67324752),Dn(b,Xb),Dn(b,tI),Dn(b,nI),Dn(b,0),Dn(b,0),hs(b,w),hs(b,y),hs(b,y),Dn(b,m.length),Dn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];hs(m,33639248),Dn(m,Xb),Dn(m,Xb),Dn(m,tI),Dn(m,nI),Dn(m,0),Dn(m,0),hs(m,p.crc),hs(m,p.size),hs(m,p.size),Dn(m,p.nameBytes.length),Dn(m,0),Dn(m,0),Dn(m,0),Dn(m,0),hs(m,0),hs(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];hs(c,101010256),Dn(c,0),Dn(c,0),Dn(c,r.length),Dn(c,r.length),hs(c,l),hs(c,i),Dn(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 $0e=E.lazy(()=>Pc(()=>import("./CodeEditor-DdBhy0vU.js"),[]));function H0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function z0e(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 rB({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>H0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return z0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx($s,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(RM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return vs.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(Tr,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx($0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function V0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(bv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(rB,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Dg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx($t,{className:"spin"}):o.jsx(EV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(fV,{}):o.jsx(Ac,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(Gs,{}):o.jsx(d0,{})})]})]})}const K0e=5e4;function Y0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` +`),r=t.split(` +`),s=Math.min(n.length,r.length,260);for(let i=s;i>0;i-=1){const a=n.slice(-i).join(` +`),l=r.slice(0,i).join(` +`);if(a===l){const c=r.slice(i).join(` +`);return c?`${e} +${c}`:e}}return`${e} +${t}`}function W0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` +`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function rI(e,t,n=K0e){const r=Y0e((e==null?void 0:e.text)??"",t.text??""),s=W0e(r,n),i=s.text?s.text.split(` +`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}ls.registerLanguage("python",cD);ls.registerLanguage("typescript",wD);ls.registerLanguage("javascript",rD);ls.registerLanguage("json",sD);ls.registerLanguage("yaml",vD);ls.registerLanguage("markdown",lD);ls.registerLanguage("bash",Q3);ls.registerLanguage("ini",Z3);ls.registerLanguage("dockerfile",yJ);ls.registerLanguage("makefile",oD);const G0e=E.lazy(()=>Pc(()=>import("./CodeEditor-DdBhy0vU.js"),[])),Da=()=>{};function q0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?vs.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(_V,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(Tr,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const X0e={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"},sI={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function iI(e){return e.replace(/&/g,"&").replace(//g,">")}function Q0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(sI[n])return sI[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 X0e[s]??null}function Z0e(e,t){try{const n=Q0e(t);return n&&ls.getLanguage(n)?ls.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?ls.highlightAuto(e).value:iI(e)}catch{return iI(e)}}const J0e=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],eye=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function tye(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function nye(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 rye(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function sye({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[vs.createPortal(e,n.left),vs.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function ny({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:T,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:j,deployDisabled:F=!1}){var fn,Bt,Kn;const Y=typeof l=="function",L=f.includes("更新"),U=j?eye:J0e,[C,M]=E.useState(((Bt=(fn=e==null?void 0:e.files)==null?void 0:fn[0])==null?void 0:Bt.path)??null),[O,D]=E.useState(new Set),[A,H]=E.useState(!1),[W,P]=E.useState(""),[te,X]=E.useState(!1),[ne,ce]=E.useState(!1),[J,fe]=E.useState(!1),[ee,Ee]=E.useState(!1),[ge,xe]=E.useState(null),[we,Te]=E.useState(null),[Re,Ye]=E.useState({}),[Le,bt]=E.useState(null),[Ze,ze]=E.useState(!1),[le,ve]=E.useState([]),[ct,ht]=E.useState(!1),[G,Z]=E.useState(!1),he=E.useRef(!0),De=ue=>o.jsxs("div",{className:"pp-network-region",onKeyDown:Se=>{Se.key==="Escape"&&Z(!1)},children:[ue&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":G,disabled:te||L||!T,onClick:()=>Z(Se=>!Se),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(yv,{className:`pp-region-chevron${G?" is-open":""}`})]}),G&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(Se=>{const Ce=Se.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":Ce,className:`pp-region-option${Ce?" is-selected":""}`,onClick:()=>{T==null||T(Se.value),Z(!1)},children:[o.jsx("span",{children:Se.label}),Ce&&o.jsx(Gs,{"aria-hidden":"true"})]},Se.value)})})]})]});E.useEffect(()=>(he.current=!0,()=>{he.current=!1}),[]),E.useEffect(()=>{if(!J)return;const ue=document.body.style.overflow;document.body.style.overflow="hidden";const Se=Ce=>{Ce.key==="Escape"&&fe(!1)};return window.addEventListener("keydown",Se),()=>{document.body.style.overflow=ue,window.removeEventListener("keydown",Se)}},[J]);const qe=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:tye(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const nt=e.files.find(ue=>ue.path===C)??null,Vt=(_==null?void 0:_.mode)??"public",Et=D0e(g?[...y,...ed]:y,b),Pt=Et.length+le.length;function Kt(ue){D(Se=>{const Ce=new Set(Se);return Ce.has(ue)?Ce.delete(ue):Ce.add(ue),Ce})}function Nt(ue,Se){l&&(l({...e,files:ue}),Se!==void 0&&M(Se))}function rn(ue){nt&&Nt(e.files.map(Se=>Se.path===nt.path?{...Se,content:ue}:Se))}function sn(){const ue=W.trim();if(H(!1),P(""),!!ue){if(e.files.some(Se=>Se.path===ue)){M(ue);return}Nt([...e.files,{path:ue,content:""}],ue)}}function _t(){if(!nt)return;const ue=window.prompt("重命名文件",nt.path),Se=ue==null?void 0:ue.trim();!Se||Se===nt.path||e.files.some(Ce=>Ce.path===Se)||Nt(e.files.map(Ce=>Ce.path===nt.path?{...Ce,path:Se}:Ce),Se)}function rt(){var Se;if(!nt)return;const ue=e.files.filter(Ce=>Ce.path!==nt.path);Nt(ue,((Se=ue[0])==null?void 0:Se.path)??null)}function Oe(ue,Se){ve(Ce=>Ce.map(Qe=>Qe.id===ue?{...Qe,...Se}:Qe))}function gt(ue){ve(Se=>Se.filter(Ce=>Ce.id!==ue))}function Ae(){ve(ue=>[...ue,rye()])}function pe(ue){k&&k(ue==="public"?void 0:{..._??{mode:ue},mode:ue})}function Je(ue){k==null||k({..._??{mode:"private"},...ue})}function at(){const ue=new Map(le.map(Ce=>({key:Ce.key.trim(),value:Ce.value})).filter(Ce=>Ce.key.length>0).map(Ce=>[Ce.key,Ce.value])),Se=g?[...y,...ed]:y;for(const Ce of nB(Se,b))ue.set(Ce.key,Ce.value);return[...ue].map(([Ce,Qe])=>({key:Ce,value:Qe}))}async function dn(){if(!(!w||te||ee)){xe(null),Ee(!0);try{await w(!g)}catch(ue){he.current&&xe(`更新飞书配置失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{he.current&&Ee(!1)}}}async function an(){var Se;if(!c||te||F)return;if(Vt!=="public"&&!((Se=_==null?void 0:_.vpcId)!=null&&Se.trim())){xe("使用 VPC 网络时,请填写 VPC ID。");return}const ue=eI(y,b);if(ue){const Ce=y.find(Qe=>Qe.key===ue.key);xe(`请返回配置页填写 ${(Ce==null?void 0:Ce.comment)||(Ce==null?void 0:Ce.key)}(${Ce==null?void 0:Ce.key})。`);return}if(g){const Ce=eI(ed,b);if(Ce){const Qe=ed.find(ot=>ot.key===Ce.key);xe(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}ce(!0)}async function pt(){if(!c||te)return;ce(!1);const ue=at();he.current&&(xe(null),Te(null),Ye({}),bt(null),X(!0));const Se=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Ce=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ot={id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ot),p==null||p(ot);let et,Ct=ot.phase??"prepare";const Yt=Ve=>et?{...et,status:Ve,updatedAt:Date.now()}:void 0,oe=Ve=>{const Ke=Yt(Ve);return Ke?{buildLog:Ke}:{}},be=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),ft=Ve=>{if(Ct!=="build")return;const Ke=["","----- 构建失败 -----",Ve].join(` +`);return et=rI(et,{source:"code-pipeline",status:"error",text:Ke,lineCount:Ke.split(` +`).length,truncated:!1,updatedAt:Date.now()}),et};try{const Ve=await c(e,Ke=>{var dt;Ke.runtimeName&&(Ce=Ke.runtimeName),Ct=Ke.phase,Ke.buildLog?et=rI(et,Ke.buildLog):Ke.phase==="build"&&!et&&(et=be()),he.current&&(Ye(Wt=>({...Wt,[Ke.phase]:Ke})),bt(Ke.phase)),m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:Ke.phase,label:((dt=U.find(Wt=>Wt.phase===Ke.phase))==null?void 0:dt.label)??Ke.phase,message:Ke.message,pct:Ke.pct,...et?{buildLog:et}:{}})},g?{taskId:Se,im:{feishu:{enabled:!0}},envs:ue}:{taskId:Se,envs:ue});he.current&&(Te(Ve),bt(null)),m==null||m({id:Se,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...oe("complete")});try{await(d==null?void 0:d(Ve))}catch(Ke){if(!(Ke instanceof qa))throw Ke;m==null||m({id:Se,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:Ke.message,...oe("complete")})}}catch(Ve){const Ke=Ve instanceof Error?Ve.message:String(Ve);if(Ve instanceof DOMException&&Ve.name==="AbortError"){he.current&&(xe(null),bt(null)),m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...oe("complete")});return}he.current&&xe(Ke);const dt=ft(Ke),Wt=!!dt;m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:Ct,label:"部署失败",message:Wt?"构建镜像失败,详见构建日志。":Ke,...dt?{buildLog:dt}:oe("complete"),retry:an})}finally{he.current&&X(!1)}}function Lt(){ce(!1)}async function on(){if(!(!we||Ze)){ze(!0),xe(null);try{const{addConnection:ue,addRuntimeConnection:Se,remoteAppId:Ce,loadConnections:Qe}=await Pc(async()=>{const{addConnection:Ct,addRuntimeConnection:Yt,remoteAppId:oe,loadConnections:be}=await Promise.resolve().then(()=>NT);return{addConnection:Ct,addRuntimeConnection:Yt,remoteAppId:oe,loadConnections:be}},void 0),{probeRuntimeApps:ot}=await Pc(async()=>{const{probeRuntimeApps:Ct}=await Promise.resolve().then(()=>sK);return{probeRuntimeApps:Ct}},void 0);let et;if(we.runtimeId){const Ct=we.region??N,Yt=await ot(we.runtimeId,Ct)??[];et=Se(we.runtimeId,we.agentName,Ct,Yt,Yt.length>0?{[Yt[0]]:we.agentName}:void 0,we.version)}else et=await ue(we.agentName,we.url,we.apikey,"");if(et.apps.length===0)xe("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const Ct={[et.apps[0]]:we.agentName},Yt={...et,appLabels:{...et.appLabels??{},...Ct}},be=Qe().map(Ve=>Ve.id===et.id?Yt:Ve);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(be));const{registerConnections:ft}=await Pc(async()=>{const{registerConnections:Ve}=await Promise.resolve().then(()=>NT);return{registerConnections:Ve}},void 0);if(ft(be),u){const Ve=Ce(et.id,et.apps[0]);u(Ve,we.agentName)}else alert(`🎉 Agent "${we.agentName}" 已添加到左上角下拉列表!`)}}catch(ue){xe(`添加 Agent 失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ze(!1)}}}function On(){const ue=U0e(e.files),Se=URL.createObjectURL(ue),Ce=document.createElement("a");Ce.href=Se,Ce.download=`${e.name||"project"}.zip`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(Se)}function lr(ue,Se,Ce){return nye(ue).map(Qe=>{const ot=Ce?`${Ce}/${Qe.name}`:Qe.name,et=Qe.path!==void 0,Ct={paddingLeft:8+Se*14};if(et){const oe=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${oe?" pp-active":""}`,style:Ct,onClick:()=>M(Qe.path),title:Qe.path,children:[o.jsx(Qz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ot)}const Yt=O.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:Ct,onClick:()=>Kt(ot),children:[o.jsx($s,{className:`pp-ic pp-chevron${Yt?"":" pp-open"}`}),o.jsx(RM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Yt&&lr(Qe,Se+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${j?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(sye,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(gv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!j&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>fe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(Ac,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx(Gz,{className:"pp-ic"}),"导出配置文件"]}),Y&&l&&o.jsx(V0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:On,children:[o.jsx(f0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),Y&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{H(!0),P("")},children:o.jsx(qz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[A&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:W,onChange:ue=>P(ue.target.value),onBlur:sn,onKeyDown:ue=>{ue.key==="Enter"&&sn(),ue.key==="Escape"&&(H(!1),P(""))}}),e.files.length===0&&!A?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):lr(qe,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:nt==null?void 0:nt.path,children:(nt==null?void 0:nt.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:Y&&nt&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:_t,children:o.jsx(gV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:rt,children:o.jsx(Vi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:nt==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):Y?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(G0e,{value:nt.content,path:nt.path,onChange:rn})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:Z0e(nt.content,nt.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[j,!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),De(!1)]}),!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void dn(),disabled:g||te||ee||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:P0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:ee?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void dn(),disabled:!g||te||ee||!w,children:ee?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:ed.map(ue=>o.jsxs("label",{children:[o.jsxs("span",{children:[ue.comment||ue.key,ue.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:ue.key.includes("SECRET")?"password":"text",value:b[ue.key]??"",placeholder:ue.placeholder,tabIndex:g?0:-1,disabled:!g||te||!x,autoComplete:"off",onChange:Se=>x==null?void 0:x(ue.key,Se.currentTarget.value)})]},ue.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),j&&De(!0),L&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ue=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:ue,checked:Vt===ue,onChange:()=>pe(ue),disabled:te||L||!k}),o.jsx("span",{children:ue==="public"?"公网":ue==="private"?"VPC":"公网 + VPC"})]},ue))}),Vt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:te||L,onChange:ue=>Je({vpcId:ue.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:te||L,onChange:ue=>Je({subnetIds:ue.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:te||L,onChange:ue=>Je({enableSharedInternetAccess:ue.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Pt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:ct?"隐藏值":"显示值",onClick:()=>ht(ue=>!ue),children:ct?o.jsx(Yz,{className:"pp-ic"}):o.jsx(xv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:Ae,disabled:te,children:[o.jsx(kr,{className:"pp-ic"}),"添加变量"]}),(Et.length>0||le.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[Et.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[Et.length," 项"]})]}),Et.map(ue=>{const Se=ue.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:ue.key,readOnly:!0,disabled:te,"aria-label":`${ue.key} 环境变量名`}),o.jsx("input",{type:Se||ct?"text":"password",value:ue.value,placeholder:ue.required?"必填,尚未填写":"可选,尚未填写",readOnly:Se,disabled:te||!Se&&!x,autoComplete:"off","aria-label":`${ue.key} 环境变量值`,onChange:Ce=>x==null?void 0:x(ue.key,Ce.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:Se?"自动":"同步"})]},ue.key)})]}),le.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[le.length," 项"]})]}),le.map(ue=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:ue.key,placeholder:"名称",disabled:te,autoComplete:"off",onChange:Se=>Oe(ue.id,{key:Se.currentTarget.value})}),o.jsx("input",{type:ct?"text":"password",value:ue.value,placeholder:"值",disabled:te,autoComplete:"off",onChange:Se=>Oe(ue.id,{value:Se.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:te,onClick:()=>gt(ue.id),children:o.jsx(Tr,{className:"pp-ic"})})]},ue.id))]})]}),(te||we||Object.keys(Re).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:U.map((ue,Se)=>{const Ce=Le?U.findIndex(Ct=>Ct.phase===Le):-1,Qe=!!ge&&(Ce===-1?Se===0:Se===Ce);let ot;we?ot="done":Qe?ot="failed":Ce===-1?ot=te?"active":"pending":Seue.phase===Le))==null?void 0:Kn.label)??Le}阶段):`:""}${ge}`,onRetry:an,retryLabel:L?"重试更新":"重试部署"}),we&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:L?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[we.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:we.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:we.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:we.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:on,disabled:Ze,children:[Ze?o.jsx($t,{className:"pp-ic spin"}):o.jsx(MM,{className:"pp-ic"}),Ze?"连接中…":"立即对话"]}),we.consoleUrl&&o.jsxs("a",{href:we.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(Ev,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:an,disabled:te||ee||F||!!n,title:n,children:te?`${f}中…`:ge?`重试${f}`:f})})]})]}),J&&r&&vs.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:ue=>{ue.target===ue.currentTarget&&fe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>fe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(Tr,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(q0e,{open:ne,isUpdate:L,onCancel:Lt,onConfirm:()=>void pt()})]})}const aI="dogfooding",Qb="dogfooding",Zb="dogfooding_b";let iye=0;const Jb=()=>++iye;function oI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function aye(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function lI(e){const t=[],n=aye(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 Pv(ik(a))}catch{}return null}function oye({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Jb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[T,S]=E.useState(!1),[R,I]=E.useState({}),j=E.useRef(null),F=E.useRef(null),Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null);E.useEffect(()=>{const X=L.current;X&&X.scrollTo({top:X.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const X=U.current;X&&(X.style.height="auto",X.style.height=Math.min(X.scrollHeight,160)+"px")},[l]);const C=X=>a(ne=>[...ne,{id:Jb(),role:"assistant",text:X}]);async function M(){if(j.current)return j.current;const X=await sg(aI,e);return j.current=X,X}async function O(X,ne){if(ne.current)return ne.current;const ce=await sg(X,e);return ne.current=ce,ce}async function D(X,ne){if(!R[X])try{const ce=await Mv(ne);I(J=>({...J,[X]:ce.model||ne}))}catch{I(ce=>({...ce,[X]:ne}))}}async function A(X,ne,ce){const J=await O(X,ne);let fe=hi();for await(const Ee of If({appName:X,userId:e,sessionId:J,text:ce}))fe=qc(fe,Ee);const ee=oI(fe).trim();return{project:await lI(ee),finalText:ee}}const H=async(X,ne,ce)=>y0(X.name,X.files,{region:"cn-beijing",projectName:"default"},{...ce,onStage:ne}),W=async()=>{const X=l.trim();if(!(!X||u)){if(a(ne=>[...ne,{id:Jb(),role:"user",text:X}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),D("a",Qb),D("b",Zb);const ne=A(Qb,F,X).then(({project:J})=>(b(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>N(!1)),ce=A(Zb,Y,X).then(({project:J})=>(_(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>S(!1));try{const[J,fe]=await Promise.all([ne,ce]),ee=[J?`方案 A:${J.name}`:null,fe?`方案 B:${fe.name}`:null].filter(Boolean);ee.length?C(`已生成两个方案(${ee.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await M();let ce=hi();for await(const ee of If({appName:aI,userId:e,sessionId:ne,text:X}))ce=qc(ce,ee);const J=oI(ce).trim(),fe=await lI(J);fe?(m(fe),C(`已生成项目:${fe.name}(${fe.files.length} 个文件),可在右侧预览和编辑。`)):C(J||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const ce=ne instanceof Error?ne.message:String(ne);h(ce),C(`抱歉,调用智能构建助手失败:${ce}`)}finally{d(!1)}}},P=X=>{const ne=X==="a"?y:x;if(!ne)return;m(ne),w(!1),b(null),_(null),N(!1),S(!1);const ce=X==="a"?"A":"B",J=X==="a"?R.a:R.b;C(`已采用方案 ${ce}(${J??(X==="a"?Qb:Zb)}),可继续编辑。`)},te=X=>{X.key==="Enter"&&!X.shiftKey&&!X.nativeEvent.isComposing&&(X.preventDefault(),W())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:L,children:[o.jsx(di,{initial:!1,children:i.map(X=>o.jsxs(nn.div,{className:`ic-turn ic-turn--${X.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[X.role==="assistant"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:X.role==="assistant"?o.jsx(yh,{text:X.text}):X.text})]},X.id))}),u&&o.jsxs(nn.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(u0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:X=>c(X.target.value),onKeyDown:te,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void W(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(xV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:X=>w(X.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(cI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>P("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(cI,{side:"b",project:x,loading:T,model:R.b,onAdopt:()=>P("b")})]}):p?o.jsx(ny,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(Jz,{className:"ic-preview-empty-glyph"}),o.jsx(ul,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function cI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx($t,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(ny,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const lye=/^[A-Za-z_][A-Za-z0-9_]*$/;function Bc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":lye.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function sB(e){const t=new Set,n=new Set,r=s=>{Bc(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function cye({className:e,...t}){return o.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:[o.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"}),o.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 dd={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:cye},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:eV},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:vV},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:kv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:h0}},uye=[dd.llm,dd.sequential,dd.parallel,dd.loop,dd.a2a],iB=e=>e==="sequential"||e==="parallel"||e==="loop",ry=e=>e==="a2a";function Ws(e){return e.trimEnd().replace(/[。.]+$/,"")}function Pg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function Oo(e,t){return e[t]|e[t+1]<<8}function zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function dye(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 aB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(zl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=Oo(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=zl(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=Oo(e,w+26),x=Oo(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await dye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const fye="/skillhub/v1/skills";async function hye(e,t="public"){const n=e.trim(),r=`${fye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:bi(void 0,wu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function pye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await hye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(Cf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(Cf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const jx=/(^|\/)skill\.md$/i;function mye(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 yye(...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 bye(e,t){return t.trim()||e}function oB(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 Eye(e){const t=new Map,n=new Set;for(const r of e)if(jx.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=jx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function xye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>jx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=mye(s.text),a=yye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:bye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function wye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await aB(t)).map(s=>({path:s.name,text:s.text}));return lB(oB(r),e.name)}async function vye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function kye(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 cB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await _ye(e),path:n}];if(!e.isDirectory)return[];const r=await kye(e);return(await Promise.all(r.map(s=>cB(s,n)))).flat()}function Nye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const T=[...x.errors];if(k.length>0&&T.push(`已跳过重复技能:${k.join("、")}`),r(T),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>cB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await wye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(k.map(({file:S,path:R})=>[S,R]));g(await vye(k.map(({file:S})=>S),T))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(vv,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function Sye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Ij();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Rj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=eY(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${Ws(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:tY(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(Ev,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Hz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function Tye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Aye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Tye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Cye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Iye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Cye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const uI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function e1(e){let t=0;for(let n=0;n>>0;return uI[t%uI.length]}function Rye(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)),l=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:l,total:c-l||1}}function Oye(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 dI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const Lye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function fI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:Lye(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function uB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=bj(t,n);else if(e)_=tj(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,T)=>N.start_time<=T.start_time?N:T).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>Rye(i??[]),[i]),w=E.useMemo(()=>Oye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(Tr,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx($t,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,T=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx($s,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:e1(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:dI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${T}%`,background:e1(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:e1(y.name)}}),dI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:fI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),fI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const Mye=E.lazy(()=>Pc(()=>import("./MarkdownPromptEditor-CV6FT_vP.js"),__vite__mapDeps([0,1]))),Dx="veadk.generatedAgentTestRuns";function ak(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Dx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function dB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Dx,JSON.stringify(t)):window.sessionStorage.removeItem(Dx)}catch{}}function jye(e){dB([...ak(),e])}function fd(e){dB(ak().filter(t=>t!==e))}function Dye(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 hI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:wV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:yo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Vz},{id:"tools",label:"工具",hint:"可调用的能力",icon:PM},{id:"skills",label:"技能",hint:"声明式技能",icon:ul},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:im},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:AM},{id:"review",label:"完成",hint:"预览并创建",icon:bV}];function Pye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function fB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function hB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Bye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},pI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},mI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},pB="REGISTRY_SPACE_ID",Fye=Oj.filter(e=>e.key!==pB);function mB(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())||Ei.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||Ei.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||Ei.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function gI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(Gs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:Ws(s.desc)})]})]},s.id)})})}function t1({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Ws(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:Ws(r.desc)})]},r.id)})})}function Uye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function Vl({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:Uye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function n1(e){return e.name.trim()||"未命名智能体中心"}function r1(e){return e.name.trim()||e.id||"未命名知识库"}function $ye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||Ei.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),Aye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?n1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>Pg(g,[n1(R),R.id,R.projectName])),[g,i]),T=!!(e&&!b&&Pg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=j=>{const F=j.target;F instanceof Node&&y.current&&!y.current.contains(F)&&m(!1)},I=j=>{j.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(fB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=n1(R),j=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":j,className:`cw-a2a-space-option ${j?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!T&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(hB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Hye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),Iye().then(T=>{N||r(T)}).catch(T=>{N||(r([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?r1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>Pg(h,[r1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&Pg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},T=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(fB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const T=r1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${T} (${N.id})`,onClick:()=>k(N.id),children:T},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(hB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function zye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(di,{initial:!1,children:e.map((i,a)=>o.jsxs(nn.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(Vi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(kr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function gB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Vye({s:e,onRemove:t}){let n=ul,r="火山 Find Skill 技能广场";return e.source==="local"?(n=vv,r="本地"):e.source==="skillspace"&&(n=gB,r="AgentKit Skills 中心"),o.jsxs(nn.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Ws(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(Tr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const s1=[{id:"local",label:"本地文件",icon:vv},{id:"skillspace",label:"AgentKit Skills 中心",icon:gB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:h0}];function Kye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=s1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>i1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(kr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(di,{initial:!1,children:e.map(c=>o.jsx(Vye,{s:c,onRemove:()=>l(i1(c))},i1(c)))})})]}),o.jsx(di,{children:s&&o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(Tr,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${s1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),s1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(pye,{selected:e,onChange:t}),n==="local"&&o.jsx(Nye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(Sye,{selected:e,onChange:t})]})]})]})})})]})}function i1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function hd({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:Ws(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(nn.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Yye(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 Up(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rh(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rh(i[r],s,n),{...e,subAgents:i}}function Wye(e,t){return Rh(e,t,n=>({...n,subAgents:[...n.subAgents,Wr()]}))}function Gye(e,t,n){return Rh(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Wr()),{...r,subAgents:s}})}function qye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rh(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const Px=e=>!ry(e.agentType),yI=3;function Xye(e,t,n=!1){var s;if(ry(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=Bc(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":iB(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function yB(e,t,n=[]){const r=[],s=ry(e.agentType),i=Xye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),Px(e)&&e.subAgents.forEach((a,l)=>r.push(...yB(a,t,[...n,l]))),r}function bB(e){return 1+e.subAgents.reduce((t,n)=>t+bB(n),0)}function EB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=dl.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Oj}),Object.assign(n,mB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=FE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=UE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=$E.find(d=>d.id===(i.knowledgebaseBackend??Zc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=HE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=tB(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function xB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Qye(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 wB(e){var r,s;const t=EB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...xB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(nB(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Zye(e){return JSON.stringify(wB(e))}function Bg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function wc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function Jye({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===Bg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),T=wc(b),S=!!(_&&k&&N&&n.findIndex(O=>wc(O)===T)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==Bg(r,b)),j=b.phase==="starting",F=b.phase==="ready"&&!I,Y=j||b.phase==="sending",L=F&&b.phase!=="sending"&&b.messages.some(O=>O.role==="assistant"),U=Y||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",M=j?"正在启动":I?"应用配置并重启":F||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||Y,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||Y,onClick:()=>d(b.id),children:o.jsx(Vi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Dg,{message:b.error,className:"cw-debug-error-detail"}):j?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:F?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((O,D)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${O.role}`,children:o.jsx("div",{className:"cw-debug-content",children:O.role==="user"?O.content:O.error?o.jsx(Dg,{message:O.error,className:"cw-debug-msg-error"}):O.blocks&&O.blocks.length>0?o.jsx(H_,{blocks:O.blocks,onAction:()=>{}}):O.content?O.content:D===b.messages.length-1&&b.phase==="sending"?o.jsx(t5,{}):null})},D))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:U,title:C||void 0,onClick:()=>l(b.id),children:[F||I||b.phase==="error"?o.jsx(DM,{className:"cw-i"}):o.jsx(Pye,{className:"cw-i cw-debug-run-icon"}),M]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:Y||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:O=>p(b.id,"modelName",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:O=>p(b.id,"description",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:O=>p(b.id,"instruction",O.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:vB.map(O=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(O.id),disabled:!0}),o.jsx("span",{children:O.label})]},O.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(kr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{n5(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(SM,{className:"cw-i"})})]})})]})}const bI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],vB=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function ebe({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=bI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:bI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function tbe({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var Ta,Ol,So,ei,xt,z,se,ye,Ue,It,Qt,Sn,Mn,Ft,qt;const[h,p]=E.useState(()=>r??Wr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),T=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var q;S!==T.current&&(T.current=S,(q=I.current)==null||q.call(I,h,R))},[h,R,S]);const[j,F]=E.useState("build"),[Y,L]=E.useState(!1),[U,C]=E.useState(!1),[M,O]=E.useState(0),[D,A]=E.useState(null),[H,W]=E.useState(!1),[P,te]=E.useState((a==null?void 0:a.region)??l),X=(s==null?void 0:s.generatedAgentTestRun)===!0,ne=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[ce,J]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Wr()).modelName??"",description:(r??Wr()).description,instruction:(r??Wr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[fe,ee]=E.useState("baseline"),Ee=E.useRef(1),ge=E.useRef(new Map),[xe,we]=E.useState(0),[Te,Re]=E.useState(""),[Ye,Le]=E.useState(null),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(!1),ve=E.useRef(null),[ct,ht]=E.useState("basic"),[G,Z]=E.useState(""),[he,De]=E.useState(!1),[qe,nt]=E.useState(!1),[Vt,Et]=E.useState(!1),[Pt,Kt]=E.useState(!1),[Nt,rn]=E.useState([]),sn=E.useRef(null),_t=E.useRef({});async function rt(){const q=new Set([...ge.current.values()].map(({run:Fe})=>Fe.runId)),ae=ak().filter(Fe=>!q.has(Fe));ae.length&&await Promise.all(ae.map(async Fe=>{try{await Yl(Fe),fd(Fe)}catch(We){console.warn("清理遗留调试运行失败",We)}}))}E.useEffect(()=>(rt(),()=>{for(const{run:q}of ge.current.values())Yl(q.runId).then(()=>fd(q.runId)).catch(ae=>console.warn("清理调试运行失败",ae));ge.current.clear()}),[]),E.useEffect(()=>()=>{var q;(q=ve.current)==null||q.call(ve,!1),ve.current=null},[]);const Oe=E.useRef(null);Oe.current||(Oe.current=({meta:q,children:ae})=>o.jsxs("section",{ref:Fe=>{_t.current[q.id]=Fe},id:`cw-sec-${q.id}`,"data-step-id":q.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[q.label,q.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ae]}));const gt=Yye(h,Nt)?Nt:[],Ae=Up(h,gt),pe=gt.length===0,Je=`cw-model-advanced-${gt.join("-")||"root"}`,at=`cw-a2a-registry-advanced-${gt.join("-")||"root"}`,dn=`cw-more-tool-types-${gt.join("-")||"root"}`,an=`cw-advanced-config-${gt.join("-")||"root"}`,pt=q=>p(ae=>Rh(ae,gt,Fe=>({...Fe,...q}))),Lt=(q,ae)=>p(Fe=>{var We;return{...Fe,deployment:{...Fe.deployment??{feishuEnabled:!1},envValues:{...((We=Fe.deployment)==null?void 0:We.envValues)??{},[q]:ae}}}}),on=q=>pt({a2aRegistry:{...Ae.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...q}}),On=(q,ae)=>{if(!(q in mI))return;const Fe=mI[q];on({[Fe]:ae}),Lt(q,ae)},lr=q=>{if(!(pe&&q==="a2a")){if(q==="a2a"){pt({agentType:q,a2aRegistry:{...Ae.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}pt({agentType:q,a2aRegistry:Ae.a2aRegistry?{...Ae.a2aRegistry,enabled:!1}:void 0})}},fn=(q,ae)=>{p(q),ae&&rn(ae)},Bt=async()=>{const q=m.trim();if(!(!q||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),Z("");try{const ae=await mj(q);p(ik(ae.draft)),rn([]),A(null),C(!1),Z(""),x(!0)}catch(ae){k(ae instanceof Error?ae.message:"生成 Agent 配置失败")}finally{y(!1)}}},Kn=q=>{const ae=Up(h,q);if(!Px(ae)||q.length>=yI)return;const Fe=Wye(h,q),We=Up(Fe,q).subAgents.length-1;fn(Fe,[...q,We])},ue=(q,ae)=>{const Fe=Up(h,q);if(!Px(Fe)||q.length>=yI)return;const We=Math.max(0,Math.min(ae,Fe.subAgents.length)),pn=Gye(h,q,We);fn(pn,[...q,We])},Se=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Wr()),rn([]),C(!1),Kt(!1))},Ce=q=>{if(q.length===0){Se();return}fn(qye(h,q),q.slice(0,-1))},Qe=Ae.builtinTools??[],ot=Ae.mcpTools??[],et=Ae.tracingExporters??[],Ct=Ae.selectedSkills??[],Yt=[Ae.memory.shortTerm,Ae.memory.longTerm,Ae.tracing].filter(Boolean).length,oe=q=>pt({builtinTools:Qe.includes(q)?Qe.filter(ae=>ae!==q):[...Qe,q]}),be=q=>{const ae=et.includes(q)?et.filter(Fe=>Fe!==q):[...et,q];pt({tracingExporters:ae,tracing:ae.length>0?!0:Ae.tracing})},ft=iB(Ae.agentType),Ve=ry(Ae.agentType),Ke=E.useMemo(()=>sB(h),[h]),dt=Ve?null:Bc(Ae.name)??(Ke.has(Ae.name)?"Agent 名称在当前结构中必须唯一":null),Wt=dt!==null,cr=!Ve&&Ae.description.trim().length===0,Yn=Ae.instruction.trim().length===0,hn=Ve&&!((Ta=Ae.a2aRegistry)!=null&&Ta.registrySpaceId.trim()),Ln=q=>U&&q?`is-error cw-error-shake-${M%2}`:"",Gt=E.useMemo(()=>yB(h,Ke),[h,Ke]),Jt=Gt.length===0,Ot=E.useMemo(()=>Zye(h),[h]),kn=ce.find(q=>q.id===fe)??ce[0],Nn=E.useMemo(()=>EB(h),[h]),en=E.useMemo(()=>{var q,ae,Fe,We;return{type:!0,basic:Ve?!hn:!Wt&&(ft||!Yn),model:!!((q=Ae.modelName)!=null&&q.trim()||(ae=Ae.modelProvider)!=null&&ae.trim()||(Fe=Ae.modelApiBase)!=null&&Fe.trim()),tools:Qe.length>0||ot.length>0,skills:Ct.length>0,knowledge:Ae.knowledgebase,advanced:Ae.memory.shortTerm||Ae.memory.longTerm||Ae.tracing,subagents:(((We=Ae.subAgents)==null?void 0:We.length)??0)>0,review:Jt}},[Ae,Wt,Yn,ft,Ve,Jt,Qe,ot,Ct]),Wn=ft||Ve?["type","basic"]:["type","basic","model","tools","skills","knowledge",...pe?["advanced"]:[]],pr=hI.filter(q=>Wn.includes(q.id)),nr=Wn.join("|"),Si=gt.join("."),Xs=pr.findIndex(q=>q.id===ct),Zr=q=>{var ae;(ae=_t.current[q])==null||ae.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(D)return;const q=sn.current;if(!q)return;const ae=nr.split("|");let Fe=0;const We=()=>{Fe=0;const ln=ae[ae.length-1];let jn=ae[0];if(q.scrollTop+q.clientHeight>=q.scrollHeight-2)jn=ln;else{const $n=q.getBoundingClientRect().top+24;for(const jt of ae){const Xt=_t.current[jt];if(!Xt||Xt.getBoundingClientRect().top>$n)break;jn=jt}}jn&&ht($n=>$n===jn?$n:jn)},pn=()=>{Fe||(Fe=window.requestAnimationFrame(We))};return We(),q.addEventListener("scroll",pn,{passive:!0}),window.addEventListener("resize",pn),()=>{q.removeEventListener("scroll",pn),window.removeEventListener("resize",pn),Fe&&window.cancelAnimationFrame(Fe)}},[D,nr,Si]);const Ar=()=>Jt?!0:(C(!0),O(q=>q+1),Gt[0]&&(rn(Gt[0].path),window.requestAnimationFrame(()=>Zr("basic"))),!1),Ts=async()=>{Le(null);const q=[...ge.current.values()];ge.current.clear(),we(0),J(ae=>ae.map(Fe=>({...Fe,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(q.map(async({run:ae})=>{try{await Yl(ae.runId),fd(ae.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}))},Qs=async q=>{const ae=ge.current.get(q);if(ae){ge.current.delete(q),we(ge.current.size);try{await Yl(ae.run.runId),fd(ae.run.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}},ka=q=>{const ae=ge.current.get(q),Fe=ce.find(We=>We.id===q);!ae||!Fe||Le({runId:ae.run.runId,sessionId:ae.sessionId,variantName:Fe.name})},Ur=q=>{const ae=ve.current;ve.current=null,ae==null||ae(q)},wo=()=>{ze||(Ze(!1),Ur(!1))},Na=async()=>{if(!ze){le(!0);try{await Ts(),Ze(!1),Ur(!0)}finally{le(!1)}}},Zs=async()=>j!=="validate"||xe===0?!0:ve.current?!1:new Promise(q=>{ve.current=q,Ze(!0)}),Cl=async q=>{if(await Zs()){if(Z(""),!Ar()){F("build");return}W(!0);try{const ae=q?ce.find(pn=>pn.id===q):kn;ae&&ee(ae.id);const Fe=ae?{...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction}:h,We=await Pv(xB(Fe));Fe!==h&&p(Fe),A(We),F("publish")}catch(ae){Z(ae instanceof Error?ae.message:String(ae))}finally{W(!1)}}},Js=async q=>{if(!X||H||!Ar())return;const ae=ce.find(Ut=>Ut.id===q);if(!ae||ae.phase==="starting"||ae.phase==="sending")return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=wc(ae),jn=ce.findIndex(Ut=>Ut.id===q),$n=ce.findIndex(Ut=>wc(Ut)===ln);if(!Fe||!We||!pn||$n!==jn)return;const jt=Bg(Ot,ae);J(Ut=>Ut.map(ur=>ur.id===q?{...ur,configOpen:!1,phase:"starting",messages:[],error:null}:ur)),Re("");let Xt=null;try{await Qs(q),await rt();const Ut={...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction};Xt=await gj(wB(Ut)),jye(Xt.runId);const ur=await yj(Xt.runId,"test_user");ge.current.set(q,{run:Xt,sessionId:ur}),we(ge.current.size),J(mn=>mn.map(qi=>qi.id===q?{...qi,phase:"ready",runtimeSnapshot:jt}:qi))}catch(Ut){if(Xt)try{await Yl(Xt.runId),fd(Xt.runId)}catch(ur){console.warn("清理调试运行失败",ur)}J(ur=>ur.map(mn=>mn.id===q?{...mn,phase:"error",runtimeSnapshot:"",error:Ut instanceof Error?Ut.message:String(Ut)}:mn))}},Il=async()=>{const q=Te.trim(),ae=ce.filter(We=>We.phase==="ready"&&We.runtimeSnapshot===Bg(Ot,We)&&ge.current.has(We.id));if(!q||ae.length===0)return;Re("");const Fe=new Set(ae.map(We=>We.id));J(We=>We.map(pn=>Fe.has(pn.id)?{...pn,phase:"sending",messages:[...pn.messages,{role:"user",content:q},{role:"assistant",content:"",blocks:[]}]}:pn)),await Promise.all(ae.map(async We=>{const pn=ge.current.get(We.id);if(pn)try{let ln=hi();for await(const jn of Ej({runId:pn.run.runId,userId:"test_user",sessionId:pn.sessionId,text:q})){const $n=jn.error||jn.errorMessage||jn.error_message;if(J(jt=>jt.map(Xt=>{if(Xt.id!==We.id)return Xt;const Ut=[...Xt.messages],ur={...Ut[Ut.length-1]};return $n?ur.error=String($n):(ln=qc(ln,jn),ur.content=ln.blocks.filter(mn=>mn.kind==="text").map(mn=>mn.text).join(""),ur.blocks=ln.blocks),Ut[Ut.length-1]=ur,{...Xt,messages:Ut}})),$n)break}}catch(ln){J(jn=>jn.map($n=>{if($n.id!==We.id)return $n;const jt=[...$n.messages],Xt={...jt[jt.length-1]};return Xt.error=ln instanceof Error?ln.message:String(ln),jt[jt.length-1]=Xt,{...$n,messages:jt}}))}finally{J(ln=>ln.map(jn=>jn.id===We.id?{...jn,phase:"ready"}:jn))}}))},vo=()=>{J(q=>{if(q.length>=3)return q;const ae=Ee.current++,Fe=`variant-${ae}`;return[...q,{id:Fe,name:`对照组 ${ae}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},_o=async q=>{await Qs(q),J(ae=>ae.filter(Fe=>Fe.id!==q)),fe===q&&ee("baseline")},Sa=(q,ae)=>J(Fe=>Fe.map(We=>We.id===q?{...We,...ae}:We)),mr=(q,ae,Fe)=>{Sa(q,{[ae]:Fe}),!(fe!==q||q==="baseline")&&ee("baseline")},ko=q=>{const ae=ce.find(jt=>jt.id===q);if(!ae)return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=wc(ae),jn=ce.findIndex(jt=>jt.id===q),$n=ce.findIndex(jt=>wc(jt)===ln);if(!(!Fe||!We||!pn||$n!==jn)){if(q==="baseline"){Sa(q,{configOpen:!1});return}Js(q)}},No=async(q,ae,Fe)=>{var ln;const We=(ln=h.deployment)==null?void 0:ln.network,pn=We&&We.mode&&We.mode!=="public"?{mode:We.mode,vpc_id:We.vpcId,subnet_ids:We.subnetIds,enable_shared_internet_access:We.enableSharedInternetAccess}:void 0;return y0(q.name,q.files,{region:(a==null?void 0:a.region)??P,projectName:"default",network:pn},{...Fe,onStage:ae,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},Rl=()=>{Ar()&&(J(q=>q.map(ae=>ae.id==="baseline"&&!ge.current.has(ae.id)?{...ae,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:ae)),F("validate"))},ju=async q=>{if(q==="publish"){D?F("publish"):Cl();return}if(q==="validate"){Rl();return}await Zs()&&F(q)},As=Oe.current,Cs=q=>hI.find(ae=>ae.id===q);return o.jsxs("div",{className:"cw-root",children:[o.jsx(ebe,{mode:j,agentName:Qye(h),busy:H,onChange:ju,onDiscard:f?()=>{R?L(!0):f()}:void 0}),G&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:G}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[j==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(di,{initial:!1,mode:"wait",children:b?o.jsxs(nn.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(nn.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:q=>{q.preventDefault(),Bt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:q=>g(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),Bt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Rg,{draft:h,direction:"vertical",selectedPath:gt,onSelect:rn,onAdd:Kn,onInsert:ue,onDelete:Ce}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:sn,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsx(As,{meta:Cs("type"),children:o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:uye.map(q=>{const ae=(Ae.agentType??"llm")===q.id,Fe=pe&&q.id==="a2a",We=Fe?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":q.id,className:`cw-agent-type-option ${ae?"is-on":""} ${Fe?"is-disabled":""}`,title:Fe?void 0:pI[q.id],tabIndex:Fe?0:void 0,"aria-describedby":We,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:ae,disabled:Fe,onChange:()=>lr(q.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Bye[q.id]}),o.jsx("small",{children:pI[q.id]})]}),Fe&&o.jsx("span",{id:We,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},q.id)})})}),o.jsx(As,{meta:Cs("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Ve&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Ln(Wt)}`,value:Ae.name,placeholder:"customer_service",onChange:q=>pt({name:q.target.value})}),U&&dt?o.jsx("span",{className:"cw-error-text",children:dt}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Ln(cr)}`,value:Ae.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:q=>pt({description:q.target.value})}),U&&cr?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:pe?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),ft?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Ae.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:Ae.maxIterations??3,onChange:q=>pt({maxIterations:Math.max(1,Number(q.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Ve?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx($ye,{value:((Ol=Ae.a2aRegistry)==null?void 0:Ol.registrySpaceId)??"",region:((So=Ae.a2aRegistry)==null?void 0:So.registryRegion)||Ei.region,invalid:U&&hn,onChange:q=>On(pB,q)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":qe,"aria-controls":at,onClick:()=>nt(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${qe?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:qe&&o.jsx(nn.div,{id:at,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:o.jsx(Vl,{env:Fye,values:mB(Ae.a2aRegistry,{includeDefaults:!1}),onChange:On})})}),U&&hn&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(Mye,{value:Ae.instruction,invalid:Yn,onChange:q=>pt({instruction:q})})}),U&&Yn?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!ft&&!Ve&&o.jsxs(o.Fragment,{children:[o.jsx(As,{meta:Cs("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:Ae.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:q=>pt({modelName:q.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":Je,onClick:()=>De(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:he&&o.jsxs(nn.div,{id:Je,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:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:Ae.modelProvider??"",placeholder:"openai",onChange:q=>pt({modelProvider:q.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:Ae.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:q=>pt({modelApiBase:q.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(As,{meta:Cs("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(gI,{items:dl,selected:Qe,onToggle:oe,scrollRows:6})}),o.jsx(di,{initial:!1,children:Qe.includes("run_code")&&o.jsxs(nn.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(Vl,{env:((ei=dl.find(q=>q.id==="run_code"))==null?void 0:ei.env)??[],values:((xt=h.deployment)==null?void 0:xt.envValues)??{},onChange:Lt})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Vt,"aria-controls":dn,onClick:()=>Et(q=>!q),children:[o.jsx("span",{children:"更多类型工具"}),ot.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",ot.length]}),o.jsx($s,{className:`cw-more-options-chevron ${Vt?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:Vt&&o.jsx(nn.div,{id:dn,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(zye,{tools:ot,onChange:q=>pt({mcpTools:q})})]})})})]})}),o.jsx(As,{meta:Cs("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(Kye,{selected:Ct,onChange:q=>pt({selectedSkills:q})})})}),o.jsx(As,{meta:Cs("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.knowledgebase,onChange:q=>pt({knowledgebase:q}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:im}),Ae.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(t1,{options:$E,value:Ae.knowledgebaseBackend,onChange:q=>pt({knowledgebaseBackend:q,knowledgebaseIndex:q==="viking"?Ae.knowledgebaseIndex:""})}),(Ae.knowledgebaseBackend??Zc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(Hye,{value:Ae.knowledgebaseIndex??"",onChange:q=>pt({knowledgebaseIndex:q})})]}),o.jsx(Vl,{env:((z=$E.find(q=>q.id===(Ae.knowledgebaseBackend??Zc)))==null?void 0:z.env)??[],values:((se=h.deployment)==null?void 0:se.envValues)??{},onChange:Lt})]})]})}),pe&&o.jsxs("section",{ref:q=>{_t.current.advanced=q},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Pt,"aria-controls":an,onClick:()=>Kt(q=>!q),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx($s,{className:`cw-advanced-disclosure-chevron ${Pt?"is-open":""}`,"aria-hidden":!0}),Yt>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Yt]})]}),o.jsx(di,{initial:!1,children:Pt&&o.jsxs(nn.div,{id:an,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.memory.shortTerm,onChange:q=>pt({memory:{...Ae.memory,shortTerm:q}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OM}),Ae.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(t1,{options:FE,value:Ae.shortTermBackend,onChange:q=>pt({shortTermBackend:q})}),o.jsx(Vl,{env:((ye=FE.find(q=>q.id===(Ae.shortTermBackend??"local")))==null?void 0:ye.env)??[],values:((Ue=h.deployment)==null?void 0:Ue.envValues)??{},onChange:Lt})]}),o.jsx(hd,{checked:Ae.memory.longTerm,onChange:q=>pt({memory:{...Ae.memory,longTerm:q}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:im}),Ae.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(t1,{options:UE,value:Ae.longTermBackend,onChange:q=>pt({longTermBackend:q})}),o.jsx(Vl,{env:((It=UE.find(q=>q.id===(Ae.longTermBackend??"local")))==null?void 0:It.env)??[],values:((Qt=h.deployment)==null?void 0:Qt.envValues)??{},onChange:Lt}),o.jsx(hd,{checked:!!Ae.autoSaveSession,onChange:q=>pt({autoSaveSession:q}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:im})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.tracing,onChange:q=>pt({tracing:q}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:xv}),Ae.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(gI,{items:HE,selected:et,onToggle:be}),o.jsx(Vl,{env:HE.filter(q=>et.includes(q.id)).flatMap(q=>q.env),values:((Sn=h.deployment)==null?void 0:Sn.envValues)??{},onChange:Lt})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(nn.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Xs,0)/Math.max(pr.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),pr.map(q=>{const ae=q.id===ct,Fe=en[q.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${ae?"is-active":""} ${Fe?"is-done":""}`,onClick:()=>Zr(q.id),"aria-current":ae?"step":void 0,"aria-label":q.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ae?o.jsx("span",{className:"cw-dot"}):Fe?o.jsx(Gs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:q.label})]})},q.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Rl,children:o.jsx("span",{children:"开始调试"})})]})]})]}),j==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(Jye,{enabled:X,disabledReason:ne,variants:ce,draftSnapshot:Ot,input:Te,onInput:Re,onSend:Il,onStartVariant:Js,onDeployVariant:q=>void Cl(q),onAddVariant:vo,onRemoveVariant:_o,onToggleConfig:q=>{const ae=ce.find(Fe=>Fe.id===q);ae&&Sa(q,{configOpen:!ae.configOpen})},onCompleteConfig:ko,onConfigChange:mr,onOpenTrace:ka})})}),j==="publish"&&o.jsx("div",{className:"cw-preview-body",children:D?o.jsx(ny,{embedded:!0,project:D,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:bB(h),releaseConfiguration:kn?{modelName:kn.modelName||h.modelName||"默认模型",description:kn.description,instruction:kn.instruction,optimizations:kn.optimizations.flatMap(q=>{const ae=vB.find(Fe=>Fe.id===q);return ae?[ae.label]:[]})}:void 0,onChange:A,onDeploy:No,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((Mn=h.deployment)!=null&&Mn.feishuEnabled),onFeishuEnabledChange:q=>{const ae={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:q}};p(ae)},deploymentEnv:Nn.specs,deploymentEnvValues:{...(Ft=h.deployment)==null?void 0:Ft.envValues,...Nn.fixedValues},onDeploymentEnvChange:Lt,network:(qt=h.deployment)==null?void 0:qt.network,onNetworkChange:q=>p(ae=>({...ae,deployment:{...ae.deployment??{feishuEnabled:!1},network:q}})),deployRegion:P,onDeployRegionChange:te,onExportYaml:()=>Dye(`${h.name||"agent"}.yaml`,I0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),Ye&&o.jsx(uB,{testRunId:Ye.runId,sessionId:Ye.sessionId,title:`调用链路 · ${Ye.variantName}`,onClose:()=>Le(null)}),bt&&o.jsx(U6,{variant:"warning",title:"离开调试?",description:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",confirmLabel:ze?"清理中...":"确定离开",closeLabel:"关闭离开调试确认",busy:ze,onCancel:wo,onConfirm:()=>void Na()}),Y&&o.jsx("div",{className:"confirm-scrim",onClick:()=>L(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>L(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{L(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function ea(e){return{...Wr(),...e}}const nbe=[{id:"support",icon:rV,draft:ea({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Uz,draft:ea({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:sV,draft:ea({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:bv,draft:ea({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:dV,draft:ea({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:NV,draft:ea({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[ea({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),ea({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),ea({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function rbe(e){const t=[];return e.tools.length&&t.push({icon:PM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:Fz,label:"记忆"}),e.knowledgebase&&t.push({icon:Bz,label:"知识库"}),e.tracing&&t.push({icon:Dz,label:"观测"}),e.subAgents.length&&t.push({icon:jM,label:`子Agent ${e.subAgents.length}`}),t}function sbe({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(abe,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(ibe,{onPick:r})})}function ibe({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:nbe.map((t,n)=>o.jsxs(nn.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:Ws(t.draft.description)})]},t.id))})]})}function abe({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=rbe(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(gv,{className:"icon"})," 返回模板列表"]}),o.jsxs(nn.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:Ws(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:obe(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:Ws(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx($s,{className:"icon"})]})]})]})}function obe(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const lbe=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:LM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:NM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:kv}];let Bx=0;function a1(){return Bx+=1,`node_${Bx}`}function o1(e,t,n){const r=Wr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function cbe({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Dr,{type:"target",position:He.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(cl,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Dr,{type:"source",position:He.Right,className:"wfb-handle"})]})}const ube={agentNode:cbe},EI={type:"smoothstep",markerEnd:{type:ou.ArrowClosed,width:16,height:16}};function dbe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Bx=0;const C=a1();return o1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=a6([u]),[p,m,g]=o6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>sB({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Bc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Bc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=d.length>0&&k===null&&d.every(C=>Bc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(M=>M4({...C,...EI},M)),[m]),R=E.useCallback(()=>{const C=a1(),M=d.length*28,O=o1(C,{x:80+M,y:120+M});f(D=>D.concat(O)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},j=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),D=a1(),A=o1(D,O);f(H=>H.concat(A)),y(D)},[f]),Y=E.useCallback(C=>{w&&f(M=>M.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),L=E.useCallback(()=>{w&&(f(C=>C.filter(M=>M.id!==w)),m(C=>C.filter(M=>M.source!==w&&M.target!==w)),y(null))},[w,f,m]),U=E.useCallback(()=>{if(!T)return;const C=d.map(O=>O.data.agent),M={...Wr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(M)},[T,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:lbe.map(({type:C,label:M,desc:O,Icon:D})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(D,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:M}),o.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(nV,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(cl,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(kr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:U,disabled:!T,type:"button",children:[o.jsx(ul,{className:"icon"}),"创建工作流"]}),o.jsxs(i6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:ube,defaultEdgeOptions:EI,onDrop:F,onDragOver:j,onNodeClick:(C,M)=>y(M.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(d6,{showInteractive:!1}),o.jsx(dfe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:L,title:"删除节点",children:o.jsx(Vi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(M=>M.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(cl,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function fbe(e){return o.jsx(O_,{children:o.jsx(dbe,{...e})})}const xI=50*1024*1024,Fx=800,hbe={name:"code_package",files:[]};function pbe(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 mbe(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 gbe(e){const t=e.flatMap(a=>{const l=mbe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Fx)throw new Error(`代码包文件数不能超过 ${Fx} 个。`);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 ybe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,T]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(F){const Y=++l.current;if(x(""),!F.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(F.size>xI){x("代码包不能超过 50 MB。");return}g(!0);try{const L=await aB(new Uint8Array(await F.arrayBuffer()),{maxEntries:Fx,maxUncompressedBytes:xI}),U=gbe(L);if(Y!==l.current)return;f(F.name),u({name:pbe(F.name),files:U})}catch(L){if(Y!==l.current)return;f(""),u(null),x(L instanceof Error?L.message:String(L))}finally{Y===l.current&&g(!1)}}function R(F){var L;const Y=(L=F.currentTarget.files)==null?void 0:L[0];F.currentTarget.value="",Y&&S(Y)}function I(F){var L;F.preventDefault(),y(!1);const Y=(L=F.dataTransfer.files)==null?void 0:L[0];Y&&S(Y)}async function j(F,Y,L){const U=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return y0(F.name,F.files,{region:_,projectName:"default",network:U},{...L,onStage:Y})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(ny,{project:c??hbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:j,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:T,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:F=>{F.preventDefault(),y(!0)},onDragOver:F=>F.preventDefault(),onDragLeave:F=>{F.currentTarget.contains(F.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var F;m||(F=a.current)==null||F.click()},onKeyDown:F=>{var Y;!m&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),(Y=a.current)==null||Y.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:F=>{F.stopPropagation(),p(!0)},onKeyDown:F=>F.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(rB,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const bbe=3*60*1e3,Ebe=3e3,xbe=10*60*1e3,Fg="veadk.studio.pending-update",wI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],wbe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function vbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function _be(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function kbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Fg);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(Fg),null}function l1(e,t){window.localStorage.setItem(Fg,JSON.stringify({targetVersion:e,startedAt:t}))}function $p(){window.localStorage.removeItem(Fg)}function vI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function Nbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function Sbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function _I({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function Tbe(){var Y,L;const[e]=E.useState(kbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const U=M=>{var O;M.target instanceof Node&&!((O=y.current)!=null&&O.contains(M.target))&&h(!1)},C=M=>{M.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",U),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",U),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const U=await dj(b.current||void 0,x.current||void 0);return n(U),U},[]);if(E.useEffect(()=>{let U=!0;const C=()=>{_().catch(()=>{U&&n(O=>O)})};C();const M=window.setInterval(C,bbe);return()=>{U=!1,window.clearInterval(M)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const U=window.setInterval(()=>{_().then(C=>{const M=b.current;if(M&&_be(C.currentVersion,M)||!M&&!C.available&&C.latestVersion){window.clearInterval(U),$p(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval(U),$p(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>xbe&&(window.clearInterval(U),$p(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},Ebe);return()=>window.clearInterval(U)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),l1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const U=()=>{const M=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-M)/1e3)))};U();const C=window.setInterval(U,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],T=u||((Y=N[0])==null?void 0:Y.version)||t.latestVersion,S=N.find(U=>U.version===T),R=async()=>{b.current=T,x.current=Date.now(),l1(T,x.current),s("submitting"),c(""),m("idle");try{const U=await fj(T);b.current=U.version,l1(U.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(U){if(U instanceof TypeError){c("连接已切换,正在确认新版本状态");return}$p(),s("error");const C=U instanceof Error?U.message:"Studio 更新失败";try{const M=await _();c(M.message||C)}catch{c(C)}}},I=(L=t.updateLogs)!=null&&L.length?t.updateLogs:(t.errorLog||t.progressMessage||l).split(` +`).filter(Boolean),j=async()=>{try{await navigator.clipboard.writeText(I.join(` +`)),m("copied")}catch{m("error")}},F=()=>{var U;h(!1),m("idle"),c(""),d(b.current||((U=N[0])==null?void 0:U.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var U;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((U=N[0])==null?void 0:U.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(vI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(Ea,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(vI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:wbe[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(_I,{lines:I,phase:"error",copyState:p,onCopy:()=>void j()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":vbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:wI.map((U,C)=>{const M=wI.findIndex(A=>A.id===t.progressStage),O=r==="published"||Cvoid j()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(U=>!U),onKeyDown:U=>{(U.key==="ArrowDown"||U.key==="ArrowUp")&&(U.preventDefault(),h(!0))},children:[o.jsx("span",{children:T}),o.jsx(Nbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(U=>{const C=U.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d(U.version),h(!1)},children:[o.jsx("span",{children:U.version}),C&&o.jsx(Sbe,{})]},U.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map(U=>o.jsx("li",{children:U},U))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:F,children:"重新尝试"})]})]})})]})}const Abe="/web/skill-creator";class ok extends Error{constructor(n,r){super(n);Pk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function Al(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function An(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function _B(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Oh(e,t){return fetch(Hi(`${Abe}${e}`),{...t,headers:p0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function lk(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=Al(await e.json(),"错误响应");return An(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ck(e,t){if(!e.ok)throw new ok(await lk(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Cbe(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 Ibe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Rbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=Al(t,`文件 ${n+1}`),s=An(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=_B(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Obe(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 Lbe(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=Al(t,`活动 ${n+1}`),s=An(r,"id"),i=An(r,"kind"),a=An(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=An(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 l=An(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function Mbe(e,t){const n=Al(e,`候选方案 ${t+1}`),r=An(n,"id","candidate_id","candidateId"),s=An(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:An(n,"modelLabel","model_label")??s,status:Cbe(n.status),stage:Ibe(n.stage),name:An(n,"name","skill_name","skillName"),description:An(n,"description"),skillMd:An(n,"skillMd","skill_md"),files:Rbe(n.files),activities:Lbe(n.activities),validation:Obe(n.validation),durationMs:_B(n,"elapsedMs","elapsed_ms"),error:An(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:An(n,"skill_id","skillId"),version:An(n,"version")}}function Ux(e,t=""){const n=Al(e,"Skill 创建任务"),r=An(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Mbe):[],i=An(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:An(n,"prompt")??t,status:i,candidates:s}}async function jbe(e,t){const n=await Oh("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ok(await lk(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Ux(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="",l;const c=u=>{if(!u.trim())return;const d=Al(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(An(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Ux(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Dbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`);return Ux(await ck(t,"读取 Skill 任务失败"))}async function Pbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ck(t,"清理 Skill 任务失败")}async function Bbe(e,t){var l;const n=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await lk(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 Fbe(e,t,n){const r=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=Al(await ck(r,"添加到 AgentKit 失败"),"发布结果"),i=An(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:An(s,"name"),version:An(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:An(s,"message")}}const Ube=()=>{};function $be(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 Hbe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map($be),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(H_,{blocks:t,onAction:Ube})})}const kI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},NI=12e4;function zbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Vbe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function Kbe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Ybe({candidate:e}){var c,u;const[t,n]=E.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,NI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>NI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function Wbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),T=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",j=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(zbe,{status:n.status})}),R?o.jsx(Ea,{duration:2.2,spread:16,children:kI[n.stage]}):o.jsx("span",{children:kI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Hbe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var F;return(F=S.current)==null?void 0:F.focus()})},children:[o.jsx(Vbe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var F;return(F=T.current)==null?void 0:F.focus()})},children:[o.jsx(Kbe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(j==null?void 0:j.valid)===!1?"is-invalid":"is-valid",children:(j==null?void 0:j.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,j&&(j.errors.length>0||j.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...j.errors,...j.warnings].map((F,Y)=>o.jsx("div",{children:F},`${F}-${Y}`))]}):null,o.jsx(Ybe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Bbe(t,n.id).catch(F=>{w(F instanceof Error?F.message:String(F))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:F=>{F.preventDefault();const Y=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:Y,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:F=>b(F.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:F=>_(F.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:F=>N(F.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const SI=new Set(["completed"]),Hp=1100,Gbe=3e4;function qbe(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 Xbe({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(SI.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Gbe,_=async()=>{try{const k=await Dbe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),SI.has(k.status)||(b=window.setTimeout(_,Hp)))}catch(k){if(!y){const N=k instanceof ok?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=z_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??qbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await Fbe(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(Wbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const c1="/web/sandbox/sessions",Qbe=33e4,Zbe=6e5,Jbe=15e3;function u1(e){const t=p0(e);return t.set("Accept","application/json"),t}async function d1(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 e1e(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 f1={async startSession(e={}){const t=await fetch(Hi(c1),{method:"POST",headers:u1({"Content-Type":"application/json"}),signal:bi(e.signal,Qbe)});if(!t.ok)throw await d1(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(Hi(`${c1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:u1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:bi(t.signal,Zbe)});if(!n.ok)throw await d1(n,"沙箱对话失败,请稍后重试。");return e1e(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Hi(`${c1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:u1(),signal:bi(t.signal,Jbe)});if(!n.ok&&n.status!==404)throw await d1(n,"无法清理 AgentKit 沙箱会话。")}},t1e=1e4;async function kB(e){const t=await fetch(Hi(e),{headers:p0({Accept:"application/json"}),signal:bi(void 0,t1e)});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 n1e(){return kB("/web/sandbox/capabilities")}async function r1e(){return kB("/web/skill-creator/capabilities")}function s1e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 i1e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return vs.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(s1e,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function a1e({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function o1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 l1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function c1e(e){return e.toLowerCase()==="github"?o.jsx(tV,{className:"icon"}):o.jsx(oV,{className:"icon"})}function u1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),UM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=CV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(Ea,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>RV(m.loginUrl),children:[c1e(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Hd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function d1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?vs.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(u0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function f1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}Tl("Button",f1e);function h1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Tl("Card",h1e);const p1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},m1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function NB(e){return p1e[e]??"flex-start"}function SB(e){return m1e[e]??"stretch"}function g1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:NB(e.justify),alignItems:SB(e.align)},children:n.map(r=>t.render(r))})}Tl("Column",g1e);function y1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Tl("Divider",y1e);const b1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function E1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:b1e[t]??"•"})}Tl("Icon",E1e);function x1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:NB(e.justify),alignItems:SB(e.align??"center")},children:n.map(r=>t.render(r))})}Tl("Row",x1e);const w1e=new Set(["h1","h2","h3","h4","h5"]);function v1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=w1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Tl("Text",v1e);async function zp(e){const[t,n,r]=await Promise.allSettled([n1e(),r1e(),Lv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const _1e="创建 Agent",k1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Ri={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},N1e=new Set,S1e=[];function ta(){return{skills:[]}}function $o(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function h1(e){return`${$o(e)}.active`}function $x(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function T1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($o(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function A1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($x(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Hx(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Hx(n,t);if(r)return r}}function TB(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(...TB(n)));return t}function TI(){const e=typeof localStorage<"u"?localStorage.getItem(Ri.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function C1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 I1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function AB(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 R1e(e){if(!e)return"";const t=[];return e.ts&&t.push(AB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function AI(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const O1e="send_a2ui_json_to_client";function L1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===O1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?Y6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function M1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function j1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function D1e(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 CI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(Gs,{className:"icon"}):o.jsx(d0,{className:"icon"})})}function P1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function B1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx($t,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(CM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(u0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(TE,{className:"global-deploy-task-icon"}):o.jsx(aV,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(yv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:P1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Dg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const II=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],RI=()=>II[Math.floor(Math.random()*II.length)];function p1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function F1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function U1e(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 zx(e){return e.flatMap(t=>t.apps.map(n=>bo(t.id,n)))}function $1e(e,t){var n;return((n=e.find(r=>r.runtimeId&&r.apps.some(s=>bo(r.id,s)===t)))==null?void 0:n.runtimeId)??""}function H1e(e,t,n){return e?t.includes(e)||zx(n).includes(e):!1}function z1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[T,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[j,F]=E.useState({}),Y=a?j[a]??[]:f,L=p?g:Y,U=(B,V)=>F(re=>({...re,[B]:typeof V=="function"?V(re[B]??[]):V})),[C,M]=E.useState(""),[O,D]=E.useState("agent"),[A,H]=E.useState(null),[W,P]=E.useState({}),te=E.useRef(new Map),X=W.ready===!0&&W.agentId===n,[ne,ce]=E.useState(null),[J,fe]=E.useState(!1),ee=E.useRef(0),[Ee,ge]=E.useState([]),[xe,we]=E.useState(ta),[Te,Re]=E.useState(null),[Ye,Le]=E.useState(0),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(null),[ve,ct]=E.useState(!1),[ht,G]=E.useState([]),[Z,he]=E.useState(!1),De=E.useRef(new Set),[qe,nt]=E.useState(()=>new Set),[Vt,Et]=E.useState(()=>new Set),Pt=E.useRef(new Map),Kt=E.useRef(new Map),Nt=(B,V)=>nt(re=>{const me=new Set(re);return V?me.add(B):me.delete(B),me}),rn=B=>{const V=Kt.current.get(B);V!==void 0&&window.clearTimeout(V),Kt.current.delete(B),Et(re=>new Set(re).add(B))},sn=B=>{const V=Kt.current.get(B);V!==void 0&&window.clearTimeout(V);const re=window.setTimeout(()=>{Kt.current.delete(B),Et(me=>{const Ne=new Set(me);return Ne.delete(B),Ne})},2400);Kt.current.set(B,re)},_t=E.useRef(""),[rt,Oe]=E.useState(""),[gt,Ae]=E.useState(""),pe=E.useRef(null);E.useEffect(()=>()=>{pe.current!==null&&window.clearTimeout(pe.current)},[]);const[Je,at]=E.useState(()=>new Set),[dn,an]=E.useState(!1),[pt,Lt]=E.useState(!1),on=E.useRef(null),On=E.useCallback(()=>Lt(!1),[]),[lr,fn]=E.useState(RI),[Bt,Kn]=E.useState(null),[ue,Se]=E.useState(!1),[Ce,Qe]=E.useState(!1),[ot,et]=E.useState(""),Ct=E.useRef(!1),[Yt,oe]=E.useState(null),[be,ft]=E.useState(""),[Ve,Ke]=E.useState(),[dt,Wt]=E.useState(null),[cr,Yn]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[hn,Ln]=E.useState("cloud"),[Gt,Jt]=E.useState(Rf),[Ot,kn]=E.useState(""),[Nn,en]=E.useState("chat"),[tr,Wn]=E.useState(!1),[pr,nr]=E.useState(!1),[Si,Xs]=E.useState(!1),[Zr,Ar]=E.useState({}),[Ts,Qs]=E.useState({}),[ka,Ur]=E.useState({}),wo=qe.has(a),Na=Vt.has(a),Zs=wo||u,Cl=!!a&&ve,Js=p?y:Zs,Il=Js||!p&&Na,vo=Zr[a]??"",_o=Ts[a]??N1e,Sa=ka[a]??S1e,mr=Te==null?void 0:Te.graph,ko=[Te==null?void 0:Te.name,mr==null?void 0:mr.name,mr==null?void 0:mr.id].filter(B=>!!B),No=xe.targetAgent&&mr?Hx(mr,xe.targetAgent.name):mr,Rl=(No==null?void 0:No.skills)??(xe.targetAgent?[]:(Te==null?void 0:Te.skills)??[]),ju=mr?TB(mr):[];function As(B){p1(B);for(const V of B)V.status==="uploading"?De.current.add(V.id):V.uri&&om(n,V.uri).catch(re=>Oe(String(re)))}function Cs(){ee.current+=1;const B=ne;ce(null),fe(!1),B&&!B.id.startsWith("pending-")&&Pbe(B.id).catch(V=>{Oe(V instanceof Error?V.message:String(V))})}async function Ta(B){try{await OE(n,be,B),await RE(n,be,B),i(V=>V.filter(re=>re.id!==B)),F(V=>{const{[B]:re,...me}=V;return me})}catch(V){Oe(String(V))}}function Ol(B){const V=Ee.find(Ne=>Ne.id===B);if(!V)return;const re=Ee.filter(Ne=>Ne.id!==B);p1([V]),V.status==="uploading"&&De.current.add(B),ge(re),re.length===0&&!C.trim()&&!!a&&L.length===0?(_t.current="",l(""),Ta(a)):V.uri&&om(n,V.uri).catch(Ne=>Oe(String(Ne)))}const So=(B,V)=>{var Be,ut,$e,Ge,tt;const re=V.author&&V.author!=="user"?V.author:void 0;re&&(Ar(_e=>({..._e,[B]:re})),Qs(_e=>({..._e,[B]:new Set(_e[B]??[]).add(re)})),Ur(_e=>{var st;return(st=_e[B])!=null&&st.length?_e:{..._e,[B]:[re]}}));const me=((Be=V.actions)==null?void 0:Be.transferToAgent)??((ut=V.actions)==null?void 0:ut.transfer_to_agent);me&&Ur(_e=>{const st=_e[B]??[];return st[st.length-1]===me?_e:{..._e,[B]:[...st,me]}}),((($e=V.actions)==null?void 0:$e.endOfAgent)??((Ge=V.actions)==null?void 0:Ge.end_of_agent)??((tt=V.actions)==null?void 0:tt.escalate))&&Ur(_e=>{const st=_e[B]??[];return st.length<=1?_e:{..._e,[B]:st.slice(0,-1)}})},[ei,xt]=E.useState(TI),[z,se]=E.useState([]),ye=E.useCallback(B=>{se(V=>{const re=V.findIndex(Ne=>Ne.id===B.id);if(re===-1)return[B,...V];const me=[...V];return me[re]={...me[re],...B},me})},[]),Ue=E.useCallback(async B=>{try{await oj(B.id),se(V=>V.map(re=>re.id===B.id?{...re,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:re))}catch(V){const re=V instanceof Error?V.message:String(V);se(me=>me.map(Ne=>Ne.id===B.id?{...Ne,message:`取消失败:${re}`}:Ne))}},[]),[It,Qt]=E.useState(!0),[Sn,Mn]=E.useState(!1),[Ft,qt]=E.useState(!1),[q,ae]=E.useState(!1),[Fe,We]=E.useState(null),[pn,ln]=E.useState([]),[jn,$n]=E.useState([]),[jt,Xt]=E.useState(""),Ut=E.useRef(null),[ur,mn]=E.useState(!1),[qi,cn]=E.useState(!1),[uk,sy]=E.useState(""),[CB,IB]=E.useState("good"),[RB,Du]=E.useState("basic"),[OB,LB]=E.useState("good"),[Lh,Mh]=E.useState(""),[ti,wr]=E.useState(!1),iy=E.useRef(null),[Xi,Ll]=E.useState(()=>{const B=Ls();return vu(B),B}),[MB,dk]=E.useState(!1),[jB,fk]=E.useState(""),[hk,jh]=E.useState(null),[DB,pk]=E.useState({}),[PB,mk]=E.useState(()=>new Set),[Ml,Ti]=E.useState(null),[Dh,ay]=E.useState("cn-beijing"),[gk,$r]=E.useState(""),[oy,Cr]=E.useState(""),[Ht,us]=E.useState(null),[BB,Ph]=E.useState(!1),ly=E.useRef(!1),Bh=E.useRef(!1),Fh=E.useRef(!1),FB=E.useCallback((B,V,re)=>{!B||!be||ln(me=>{const Be=[{id:B,draft:V,updatedAt:Date.now(),deploymentTarget:re},...me.filter(ut=>ut.id!==B)];return localStorage.setItem($o(be),JSON.stringify(Be)),Be})},[be]),cy=E.useCallback(B=>{!B||!be||ln(V=>{const re=V.filter(me=>me.id!==B);return localStorage.setItem($o(be),JSON.stringify(re)),re})},[be]),UB=E.useCallback(B=>{if(!be||B.length===0)return;const V=new Set(B.map(re=>re.id));ln(re=>{const me=re.filter(Ne=>!V.has(Ne.id));return localStorage.setItem($o(be),JSON.stringify(me)),me}),V.has(jt)&&(Xt(""),We(null),Ti(null),Ut.current=null,localStorage.removeItem(h1(be)))},[jt,be]),yk=E.useCallback(B=>{if(!B||!be)return;const V=Ut.current;ln(re=>{const me=re.filter(Be=>Be.id!==B),Ne=(V==null?void 0:V.id)===B?[V,...me]:me;return localStorage.setItem($o(be),JSON.stringify(Ne)),Ne})},[be]);E.useEffect(()=>{if(!be){ln([]),$n([]),Xt(""),Ut.current=null;return}const B=T1e(be);ln(B),$n(A1e(be));const V=localStorage.getItem(h1(be))||"",re=B.find(me=>me.id===V);Ut.current=re??null,ei==="custom"&&re&&(Xt(re.id),We(re.draft),Ti(re.deploymentTarget??null))},[be]),E.useEffect(()=>{if(!be)return;const B=h1(be);ei==="custom"&&jt?localStorage.setItem(B,jt):localStorage.removeItem(B)},[ei,jt,be]);const $B=E.useCallback(B=>{if(!be)return;const V=[...new Set(B.filter(Boolean))];$n(V),localStorage.setItem($x(be),JSON.stringify(V))},[be]),HB=E.useCallback(async B=>{const V=B.filter(Ge=>!!Ge.runtimeId&&Ge.canDelete===!0);if(V.length===0)return;const re=$1e(Xi,n),me=new Set(V.map(Ge=>Ge.runtimeId));mk(Ge=>{const tt=new Set(Ge);for(const _e of me)tt.add(_e);return tt}),PC(me);const Ne=new Set,Be=new Set,ut=new Set,$e=[];for(const Ge of V)try{if(!Ge.region)throw new Error("Runtime 缺少地域信息,无法删除");await pj(Ge.runtimeId,Ge.region),lg(Ge.runtimeId),Ne.add(Ge.runtimeId),Be.add(Ge.id)}catch(tt){const _e=tt instanceof Error?tt.message:String(tt);ut.add(Ge.runtimeId),$e.push(`${Ge.label}: ${_e}`)}if(Ne.size>0&&(PC(Ne),Ll(Ls()),jh(tt=>{if(!tt)return tt;const _e=new Set(tt);for(const st of Ne)_e.delete(st);return _e}),pk(tt=>Object.fromEntries(Object.entries(tt).filter(([_e])=>!Ne.has(_e)))),$n(tt=>{const _e=tt.filter(st=>!Be.has(st));return be&&localStorage.setItem($x(be),JSON.stringify(_e)),_e}),ln(tt=>{const _e=tt.filter(st=>{var zt;return!((zt=st.deploymentTarget)!=null&&zt.runtimeId)||!Ne.has(st.deploymentTarget.runtimeId)});return be&&localStorage.setItem($o(be),JSON.stringify(_e)),_e}),(re?Ne.has(re):V.some(tt=>tt.id===n))&&(vk(),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe("")),Ht!=null&&Ht.runtime&&Ne.has(Ht.runtime.runtimeId)&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe(""))),ut.size>0&&mk(Ge=>{const tt=new Set(Ge);for(const _e of ut)tt.delete(_e);return tt}),$e.length>0){const Ge=$e.slice(0,3).join(";"),tt=$e.length>3?`;另有 ${$e.length-3} 个失败`:"";throw new Error(`${$e.length} 个 Agent 删除失败:${Ge}${tt}`)}},[Ht,n,Xi,be]),uy=E.useCallback(async()=>{dk(!0),fk("");try{const B=[];let V="";do{const re=await Cc({scope:"mine",region:"all",pageSize:100,nextToken:V});B.push(...re.runtimes),V=re.nextToken}while(V&&B.length<2e3);jh(new Set(B.map(re=>re.runtimeId))),pk(Object.fromEntries(B.map(re=>[re.runtimeId,{canDelete:re.canDelete}])))}catch(B){fk(B instanceof Error?B.message:String(B))}finally{dk(!1)}},[]);function Uh(B){console.log("create agent draft:",B),xt(null),Ca()}function dy(B,V){console.log("Agent added, navigating to:",B,V),Ll(Ls()),jh(null),cy(jt),Xt(""),Ut.current=null,Ti(null),$r(""),Cr(B),Du("basic"),xt(null),cn(!0),r(B)}const bk=E.useCallback(B=>{xt(null),ae(!1),us(null),cn(!0),Cr(""),Du("basic"),$r(B.id),Oe("")},[]),Ek=E.useCallback(async B=>{if(!B.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const V=(Ml==null?void 0:Ml.region)??Dh,re=await og(B.runtimeId,B.agentName,B.region??V,B.version);Ll(Ls()),Le(Ne=>Ne+1);const me=await zp(re);te.current.set(re,me),P(me),jh(Ne=>{const Be=new Set(Ne??[]);return Be.add(B.runtimeId),Be}),Ti(null),cy(jt),Xt(""),Ut.current=null,Cr(re),Du("basic"),xt(null),cn(!0),r(re)},[jt,Dh,cy,Ml]),Pu=E.useRef(null),fy=E.useRef(new Map),To=E.useRef(!0),Aa=E.useRef(!1),Ao=E.useRef(null),xk=E.useRef({key:"",turnCount:0}),hy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const B=Pu.current,V=xk.current,re=V.key!==hy,me=!re&&L.length>V.turnCount;if(xk.current={key:hy,turnCount:L.length},!B||L.length===0||!re&&!me)return;To.current=!0,Aa.current=!1,Ao.current!==null&&(window.clearTimeout(Ao.current),Ao.current=null);const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(re||Ne){B.scrollTop=B.scrollHeight;return}Aa.current=!0,B.scrollTo({top:B.scrollHeight,behavior:"smooth"}),Ao.current=window.setTimeout(()=>{Aa.current=!1,Ao.current=null},450)},[hy,L.length]),E.useLayoutEffect(()=>{const B=Pu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[Js,L]),E.useEffect(()=>{if(!Lh||qi||L.length===0)return;const B=fy.current.get(Lh);if(!B)return;To.current=!1,B.scrollIntoView({behavior:"smooth",block:"center"});const V=window.setTimeout(()=>{Mh("")},2600);return()=>window.clearTimeout(V)},[Lh,qi,L]),E.useEffect(()=>()=>{Ao.current!==null&&window.clearTimeout(Ao.current)},[]);const zB=E.useCallback(()=>{const B=Pu.current;!B||Aa.current||(To.current=B.scrollHeight-B.scrollTop-B.clientHeight<32)},[]),VB=E.useCallback(B=>{B.deltaY<0&&(Aa.current=!1,To.current=!1)},[]),KB=E.useCallback(()=>{Aa.current=!1,To.current=!1},[]),YB=E.useCallback(()=>{const B=Pu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[]),py=E.useCallback(()=>{oe(null),AE().then(B=>{ft(B.userId),Ke(B.info),nr(!!B.local),Kn(B.status),B.status==="authenticated"&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),wr(!0))}).catch(B=>{oe(B instanceof Error?B.message:String(B))})},[]);E.useEffect(()=>{py()},[py]),E.useEffect(()=>{const B=()=>{et(""),Se(!0)};return window.addEventListener(CE,B),FV()&&B(),()=>window.removeEventListener(CE,B)},[]);const WB=E.useCallback(async()=>{if(Ct.current)return;Ct.current=!0;const B=OV();if(!B){Ct.current=!1,et("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),et("");try{for(;;){await new Promise(V=>window.setTimeout(V,1e3));try{const V=await AE();if(V.status==="authenticated"){ft(V.userId),Ke(V.info),nr(!!V.local),Kn(V.status),Se(!1),UV(),B.close();return}}catch{}if(B.closed){et("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{Ct.current=!1,Qe(!1)}},[]);E.useEffect(()=>{pr&&be&&mT(be)},[pr,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be||!n){P({});return}const B=te.current.get(n);if(B){P(B);return}let V=!1;return P({}),zp(n).then(re=>{V||(te.current.set(n,re),P(re))}),()=>{V=!0}},[n,Bt,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be){Wt(null);return}let B=!1;return Wt(null),uj().then(V=>{B||Wt(V)}).catch(V=>{console.warn("[app] /web/access failed; using ordinary-user access:",V),B||Wt(cj)}),()=>{B=!0}},[Bt,be]),E.useEffect(()=>{lj().then(B=>{Yn(B.features),Ln(B.agentsSource),Jt(B.branding),kn(B.version),en(B.defaultView),Wn(!0)})},[]),E.useEffect(()=>{!dt||!tr||Bh.current||ti||(Bh.current=!0,Nn==="addAgent"&&dt.capabilities.createAgents&&(xt(null),Mn(!1),mn(!1),cn(!1),qt(!1),ae(!0)))},[dt,Nn,ti,tr]),E.useEffect(()=>{dt&&(dt.capabilities.createAgents||(xt(null),We(null),qt(!1),ae(!1),se([])),dt.capabilities.manageAgents||cn(!1))},[dt]),E.useEffect(()=>{Bt!=="authenticated"||hn!=="cloud"||!tr||!qi||Ht||uy()},[Ht,hn,Bt,qi,uy,tr]),E.useEffect(()=>{document.title=Gt.title;let B=document.querySelector('link[rel~="icon"]');B||(B=document.createElement("link"),B.rel="icon",document.head.appendChild(B)),B.removeAttribute("type"),B.href=Gt.logoUrl||Bv},[Gt]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(B=>B.ok?B.json():null).then(B=>{B&&Qt(!!B.credentials)}).catch(B=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",B)})},[]);function GB(B){mT(B),ly.current=!0,Bh.current=!1,Wt(null),xt(null),We(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),Ca(),wr(!0),ft(B),Ke({name:B}),nr(!0),Kn("authenticated")}function qB(){Bh.current=!1,Wt(null),pr?(IV(),ft(""),Ke(void 0),Kn("unauthenticated")):MV()}E.useEffect(()=>{if(Bt==="authenticated"){if(hn==="cloud"){const B=localStorage.getItem(Ri.app),V=zx(Xi);r(re=>re&&V.includes(re)?re:re?(Fh.current=!0,localStorage.removeItem(Ri.app),""):Fh.current?"":B&&V.includes(B)?B:"");return}VM().then(B=>{t(B);const V=localStorage.getItem(Ri.app),re=zx(Xi),me=V&&(B.includes(V)||re.includes(V)),Ne=["web_search_agent","web_demo"].find(Be=>B.includes(Be))??B.find(Be=>!/^\d/.test(Be))??B[0];r(me?V:Ne||"")}).catch(B=>Oe(String(B)))}},[Bt,hn,Xi]),E.useEffect(()=>{n?(Fh.current=!1,localStorage.setItem(Ri.app,n)):localStorage.removeItem(Ri.app)},[n]),E.useEffect(()=>{let B=!1;if(le(null),G([]),ti||Ht||!n||!be||!a){ct(!1);return}return ct(!0),LE(n,be,a).then(V=>{B||(le(V),Lv(n).then(re=>{B||G(re)}).catch(()=>{B||G([])}))}).catch(()=>{B||le(null)}).finally(()=>{B||ct(!1)}),()=>{B=!0}},[Ht,n,ti,be,a]),E.useEffect(()=>{let B=!1;if(Re(null),we(ta()),Bt!=="authenticated"||ti||Ht||!n){Ze(!1);return}return Ze(!0),Mv(n).then(V=>{B||Re(V)}).catch(()=>{B||Re(null)}).finally(()=>{B||Ze(!1)}),()=>{B=!0}},[Ht,n,Ye,Bt,ti]),E.useEffect(()=>{dt&&localStorage.setItem(Ri.view,dt.capabilities.createAgents?ei??"chat":"chat")},[dt,ei]),E.useEffect(()=>{localStorage.setItem(Ri.session,a),_t.current=a},[a]),E.useEffect(()=>()=>Pt.current.forEach(B=>B.abort()),[]),E.useEffect(()=>()=>Kt.current.forEach(B=>{window.clearTimeout(B)}),[]),E.useEffect(()=>()=>{var B,V;(B=R.current)==null||B.abort(),(V=I.current)==null||V.abort()},[]),E.useEffect(()=>{if(ti||Ht||p||!n||!be)return;let B=!1;return(async()=>{const V=await $h(n);if(!B){if(!ly.current){ly.current=!0;const re=localStorage.getItem(Ri.session)||"";if(TI()===null&&re&&V.some(me=>me.id===re)){Bu(re);return}}Ca()}})(),()=>{B=!0}},[Ht,n,ti,p,be]),E.useEffect(()=>{const B=iy.current;B&&B.app===n&&(iy.current=null,Bu(B.sid))},[n]);function XB(B,V){mn(!1),B===n?Bu(V):(iy.current={app:B,sid:V},r(B))}async function $h(B){try{const V=await Iv(B,be),re=await Promise.all(V.map(me=>{var Ne;return(Ne=me.events)!=null&&Ne.length?Promise.resolve(me):ig(B,be,me.id)}));return i(re),re}catch(V){return Oe(String(V)),[]}}function wk(){p||(Oe(""),S(""),N("confirm"),_(!0))}function QB(){var B;(B=R.current)==null||B.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&O==="temporary"&&D("agent")}async function ZB(){var V;(V=R.current)==null||V.abort();const B=new AbortController;R.current=B,N("loading"),S("");try{const re=await f1.startSession({signal:B.signal});if(R.current!==B)return;_t.current="",l(""),h([]),M(""),we(ta()),D("temporary"),Cs(),fe(!1),As(Ee),ge([]),w([]),m(re),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),_(!1),N("confirm")}catch(re){if((re==null?void 0:re.name)==="AbortError"||R.current!==B)return;S(re instanceof Error?re.message:String(re)),N("error")}finally{R.current===B&&(R.current=null)}}function Co(){var V;(V=I.current)==null||V.abort(),I.current=null,b(!1),w([]),M(""),Oe(""),D("agent");const B=p;m(null),B&&f1.closeSession(B.id).catch(re=>Oe(String(re)))}async function JB(B){var Ne;const V=p;if(!V||y||!B.trim())return;Oe("");const re=new AbortController;(Ne=I.current)==null||Ne.abort(),I.current=re;const me=[{role:"user",blocks:[{kind:"text",text:B}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Be=>[...Be,...me]),b(!0);try{const Be=await f1.sendMessage({sessionId:V.id,text:B},{signal:re.signal,onBlocks:ut=>{I.current===re&&w($e=>{const Ge=$e.slice(),tt=Ge[Ge.length-1];return(tt==null?void 0:tt.role)==="assistant"&&(Ge[Ge.length-1]={...tt,blocks:ut}),Ge})}});if(I.current!==re)return;w(ut=>{const $e=ut.slice(),Ge=$e[$e.length-1];return(Ge==null?void 0:Ge.role)==="assistant"&&($e[$e.length-1]={...Ge,blocks:Be.blocks,meta:{ts:Date.now()/1e3}}),$e})}catch(Be){if((Be==null?void 0:Be.name)==="AbortError"||I.current!==re)return;w(ut=>ut.slice(0,-2)),M(B),Oe(`内置智能体发送失败:${Be instanceof Error?Be.message:String(Be)}`)}finally{I.current===re&&(I.current=null,b(!1))}}function Ca(){Co(),Oe(""),Lt(!1),fn(RI()),D("agent"),H(null),Cs(),fe(!1);const B=a&&Y.length===0&&Ee.length>0?a:"";_t.current="",l(""),le(null),G([]),d(!1),h([]),we(ta()),As(Ee),ge([]),B&&Ta(B)}function vk(){var B;Fh.current=!0,localStorage.removeItem(Ri.app),a&&((B=Pt.current.get(a))==null||B.abort()),c.current=null,Ca(),r(""),P({}),Re(null)}function e8(B){pe.current!==null&&window.clearTimeout(pe.current),Ae(B),pe.current=window.setTimeout(()=>{Ae(""),pe.current=null},3e3)}function t8(){if(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),!p&&!H1e(n,e,Xi)){n&&vk(),wr(!0),e8("请先选择 agent");return}wr(!1),Ca()}async function n8(B){var V;try{(V=Pt.current.get(B))==null||V.abort(),await OE(n,be,B),await RE(n,be,B);const re=Kt.current.get(B);re!==void 0&&window.clearTimeout(re),Kt.current.delete(B),Et(me=>{if(!me.has(B))return me;const Ne=new Set(me);return Ne.delete(B),Ne}),F(me=>{const{[B]:Ne,...Be}=me;return Be}),B===a&&Ca(),await $h(n)}catch(re){Oe(String(re))}}async function Bu(B){if(p&&Co(),B!==a&&(_t.current=B,Oe(""),d(!1),h([]),D("agent"),H(null),Cs(),we(ta()),le(null),G([]),l(B),j[B]===void 0)){Xs(!0);try{const V=await ig(n,be,B);U(B,pK(V.events??[],V.state))}catch(V){Oe(String(V))}finally{Xs(!1)}}}async function r8(B){if(!B.sessionId||!B.messageId){Oe("这条案例缺少会话定位信息,无法跳转。");return}mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),cn(!1),sy(n),IB(B.kind),Mh(B.messageId),await Bu(B.sessionId)}function s8(){const B=uk||n;mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),$r(""),Cr(B),Du("evaluations"),LB(CB),cn(!0),sy(""),Mh("")}function i8(B){const V=new Map,re=new Map;for(const me of B){if(!me.sessionId||!me.messageId)continue;const Ne=V.get(me.sessionId)??new Set;if(Ne.add(me.messageId),V.set(me.sessionId,Ne),me.runtimeId&&me.userId){const Be=[me.runtimeId,n,me.userId,me.sessionId].join(":"),ut=re.get(Be)??{runtimeId:me.runtimeId,appName:n,userId:me.userId,sessionId:me.sessionId,eventIds:new Set};ut.eventIds.add(me.messageId),re.set(Be,ut)}}if(V.size!==0){F(me=>{const Ne={...me};for(const[Be,ut]of V){const $e=Ne[Be];$e&&(Ne[Be]=$e.map(Ge=>{var tt;return(tt=Ge.meta)!=null&&tt.eventId&&ut.has(Ge.meta.eventId)?{...Ge,meta:{...Ge.meta,feedback:void 0}}:Ge}))}return Ne}),i(me=>me.map(Ne=>{const Be=V.get(Ne.id);if(!Be||!Ne.state)return Ne;const ut={...Ne.state};for(const $e of Be)delete ut[`veadk_feedback:${$e}`];return{...Ne,state:ut}})),at(me=>{const Ne=new Set(me);for(const Be of V.values())for(const ut of Be)Ne.delete(ut);return Ne});for(const me of re.values())$M({runtimeId:me.runtimeId,appName:me.appName,userId:me.userId,sessionId:me.sessionId,eventIds:[...me.eventIds]})}}async function _k(B=!0){if(a)return a;c.current||(c.current=sg(n,be));const V=c.current;try{const re=await V;B&&l(re);const me=Date.now()/1e3,Ne={id:re,lastUpdateTime:me,events:[]};return i(Be=>[Ne,...Be.filter(ut=>ut.id!==re)]),re}finally{c.current===V&&(c.current=null)}}async function kk(B){if(!n||!be||!a||!ze)return!1;he(!0),Oe("");try{const V=await ME(n,be,a,B,ze.revision);return le(V),!0}catch(V){return Oe(String(V)),!1}finally{he(!1)}}async function Nk(B){if(!(!n||!be||!a||!ze)){he(!0),Oe("");try{const V=await rj(n,be,a,B,ze.revision);le(V)}catch(V){Oe(String(V))}finally{he(!1)}}}async function a8(B){Oe("");let V;try{V=await _k()}catch(me){Oe(String(me));return}const re=Array.from(B).map(me=>({file:me,attachment:{id:F1e(),mimeType:U1e(me),name:me.name,sizeBytes:me.size,status:"uploading"}}));ge(me=>[...me,...re.map(Ne=>Ne.attachment)]),await Promise.all(re.map(async({file:me,attachment:Ne})=>{try{const Be=await ZM(n,be,V,me);if(De.current.delete(Ne.id)){Be.uri&&await om(n,Be.uri);return}ge(ut=>ut.map($e=>$e.id===Ne.id?Be:$e))}catch(Be){if(De.current.delete(Ne.id))return;const ut=Be instanceof Error?Be.message:String(Be);ge($e=>$e.map(Ge=>Ge.id===Ne.id?{...Ge,status:"error",error:ut}:Ge)),Oe(ut)}}))}async function Sk(B,V=[],re=ta()){if(!B.trim()&&V.length===0||Zs||Cl||!n||!be)return;Oe("");const me=[];(re.skills.length>0||re.targetAgent)&&me.push({kind:"invocation",value:re}),V.length&&me.push({kind:"attachment",files:V.map(_e=>({id:_e.id,mimeType:_e.mimeType,data:_e.data,uri:_e.uri,name:_e.name,sizeBytes:_e.sizeBytes}))}),B.trim()&&me.push({kind:"text",text:B});const Ne=[{role:"user",blocks:me,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Be=!a;Be&&(h(Ne),d(!0));const ut=A;let $e;try{$e=await _k(!Be)}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(String(_e));return}let Ge=ze!==null;if(ut)try{let _e=await LE(n,be,$e);const st=fge[ut].filter(zt=>{var gr;return(gr=W.builtinTools)==null?void 0:gr.includes(zt)});for(const zt of[...r5[ut],...st])_e.tools.some(gr=>gr.name===zt)||(_e=await ME(n,be,$e,{kind:"tool",name:zt},_e.revision));le(_e),Ge=!0}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(`任务能力挂载失败:${String(_e)}`);return}U($e,_e=>Be?Ne:[..._e,...Ne]),Be&&(_t.current=$e,l($e),h([]),d(!1));const tt=new AbortController;Pt.current.set($e,tt),Nt($e,!0),rn($e),_t.current=$e,Ar(_e=>({..._e,[$e]:""})),Qs(_e=>({..._e,[$e]:new Set})),Ur(_e=>({..._e,[$e]:[]}));try{let _e=hi(),st="",zt=0,gr=Date.now()/1e3,Ia="",Ra="";for await(const Hn of If({appName:n,userId:be,sessionId:$e,text:B,attachments:V,invocation:re,signal:tt.signal,sessionCapabilities:Ge})){if(tt.signal.aborted)break;const Zi=Hn.error??Hn.errorMessage??Hn.error_message;if(typeof Zi=="string"&&Zi){_t.current===$e&&Oe(Zi);break}So($e,Hn);const rr=Hn.author&&Hn.author!=="user"?Hn.author:"";rr&&rr!==st&&(st=rr,_e=hi()),_e=qc(_e,Hn);const Gn=Hn.usageMetadata??Hn.usage_metadata;Gn!=null&&Gn.totalTokenCount&&(zt=Gn.totalTokenCount),Hn.timestamp&&(gr=Hn.timestamp),Hn.id&&(Ia=Hn.id);const Jr=Hn.invocationId??Hn.invocation_id;Jr&&(Ra=Jr);const Ai=_e.blocks,ds={author:st||void 0,tokens:zt||void 0,ts:gr,eventId:Ia||void 0,invocationId:Ra||void 0};U($e,gy=>{var zu;const fs=gy.slice(),xn=fs[fs.length-1];return(xn==null?void 0:xn.role)==="assistant"&&(!((zu=xn.meta)!=null&&zu.author)||xn.meta.author===st)?fs[fs.length-1]={...xn,blocks:Ai,meta:ds}:fs.push({role:"assistant",blocks:Ai,meta:ds}),fs})}$h(n)}catch(_e){(_e==null?void 0:_e.name)!=="AbortError"&&!tt.signal.aborted&&_t.current===$e&&Oe(String(_e))}finally{Pt.current.get($e)===tt&&Pt.current.delete($e),Nt($e,!1),sn($e),Ar(_e=>({..._e,[$e]:""})),Ur(_e=>({..._e,[$e]:[]}))}}function o8(B,V){var Ne,Be;const re=((Ne=B==null?void 0:B.event)==null?void 0:Ne.name)??V.id,me=((Be=B==null?void 0:B.event)==null?void 0:Be.context)??{};Sk(`[ui-action] ${re}: ${JSON.stringify(me)}`)}async function l8(B){var Ge,tt,_e;if(!B.authUri)throw new Error("事件中没有授权地址。");if(!n||!be||!a)throw new Error("会话尚未就绪。");const V=a,re=await j1e(B.authUri),me=D1e(B.authConfig,re),Ne=st=>st.map(zt=>zt.kind==="auth"&&!zt.done?{...zt,done:!0}:zt);U(V,st=>{const zt=st.slice(),gr=zt[zt.length-1];return(gr==null?void 0:gr.role)==="assistant"&&(zt[zt.length-1]={...gr,blocks:Ne(gr.blocks)}),zt});const Be=L[L.length-1],ut=Ne(Be&&Be.role==="assistant"?Be.blocks:[]),$e=new AbortController;Pt.current.set(V,$e),Nt(V,!0),rn(V);try{let st=hi(),zt=((Ge=Be==null?void 0:Be.meta)==null?void 0:Ge.author)??"",gr=ut,Ia=0,Ra=Date.now()/1e3,Hn=((tt=Be==null?void 0:Be.meta)==null?void 0:tt.eventId)??"",Zi=((_e=Be==null?void 0:Be.meta)==null?void 0:_e.invocationId)??"";for await(const rr of If({appName:n,userId:be,sessionId:a,text:"",functionResponses:[{id:B.callId,name:"adk_request_credential",response:me}],signal:$e.signal,sessionCapabilities:ze!==null})){if($e.signal.aborted)break;So(V,rr);const Gn=rr.author&&rr.author!=="user"?rr.author:"";Gn&&Gn!==zt&&(zt=Gn,gr=[],st=hi()),st=qc(st,rr);const Jr=rr.usageMetadata??rr.usage_metadata;Jr!=null&&Jr.totalTokenCount&&(Ia=Jr.totalTokenCount),rr.timestamp&&(Ra=rr.timestamp),rr.id&&(Hn=rr.id);const Ai=rr.invocationId??rr.invocation_id;Ai&&(Zi=Ai);const ds=[...gr,...st.blocks];U(V,gy=>{var Ok,Lk,Mk,jk,Dk;const fs=gy.slice(),xn=fs[fs.length-1],zu={author:zt||((Ok=xn==null?void 0:xn.meta)==null?void 0:Ok.author),tokens:Ia||((Lk=xn==null?void 0:xn.meta)==null?void 0:Lk.tokens),ts:Ra,eventId:Hn||((Mk=xn==null?void 0:xn.meta)==null?void 0:Mk.eventId),invocationId:Zi||((jk=xn==null?void 0:xn.meta)==null?void 0:jk.invocationId)};return(xn==null?void 0:xn.role)==="assistant"&&(!((Dk=xn.meta)!=null&&Dk.author)||xn.meta.author===zt)?fs[fs.length-1]={...xn,blocks:ds,meta:zu}:fs.push({role:"assistant",blocks:ds,meta:zu}),fs})}$h(n)}catch(st){(st==null?void 0:st.name)!=="AbortError"&&!$e.signal.aborted&&_t.current===V&&Oe(String(st))}finally{Pt.current.get(V)===$e&&Pt.current.delete(V),Nt(V,!1),sn(V),Ar(st=>({...st,[V]:""})),Ur(st=>({...st,[V]:[]}))}}if(Yt)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Yt}),o.jsx("button",{type:"button",onClick:py,children:"重试"})]});if(Bt===null)return o.jsx("div",{className:"boot"});if(Bt==="unauthenticated")return o.jsx(u1e,{branding:Gt,onUsername:GB});if(!dt)return o.jsx("div",{className:"boot"});const ni=dt.capabilities.createAgents,Tk=dt.capabilities.manageAgents,Is=ni?ei:null,Fu=ni&&q,Uu=ni&&Ft,$u=qi,Ak=Sj(e,Xi),Hu=Ak.filter(B=>B.runtimeId&&(hk===null||hk.has(B.runtimeId))).map(B=>{var V;return{...B,canDelete:B.runtimeId?((V=DB[B.runtimeId])==null?void 0:V.canDelete)===!0:!1}}),c8=(()=>{if(Hu.length===0)return Hu;const B=new Map(jn.map((V,re)=>[V,re]));return[...Hu].sort((V,re)=>{const me=B.get(V.id),Ne=B.get(re.id);return me!=null&&Ne!=null?me-Ne:me!=null?-1:Ne!=null?1:Hu.indexOf(V)-Hu.indexOf(re)})})(),Hh=B=>{var V;return((V=Ak.find(re=>re.id===B))==null?void 0:V.label)??B},Hr=Xi.find(B=>B.runtimeId&&B.apps.some(V=>bo(B.id,V)===n)),jl=Hr&&Hr.runtimeId&&Hr.region?{runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region}:void 0,u8=(jl==null?void 0:jl.runtimeId)??"",Ck=async(B,V)=>{var ut,$e;const re=(ut=B.meta)==null?void 0:ut.eventId,me=a;if(!re||!me||!jl)return;const Ne=($e=B.meta)==null?void 0:$e.feedback,Be={...Ne,rating:V,syncStatus:"syncing",updatedAt:Date.now()/1e3};U(me,Ge=>Ge.map(tt=>{var _e;return((_e=tt.meta)==null?void 0:_e.eventId)===re?{...tt,meta:{...tt.meta,feedback:Be}}:tt})),at(Ge=>new Set(Ge).add(re));try{const Ge=await YM({appName:n,userId:be,sessionId:me,eventId:re,rating:V});U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ge}}:_e})),i(tt=>tt.map(_e=>_e.id===me?{..._e,state:{..._e.state??{},[`veadk_feedback:${re}`]:Ge}}:_e))}catch(Ge){U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ne}}:_e})),_t.current===me&&Oe(Ge instanceof Error?Ge.message:String(Ge))}finally{at(Ge=>{const tt=new Set(Ge);return tt.delete(re),tt})}},zh=async B=>{Ll(Ls());let V=te.current.get(B);V||(V=await zp(B),te.current.set(B,V)),P(V),B===n&&Le(re=>re+1),_t.current="",l(""),wr(!1),r(B)},d8=B=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}wr(!1),cn(!1),ay(B),We(null),xt(null),ae(!0),Oe("")},Ik=async B=>{if(B.runtime)try{const V=await og(B.runtime.runtimeId,B.name,B.runtime.region,B.runtime.currentVersion);Ll(Ls()),Le(me=>me+1);const re=await zp(V);te.current.set(V,re),P(re),us(null),wr(!1),cn(!1),Ca(),r(V)}catch(V){Oe(V instanceof Error?V.message:String(V))}},f8=B=>{B.runtime&&(us(B),$r(""),Cr(""),wr(!1),cn(!0),Oe(""))},Rk=()=>{p&&Co(),_t.current="",l(""),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe("")},h8=B=>{if(sy(""),Mh(""),Ht){Ik(Ht);return}$r(""),Cr(""),cn(!1),zh(B)},p8=B=>($r(""),Cr(B),Du("basic"),zh(B)),my=Ht!=null&&Ht.runtime?Xi.find(B=>{var V;return B.runtimeId===((V=Ht.runtime)==null?void 0:V.runtimeId)}):void 0,Qi=Ht!=null&&Ht.runtime?{id:`detail:${Ht.runtime.runtimeId}`,label:Ht.name,app:Ht.name,remote:!0,runtimeApp:my==null?void 0:my.apps[0],runtimeId:Ht.runtime.runtimeId,region:Ht.runtime.region,currentVersion:Ht.runtime.currentVersion,canDelete:Ht.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(MK,{branding:Gt,access:dt,features:cr,sessions:s,currentSessionId:a,streamingSids:qe,onNewChat:t8,onSearch:()=>{p&&Co(),xt(null),Mn(!1),qt(!1),ae(!1),cn(!1),us(null),wr(!1),mn(!0),Oe("")},onQuickCreate:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",l(""),Mn(!1),qt(!1),mn(!1),cn(!1),us(null),wr(!1),xt(null),We(null),ay("cn-beijing"),ae(!0),Oe("")},onSkillCenter:()=>{p&&Co(),xt(null),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),Mn(!0),Oe("")},onAddAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",xt(null),Mn(!1),mn(!1),cn(!1),us(null),wr(!1),l(""),ae(!1),qt(!0),Oe("")},onMyAgents:Rk,onPickSession:B=>{xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),Oe(""),Bu(B)},onDeleteSession:n8,userInfo:Ve,version:Ot,onLogout:qB}),(()=>{const B=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(a1e,{onExit:Ca}),o.jsx(yge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Hh(n):"Agent",value:C,onChange:M,onSubmit:()=>{if(!p&&O==="skill-create"){const Ne=C.trim();if(!Ne||J)return;const Be={id:`pending-${Date.now()}`,prompt:Ne,status:"provisioning",candidates:z_.map(($e,Ge)=>({id:`pending-${Ge}`,model:$e,modelLabel:$e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};fe(!0);const ut=++ee.current;Oe(""),ce(Be),M(""),jbe(Ne,$e=>{ee.current===ut&&ce($e)}).then($e=>{ee.current===ut&&ce($e)}).catch($e=>{ee.current===ut&&(ce(null),M(Ne),Oe($e instanceof Error?$e.message:String($e)))}).finally(()=>{ee.current===ut&&fe(!1)});return}const V=C;if(M(""),p){JB(V);return}const re=Ee,me=xe;ge([]),we(ta()),Sk(V,re,me),p1(re)},disabled:p?!1:!be||O==="temporary"||O==="agent"&&!n,busy:p?y:O==="skill-create"?J:Zs,showMeta:L.length>0&&!p,attachments:p?[]:Ee,skills:p?[]:Rl,agents:p?[]:ju,invocation:p?ta():xe,capabilitiesLoading:!p&&bt,allowAttachments:!p,onInvocationChange:we,onAddFiles:a8,onRemoveAttachment:Ol,newChatMode:p?"agent":O,newChatTask:p?null:A,newChatLayout:!p&&L.length===0&&ne===null,showModeSelector:!1,temporaryEnabled:X&&W.temporaryEnabled,skillCreateEnabled:X&&W.skillCreateEnabled,harnessEnabled:X&&W.harnessEnabled,builtinTools:X?W.builtinTools:[],onModeChange:V=>{if(!(V==="temporary"&&!W.temporaryEnabled||V==="skill-create"&&!W.skillCreateEnabled)){if(V==="temporary"){H(null),D(V),wk();return}if(D(V),V!=="agent"&&H(null),Oe(""),V==="skill-create"){we(ta());const re=a&&Y.length===0&&Ee.length>0?a:"";As(Ee),ge([]),re&&(_t.current="",l(""),Ta(re))}}},onTaskChange:H})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(qK,{appName:n,onAppChange:$u?p8:zh,agentLabel:Hh,agentsSource:hn,localApps:e,currentRuntime:jl,runtimeScope:dt.capabilities.runtimeScope,onBrowseAgents:Rk,title:p?"Codex 智能体":ti?"智能体":Fu?"添加 Agent":Uu?"添加 AgentKit 智能体":$u?Ht?Ht.name:oy?Hh(oy):"智能体详情":void 0,titleLeading:L.length>0&&!p&&O==="agent"&&!Fu&&!Uu&&!Sn&&!ur&&!$u&&!ti&&Is===null&&n?o.jsx("button",{ref:on,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":pt,onClick:()=>Lt(!0),children:o.jsx(Xc,{})}):void 0,crumbs:Sn?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:ur||Uu||Fu||!Is?void 0:Is==="menu"?[{label:_1e,onClick:()=>{xt(null),We(null),ae(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Ph(!0)},{label:k1e[Is]}],rightContent:o.jsxs(o.Fragment,{children:[dt.role==="admin"&&o.jsx(Tbe,{}),o.jsx(B1e,{tasks:ni?z:[],onCancel:Ue})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[rt&&o.jsx("div",{className:"error",children:rt}),Si&&o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 加载会话…"]}),uk&&!$u&&!Fu&&!Uu&&!ur&&!Sn&&Is===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:s8,children:[o.jsx(gv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),ti?o.jsx(Tme,{onCreateAgent:d8,onCreateCodexAgent:wk,onUseAgent:Ik,onViewAgentDetails:f8,connectedRuntimeId:u8,hiddenRuntimeIds:PB}):$u?o.jsx(pme,{agents:Qi?[Qi]:c8,drafts:pn,agentOrder:jn,selectedAgentId:n,agentInfo:Te,agentInfoAgentId:n,loadingAgentInfo:bt,canCreate:ni,canUpdate:ni||Tk,loadingAgents:MB,agentsError:jB,deploymentTasks:z,focusedDeploymentTaskId:gk,focusedAgentId:(Qi==null?void 0:Qi.id)??oy,focusedAgentSection:RB,focusedCaseKind:OB,detailOnly:!!Qi||!!gk,onRetryAgents:()=>void uy(),onAgentOrderChange:$B,onDeleteAgents:HB,onDeleteDrafts:UB,onSelectAgent:zh,onTalkAgent:h8,onOpenFeedbackCase:V=>void r8(V),onFeedbackCasesDeleted:i8,onCreateAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}cn(!1),ae(!0),xt(null),We(null),Ti(null),ay("cn-beijing"),Xt(""),Ut.current=null,$r(""),Cr(""),Oe("")},onUpdateAgent:V=>{if(!Tk&&!ni){Oe("当前账号没有管理 Agent 的权限。");return}if(!(Hr!=null&&Hr.runtimeId)){Oe("仅支持更新已部署的云端智能体。");return}if(!Hr.region){Oe("Runtime 缺少地域信息,无法更新。");return}cn(!1),We(V);const re=`runtime-${Hr.runtimeId}`;Xt(re),Ut.current=pn.find(me=>me.id===re)??null,$r(""),Cr(""),Ti({runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region,currentVersion:Hr.currentVersion}),xt("custom"),Oe("")},onEditDraft:V=>{cn(!1),We(V.draft),Xt(V.id),Ut.current=V,Ti(V.deploymentTarget??null),$r(""),Cr(""),xt("custom"),Oe("")}},(Qi==null?void 0:Qi.id)??"workspace"):Fu?o.jsx(s5,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:C1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{ae(!1),We(null),xt("menu")}},{key:"package",icon:Wz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{ae(!1),We(null),xt("package")}}]}):ur?o.jsx(TK,{userId:be,appId:n,agentInfo:Te,capabilitiesLoading:bt,agentLabel:Hh,onOpenSession:XB}):Uu?o.jsx(qse,{onAdded:V=>{Ll(Ls()),qt(!1),r(V)},onCancel:()=>qt(!1)}):Sn?o.jsx(Gse,{}):Is!==null&&!It?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Is==="menu"?o.jsx(L0e,{onSelect:V=>{We(null),Ti(null),$r(""),Cr(""),Xt(V==="custom"?`draft-${Date.now().toString(36)}`:""),Ut.current=null,xt(V)},onImport:V=>{We(V),Ti(null),$r(""),Cr(""),Xt(`draft-${Date.now().toString(36)}`),Ut.current=null,xt("custom")}}):Is==="intelligent"?o.jsx(oye,{userId:be,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,onDeploymentTaskChange:ye}):Is==="custom"?o.jsx(tbe,{initialDraft:Fe??void 0,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,features:cr,onDeploymentTaskChange:ye,deploymentTarget:Ml??void 0,initialDeployRegion:Dh,onDraftChange:(V,re)=>{jt&&(re?FB(jt,V,Ml??void 0):yk(jt))},onDiscard:jt?()=>{yk(jt),Xt(""),Ut.current=null,We(null),Ti(null),$r(""),Cr(n),xt(null),ae(!1),cn(!0),Oe("")}:void 0,onDeploymentStarted:bk,onDeploymentComplete:Ek},jt||"custom"):Is==="template"?o.jsx(sbe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="workflow"?o.jsx(fbe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="package"?o.jsx(ybe,{onBack:()=>{xt(null),ae(!0)},onAgentAdded:dy,onDeploymentTaskChange:ye,onDeploymentStarted:bk,onDeploymentComplete:Ek,initialDeployRegion:Dh}):L.length===0&&ne?o.jsx(Xbe,{initialJob:ne}):L.length===0&&!X?o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 正在检查 Agent 能力…"]}):L.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(Ea,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":O==="skill-create"?"想创建一个什么 Skill?":lr}),B]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Il?" is-streaming":""}`,ref:Pu,onScroll:zB,onWheel:VB,onTouchMove:KB,children:L.map((V,re)=>{var Ia,Ra,Hn,Zi,rr;const me=re===L.length-1;if(V.role==="user"){const Gn=V.blocks.map(ds=>ds.kind==="text"?ds.text:"").join(""),Jr=V.blocks.flatMap(ds=>ds.kind==="attachment"?ds.files:[]),Ai=V.blocks.find(ds=>ds.kind==="invocation");return o.jsxs(nn.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Ai==null?void 0:Ai.kind)==="invocation"&&o.jsx(F_,{value:Ai.value}),Jr.length>0&&o.jsx($_,{appName:n,items:Jr}),Gn&&o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:Gn})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ia=V.meta)==null?void 0:Ia.ts)&&o.jsx("span",{className:"meta-text",children:AB(V.meta.ts)}),o.jsx(CI,{text:Gn})]})]},re)}const Ne=((Ra=V.meta)==null?void 0:Ra.author)??"",Be=Ne&&mr?Hx(mr,Ne):void 0,ut=!!(Ne&&ko.length>0&&!ko.includes(Ne)),$e=(Be==null?void 0:Be.name)||Ne,Ge=(Be==null?void 0:Be.description)||(ut?"正在执行主 Agent 移交的任务。":"");if(V.blocks.length>0&&V.blocks.every(Gn=>Gn.kind==="agent-transfer"))return null;const tt=V.blocks.length===0,_e=((Zi=(Hn=V.meta)==null?void 0:Hn.feedback)==null?void 0:Zi.rating)??null,st=((rr=V.meta)==null?void 0:rr.eventId)??"",zt=Je.has(st),gr=!!(jl&&st&&AI(V));return o.jsxs(nn.div,{ref:Gn=>{st&&(Gn?fy.current.set(st,Gn):fy.current.delete(st))},className:["turn turn--assistant",ut?"turn--subagent":"",Lh===st?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[ut&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(zz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:$e})]}),o.jsx("p",{className:"subagent-run-description",title:Ge,children:Ge})]}),tt?me&&Js?o.jsx(t5,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(H_,{appName:n,blocks:V.blocks,streaming:me&&(Js||Na),onStreamFrame:me?YB:void 0,onAction:o8,onAuth:l8,onArtifactDownload:(Gn,Jr)=>qM(n,be,a,Gn,Jr),onArtifactPreview:(Gn,Jr)=>QM(n,be,a,Gn,Jr)}),!(me&&Js)&&!L1e(V)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(me&&Js)&&!M1e(V)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[gr&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":_e==="good","aria-busy":zt,title:_e==="good"?"取消点赞":"赞",disabled:zt,onClick:()=>void Ck(V,_e==="good"?null:"good"),children:o.jsx(o1e,{className:"icon",filled:_e==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":_e==="bad","aria-busy":zt,title:_e==="bad"?"取消点踩":"踩",disabled:zt,onClick:()=>void Ck(V,_e==="bad"?null:"bad"),children:o.jsx(l1e,{className:"icon",filled:_e==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>an(!0),children:o.jsx(I1e,{})}),o.jsx(CI,{text:AI(V)})]}),V.meta&&o.jsx("span",{className:"meta-text",children:R1e(V.meta)})]})]})]},re)})}),!p&&o.jsx(Bj,{appName:n,info:Te,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:V=>void Nk(V)}),o.jsx("div",{className:"conversation-composer-slot",children:B})]})]})]})})(),dn&&a&&o.jsx(uB,{appName:n,sessionId:a,onClose:()=>an(!1)}),pt&&L.length>0&&o.jsx(hY,{appName:n,info:Te,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:B=>void Nk(B),onClose:On,returnFocusRef:on}),o.jsx(i1e,{open:x,state:k,error:T,onCancel:QB,onConfirm:()=>void ZB()}),gt&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:gt}),o.jsx(d1e,{open:ue,checking:Ce,error:ot,onLogin:()=>void WB()}),BB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Ph(!1),children:o.jsxs("div",{className:"confirm-box",onClick:B=>B.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Ph(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{We(null),xt("menu"),Ph(!1)},children:"确定返回"})]})]})})]})}const OI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(OI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(OI,String(t))}catch{}window.location.reload()}});(()=>{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})()||m1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(J9,{reducedMotion:"user",children:o.jsx(Oz,{maskOpacity:.9,children:o.jsx(z1e,{})})})}));export{E as A,_0 as B,xs as C,G1e as D,Kd as E,fl as F,T3 as G,K1e as R,Br as V,kt as a,eu as b,x2 as c,q1e as d,Kv as e,xq as f,Mf as g,Mt as h,PQ as i,VQ as j,vq as k,Xf as l,VZ as m,NQ as n,SQ as o,ZZ as p,bZ as q,EZ as r,B3 as s,o as t,it as u,un as v,Tt as w,W1e as x,jQ as y,vs as z}; diff --git a/veadk/webui/assets/index-Mps5FwwT.js b/veadk/webui/assets/index-Mps5FwwT.js deleted file mode 100644 index c8cfd232..00000000 --- a/veadk/webui/assets/index-Mps5FwwT.js +++ /dev/null @@ -1,736 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-CD1RMBf6.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var d8=Object.defineProperty;var f8=(e,t,n)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Mk=(e,t,n)=>f8(e,typeof t!="symbol"?t+"":t,n);function h8(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 wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var II={exports:{}},Bg={},RI={exports:{}},Ct={};/** - * @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 Gf=Symbol.for("react.element"),p8=Symbol.for("react.portal"),m8=Symbol.for("react.fragment"),g8=Symbol.for("react.strict_mode"),y8=Symbol.for("react.profiler"),b8=Symbol.for("react.provider"),E8=Symbol.for("react.context"),x8=Symbol.for("react.forward_ref"),w8=Symbol.for("react.suspense"),v8=Symbol.for("react.memo"),_8=Symbol.for("react.lazy"),jk=Symbol.iterator;function k8(e){return e===null||typeof e!="object"?null:(e=jk&&e[jk]||e["@@iterator"],typeof e=="function"?e:null)}var OI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LI=Object.assign,MI={};function du(e,t,n){this.props=e,this.context=t,this.refs=MI,this.updater=n||OI}du.prototype.isReactComponent={};du.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")};du.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jI(){}jI.prototype=du.prototype;function $x(e,t,n){this.props=e,this.context=t,this.refs=MI,this.updater=n||OI}var Hx=$x.prototype=new jI;Hx.constructor=$x;LI(Hx,du.prototype);Hx.isPureReactComponent=!0;var Dk=Array.isArray,DI=Object.prototype.hasOwnProperty,zx={current:null},PI={key:!0,ref:!0,__self:!0,__source:!0};function BI(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)DI.call(t,r)&&!PI.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1>>1,G=L[z];if(0>>1;zs(Q,A))ses(de,Q)?(L[z]=de,L[se]=A,z=se):(L[z]=Q,L[re]=A,z=re);else if(ses(de,A))L[z]=de,L[se]=A,z=se;else break e}}return P}function s(L,P){var A=L.sortIndex-P.sortIndex;return A!==0?A:L.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(L){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=L)r(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function _(L){if(g=!1,x(L),!m)if(n(c)!==null)m=!0,C(k);else{var P=n(u);P!==null&&j(_,P.startTime-L)}}function k(L,P){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var A=h;try{for(x(P),f=n(c);f!==null&&(!(f.expirationTime>P)||L&&!D());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var G=z(f.expirationTime<=P);P=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),x(P)}else r(c);f=n(c)}if(f!==null)var B=!0;else{var re=n(u);re!==null&&j(_,re.startTime-P),B=!1}return B}finally{f=null,h=A,p=!1}}var N=!1,T=null,S=-1,R=5,I=-1;function D(){return!(e.unstable_now()-IL||125z?(L.sortIndex=A,t(u,L),n(c)===null&&L===n(u)&&(g?(y(S),S=-1):g=!0,j(_,A-z))):(L.sortIndex=G,t(c,L),m||p||(m=!0,C(k))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var P=h;return function(){var A=h;h=P;try{return L.apply(this,arguments)}finally{h=A}}}})(zI);HI.exports=zI;var j8=HI.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 D8=E,hs=j8;function Ie(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"),p1=Object.prototype.hasOwnProperty,P8=/^[: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]*$/,Bk={},Fk={};function B8(e){return p1.call(Fk,e)?!0:p1.call(Bk,e)?!1:P8.test(e)?Fk[e]=!0:(Bk[e]=!0,!1)}function F8(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 U8(e,t,n,r){if(t===null||typeof t>"u"||F8(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 $r(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 hr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hr[e]=new $r(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hr[t]=new $r(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hr[e]=new $r(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hr[e]=new $r(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){hr[e]=new $r(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hr[e]=new $r(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hr[e]=new $r(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hr[e]=new $r(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hr[e]=new $r(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kx=/[\-:]([a-z])/g;function Yx(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(Kx,Yx);hr[t]=new $r(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(Kx,Yx);hr[t]=new $r(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(Kx,Yx);hr[t]=new $r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hr[e]=new $r(e,1,!1,e.toLowerCase(),null,!1,!1)});hr.xlinkHref=new $r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hr[e]=new $r(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wx(e,t,n,r){var s=hr.hasOwnProperty(t)?hr[t]:null;(s!==null?s.type!==0:r||!(2l||s[a]!==i[l]){var c=` -`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{yy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?dd(e):""}function $8(e){switch(e.tag){case 5:return dd(e.type);case 16:return dd("Lazy");case 13:return dd("Suspense");case 19:return dd("SuspenseList");case 0:case 2:case 15:return e=by(e.type,!1),e;case 11:return e=by(e.type.render,!1),e;case 1:return e=by(e.type,!0),e;default:return""}}function b1(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 Yl:return"Fragment";case Kl:return"Portal";case m1:return"Profiler";case Gx:return"StrictMode";case g1:return"Suspense";case y1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case YI:return(e.displayName||"Context")+".Consumer";case KI:return(e._context.displayName||"Context")+".Provider";case qx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xx:return t=e.displayName||null,t!==null?t:b1(e.type)||"Memo";case Pa:t=e._payload,e=e._init;try{return b1(e(t))}catch{}}return null}function H8(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 b1(t);case 8:return t===Gx?"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 ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function GI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function z8(e){var t=GI(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 Vh(e){e._valueTracker||(e._valueTracker=z8(e))}function qI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=GI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vm(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 E1(e,t){var n=t.checked;return In({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $k(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ao(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 XI(e,t){t=t.checked,t!=null&&Wx(e,"checked",t,!1)}function x1(e,t){XI(e,t);var n=ao(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")?w1(e,t.type,n):t.hasOwnProperty("defaultValue")&&w1(e,t.type,ao(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hk(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 w1(e,t,n){(t!=="number"||vm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var fd=Array.isArray;function yc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Kh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sd={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},V8=["Webkit","ms","Moz","O"];Object.keys(Sd).forEach(function(e){V8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sd[t]=Sd[e]})});function eR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Sd.hasOwnProperty(e)&&Sd[e]?(""+t).trim():t+"px"}function tR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=eR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var K8=In({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 k1(e,t){if(t){if(K8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ie(62))}}function N1(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 S1=null;function Qx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var T1=null,bc=null,Ec=null;function Kk(e){if(e=Qf(e)){if(typeof T1!="function")throw Error(Ie(280));var t=e.stateNode;t&&(t=zg(t),T1(e.stateNode,e.type,t))}}function nR(e){bc?Ec?Ec.push(e):Ec=[e]:bc=e}function rR(){if(bc){var e=bc,t=Ec;if(Ec=bc=null,Kk(e),t)for(e=0;e>>=0,e===0?32:31-(nF(e)/rF|0)|0}var Yh=64,Wh=4194304;function hd(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 Sm(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 l=a&~s;l!==0?r=hd(l):(i&=a,i!==0&&(r=hd(i)))}else a=n&~s,a!==0?r=hd(a):i!==0&&(r=hd(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 qf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=n}function oF(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=Ad),eN=" ",tN=!1;function _R(e,t){switch(e){case"keyup":return jF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wl=!1;function PF(e,t){switch(e){case"compositionend":return kR(t);case"keypress":return t.which!==32?null:(tN=!0,eN);case"textInput":return e=t.data,e===eN&&tN?null:e;default:return null}}function BF(e,t){if(Wl)return e==="compositionend"||!iw&&_R(e,t)?(e=wR(),Kp=nw=Va=null,Wl=!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=iN(n)}}function AR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?AR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function CR(){for(var e=window,t=vm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vm(e.document)}return t}function aw(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 WF(e){var t=CR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&AR(n.ownerDocument.documentElement,n)){if(r!==null&&aw(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=aN(n,i);var a=aN(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,Gl=null,L1=null,Id=null,M1=!1;function oN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M1||Gl==null||Gl!==vm(r)||(r=Gl,"selectionStart"in r&&aw(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}),Id&&uf(Id,r)||(Id=r,r=Cm(L1,"onSelect"),0Ql||(e.current=U1[Ql],U1[Ql]=null,Ql--)}function cn(e,t){Ql++,U1[Ql]=e.current,e.current=t}var oo={},Nr=fo(oo),Qr=fo(!1),el=oo;function jc(e,t){var n=e.type.contextTypes;if(!n)return oo;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 Zr(e){return e=e.childContextTypes,e!=null}function Rm(){mn(Qr),mn(Nr)}function pN(e,t,n){if(Nr.current!==oo)throw Error(Ie(168));cn(Nr,t),cn(Qr,n)}function BR(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(Ie(108,H8(e)||"Unknown",s));return In({},n,r)}function Om(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,el=Nr.current,cn(Nr,e),cn(Qr,Qr.current),!0}function mN(e,t,n){var r=e.stateNode;if(!r)throw Error(Ie(169));n?(e=BR(e,t,el),r.__reactInternalMemoizedMergedChildContext=e,mn(Qr),mn(Nr),cn(Nr,e)):mn(Qr),cn(Qr,n)}var ea=null,Vg=!1,Oy=!1;function FR(e){ea===null?ea=[e]:ea.push(e)}function i9(e){Vg=!0,FR(e)}function ho(){if(!Oy&&ea!==null){Oy=!0;var e=0,t=qt;try{var n=ea;for(qt=1;e>=a,s-=a,na=1<<32-fi(t)+s|n<S?(R=T,T=null):R=T.sibling;var I=h(y,T,x[S],_);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(y,T),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,T=R}if(S===x.length)return n(y,T),En&&Ao(y,S),k;if(T===null){for(;SS?(R=T,T=null):R=T.sibling;var D=h(y,T,I.value,_);if(D===null){T===null&&(T=R);break}e&&T&&D.alternate===null&&t(y,T),b=i(D,b,S),N===null?k=D:N.sibling=D,N=D,T=R}if(I.done)return n(y,T),En&&Ao(y,S),k;if(T===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return En&&Ao(y,S),k}for(T=r(y,T);!I.done;S++,I=x.next())I=p(T,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&T.forEach(function(U){return t(y,U)}),En&&Ao(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Yl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case zh:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Yl){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pa&&bN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=Yu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Yl?(b=Wo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=Jp(x.type,x.key,x.props,null,y.mode,_),_.ref=Yu(y,b,x),_.return=y,y=_)}return a(y);case Kl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Uy(x,y.mode,_),b.return=y,y=b}return a(y);case Pa:return N=x._init,w(y,b,N(x._payload),_)}if(fd(x))return m(y,b,x,_);if($u(x))return g(y,b,x,_);ep(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=Fy(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var Pc=zR(!0),VR=zR(!1),jm=fo(null),Dm=null,ec=null,uw=null;function dw(){uw=ec=Dm=null}function fw(e){var t=jm.current;mn(jm),e._currentValue=t}function z1(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 wc(e,t){Dm=e,uw=ec=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qr=!0),e.firstContext=null)}function Fs(e){var t=e._currentValue;if(uw!==e)if(e={context:e,memoizedValue:t,next:null},ec===null){if(Dm===null)throw Error(Ie(308));ec=e,Dm.dependencies={lanes:0,firstContext:e}}else ec=ec.next=e;return t}var Fo=null;function hw(e){Fo===null?Fo=[e]:Fo.push(e)}function KR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,hw(t)):(n.next=s.next,s.next=n),t.interleaved=n,fa(e,r)}function fa(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 pw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YR(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 aa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,fa(e,n)}return s=r.interleaved,s===null?(t.next=t,hw(r)):(t.next=s.next,s.next=t),r.interleaved=t,fa(e,n)}function Wp(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,Jx(e,n)}}function EN(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 Pm(e,t,n,r){var s=e.updateQueue;Ba=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=In({},f,h);break e;case 2:Ba=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);rl|=a,e.lanes=a,e.memoizedState=f}}function xN(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=My.transition;My.transition={};try{e(!1),t()}finally{qt=n,My.transition=r}}function cO(){return Us().memoizedState}function c9(e,t,n){var r=to(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uO(e))dO(t,n);else if(n=KR(e,t,n,r),n!==null){var s=Br();hi(n,e,r,s),fO(n,t,r)}}function u9(e,t,n){var r=to(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uO(e))dO(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,yi(l,a)){var c=t.interleaved;c===null?(s.next=s,hw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=KR(e,t,s,r),n!==null&&(s=Br(),hi(n,e,r,s),fO(n,t,r))}}function uO(e){var t=e.alternate;return e===Cn||t!==null&&t===Cn}function dO(e,t){Rd=Fm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jx(e,n)}}var Um={readContext:Fs,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},d9={readContext:Fs,useCallback:function(e,t){return Ti().memoizedState=[e,t===void 0?null:t],e},useContext:Fs,useEffect:vN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qp(4194308,4,sO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return qp(4,2,e,t)},useMemo:function(e,t){var n=Ti();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ti();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=c9.bind(null,Cn,e),[r.memoizedState,e]},useRef:function(e){var t=Ti();return e={current:e},t.memoizedState=e},useState:wN,useDebugValue:vw,useDeferredValue:function(e){return Ti().memoizedState=e},useTransition:function(){var e=wN(!1),t=e[0];return e=l9.bind(null,e[1]),Ti().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Cn,s=Ti();if(En){if(n===void 0)throw Error(Ie(407));n=n()}else{if(n=t(),or===null)throw Error(Ie(349));nl&30||XR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,vN(ZR.bind(null,r,i,e),[e]),r.flags|=2048,bf(9,QR.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ti(),t=or.identifierPrefix;if(En){var n=ra,r=na;n=(r&~(1<<32-fi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gf++,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[Ri]=t,e[hf]=r,vO(e,t,!1,!1),t.stateNode=e;e:{switch(a=N1(n,r),n){case"dialog":pn("cancel",e),pn("close",e),s=r;break;case"iframe":case"object":case"embed":pn("load",e),s=r;break;case"video":case"audio":for(s=0;sUc&&(t.flags|=128,r=!0,Wu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Bm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!En)return Er(t),null}else 2*Fn()-i.renderingStartTime>Uc&&n!==1073741824&&(t.flags|=128,r=!0,Wu(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=Fn(),t.sibling=null,n=Tn.current,cn(Tn,r?n&1|2:n&1),t):(Er(t),null);case 22:case 23:return Aw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?os&1073741824&&(Er(t),t.subtreeFlags&6&&(t.flags|=8192)):Er(t),null;case 24:return null;case 25:return null}throw Error(Ie(156,t.tag))}function E9(e,t){switch(lw(t),t.tag){case 1:return Zr(t.type)&&Rm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bc(),mn(Qr),mn(Nr),yw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gw(t),null;case 13:if(mn(Tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ie(340));Dc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return mn(Tn),null;case 4:return Bc(),null;case 10:return fw(t.type._context),null;case 22:case 23:return Aw(),null;case 24:return null;default:return null}}var np=!1,wr=!1,x9=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function tc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ln(e,t,r)}else n.current=null}function Z1(e,t,n){try{n()}catch(r){Ln(e,t,r)}}var LN=!1;function w9(e,t){if(j1=Tm,e=CR(),aw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(D1={focusedElem:e,selectionRange:n},Tm=!1,Ke=t;Ke!==null;)if(t=Ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ke=e;else for(;Ke!==null;){t=Ke;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:ri(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ie(163))}}catch(_){Ln(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ke=e;break}Ke=t.return}return m=LN,LN=!1,m}function Od(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&&Z1(t,n,i)}s=s.next}while(s!==r)}}function Wg(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 J1(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 NO(e){var t=e.alternate;t!==null&&(e.alternate=null,NO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ri],delete t[hf],delete t[F1],delete t[r9],delete t[s9])),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 SO(e){return e.tag===5||e.tag===3||e.tag===4}function MN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SO(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 eE(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=Im));else if(r!==4&&(e=e.child,e!==null))for(eE(e,t,n),e=e.sibling;e!==null;)eE(e,t,n),e=e.sibling}function tE(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(tE(e,t,n),e=e.sibling;e!==null;)tE(e,t,n),e=e.sibling}var cr=null,si=!1;function Ca(e,t,n){for(n=n.child;n!==null;)TO(e,t,n),n=n.sibling}function TO(e,t,n){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(Fg,n)}catch{}switch(n.tag){case 5:wr||tc(n,t);case 6:var r=cr,s=si;cr=null,Ca(e,t,n),cr=r,si=s,cr!==null&&(si?(e=cr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cr.removeChild(n.stateNode));break;case 18:cr!==null&&(si?(e=cr,n=n.stateNode,e.nodeType===8?Ry(e.parentNode,n):e.nodeType===1&&Ry(e,n),lf(e)):Ry(cr,n.stateNode));break;case 4:r=cr,s=si,cr=n.stateNode.containerInfo,si=!0,Ca(e,t,n),cr=r,si=s;break;case 0:case 11:case 14:case 15:if(!wr&&(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)&&Z1(n,t,a),s=s.next}while(s!==r)}Ca(e,t,n);break;case 1:if(!wr&&(tc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ln(n,t,l)}Ca(e,t,n);break;case 21:Ca(e,t,n);break;case 22:n.mode&1?(wr=(r=wr)||n.memoizedState!==null,Ca(e,t,n),wr=r):Ca(e,t,n);break;default:Ca(e,t,n)}}function jN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new x9),t.forEach(function(r){var s=I9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Js(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Fn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_9(r/1960))-r,10e?16:e,Ka===null)var r=!1;else{if(e=Ka,Ka=null,zm=0,Dt&6)throw Error(Ie(331));var s=Dt;for(Dt|=4,Ke=e.current;Ke!==null;){var i=Ke,a=i.child;if(Ke.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cFn()-Sw?Yo(e,0):Nw|=n),Jr(e,t)}function jO(e,t){t===0&&(e.mode&1?(t=Wh,Wh<<=1,!(Wh&130023424)&&(Wh=4194304)):t=1);var n=Br();e=fa(e,t),e!==null&&(qf(e,t,n),Jr(e,n))}function C9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jO(e,n)}function I9(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(Ie(314))}r!==null&&r.delete(t),jO(e,n)}var DO;DO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qr.current)qr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qr=!1,y9(e,t,n);qr=!!(e.flags&131072)}else qr=!1,En&&t.flags&1048576&&UR(t,Mm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xp(e,t),e=t.pendingProps;var s=jc(t,Nr.current);wc(t,n),s=Ew(null,t,r,e,s,n);var i=xw();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,Zr(r)?(i=!0,Om(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pw(t),s.updater=Yg,t.stateNode=s,s._reactInternals=t,K1(t,r,e,n),t=G1(null,t,r,!0,i,n)):(t.tag=0,En&&i&&ow(t),Mr(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=O9(r),e=ri(r,e),s){case 0:t=W1(null,t,r,e,n);break e;case 1:t=IN(null,t,r,e,n);break e;case 11:t=AN(null,t,r,e,n);break e;case 14:t=CN(null,t,r,ri(r.type,e),n);break e}throw Error(Ie(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),W1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),IN(e,t,r,s,n);case 3:e:{if(EO(t),e===null)throw Error(Ie(387));r=t.pendingProps,i=t.memoizedState,s=i.element,YR(e,t),Pm(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=Fc(Error(Ie(423)),t),t=RN(e,t,r,n,s);break e}else if(r!==s){s=Fc(Error(Ie(424)),t),t=RN(e,t,r,n,s);break e}else for(cs=Za(t.stateNode.containerInfo.firstChild),us=t,En=!0,ai=null,n=VR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dc(),r===s){t=ha(e,t,n);break e}Mr(e,t,r,n)}t=t.child}return t;case 5:return WR(t),e===null&&H1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,P1(r,s)?a=null:i!==null&&P1(r,i)&&(t.flags|=32),bO(e,t),Mr(e,t,a,n),t.child;case 6:return e===null&&H1(t),null;case 13:return xO(e,t,n);case 4:return mw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pc(t,null,r,n):Mr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),AN(e,t,r,s,n);case 7:return Mr(e,t,t.pendingProps,n),t.child;case 8:return Mr(e,t,t.pendingProps.children,n),t.child;case 12:return Mr(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,cn(jm,r._currentValue),r._currentValue=a,i!==null)if(yi(i.value,a)){if(i.children===s.children&&!Qr.current){t=ha(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=aa(-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),z1(i.return,n,t),l.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(Ie(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),z1(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}Mr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,wc(t,n),s=Fs(s),r=r(s),t.flags|=1,Mr(e,t,r,n),t.child;case 14:return r=t.type,s=ri(r,t.pendingProps),s=ri(r.type,s),CN(e,t,r,s,n);case 15:return gO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ri(r,s),Xp(e,t),t.tag=1,Zr(r)?(e=!0,Om(t)):e=!1,wc(t,n),hO(t,r,s),K1(t,r,s,n),G1(null,t,r,!0,e,n);case 19:return wO(e,t,n);case 22:return yO(e,t,n)}throw Error(Ie(156,t.tag))};function PO(e,t){return uR(e,t)}function R9(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 js(e,t,n,r){return new R9(e,t,n,r)}function Iw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function O9(e){if(typeof e=="function")return Iw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qx)return 11;if(e===Xx)return 14}return 2}function no(e,t){var n=e.alternate;return n===null?(n=js(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 Jp(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Iw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Yl:return Wo(n.children,s,i,t);case Gx:a=8,s|=8;break;case m1:return e=js(12,n,t,s|2),e.elementType=m1,e.lanes=i,e;case g1:return e=js(13,n,t,s),e.elementType=g1,e.lanes=i,e;case y1:return e=js(19,n,t,s),e.elementType=y1,e.lanes=i,e;case WI:return qg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case KI:a=10;break e;case YI:a=9;break e;case qx:a=11;break e;case Xx:a=14;break e;case Pa:a=16,r=null;break e}throw Error(Ie(130,e==null?e:typeof e,""))}return t=js(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Wo(e,t,n,r){return e=js(7,e,r,t),e.lanes=n,e}function qg(e,t,n,r){return e=js(22,e,r,t),e.elementType=WI,e.lanes=n,e.stateNode={isHidden:!1},e}function Fy(e,t,n){return e=js(6,e,null,t),e.lanes=n,e}function Uy(e,t,n){return t=js(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function L9(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=xy(0),this.expirationTimes=xy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Rw(e,t,n,r,s,i,a,l,c){return e=new L9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=js(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pw(i),e}function M9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($O)}catch(e){console.error(e)}}$O(),$I.exports=ys;var ps=$I.exports,zN=ps;h1.createRoot=zN.createRoot,h1.hydrateRoot=zN.hydrateRoot;const jw=E.createContext({});function e0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const t0=E.createContext(null),xf=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class F9 extends E.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 U9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(xf);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)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: ${l}px !important; - top: ${c}px !important; - left: ${u}px !important; - } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(F9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const $9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=e0(H9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(U9,{isPresent:n,children:e})),o.jsx(t0.Provider,{value:d,children:e})};function H9(){return new Map}function HO(e=!0){const t=E.useContext(t0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const ip=e=>e.key||"";function VN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Dw=typeof window<"u",zO=Dw?E.useLayoutEffect:E.useEffect,oi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=HO(a),u=E.useMemo(()=>VN(e),[e]),d=a&&!l?[]:u.map(ip),f=E.useRef(!0),h=E.useRef(u),p=e0(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);zO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=ip(_),N=a&&!l?!1:u===w||d.includes(k),T=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx($9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:T,children:_},k)})})},ds=e=>e;let VO=ds;const z9={useManualTiming:!1};function V9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const ap=["read","resolveKeyframes","update","preRender","render","postRender"],K9=40;function KO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=ap.reduce((y,b)=>(y[b]=V9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,K9),1),s.timestamp=y,s.isProcessing=!0,l.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:ap.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bKN[e].some(n=>!!t[n])};function Y9(e){for(const t in e)$c[t]={...$c[t],...e[t]}}const W9=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 Ym(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||W9.has(e)}let WO=e=>!Ym(e);function GO(e){e&&(WO=t=>t.startsWith("on")?!Ym(t):e(t))}try{GO(require("@emotion/is-prop-valid").default)}catch{}function G9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(WO(s)||n===!0&&Ym(s)||!t&&!Ym(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function q9({children:e,isValidProp:t,...n}){t&&GO(t),n={...E.useContext(xf),...n},n.isStatic=e0(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(xf.Provider,{value:r,children:e})}function X9(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 n0=E.createContext({});function wf(e){return typeof e=="string"||Array.isArray(e)}function r0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Pw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bw=["initial",...Pw];function s0(e){return r0(e.animate)||Bw.some(t=>wf(e[t]))}function qO(e){return!!(s0(e)||e.variants)}function Q9(e,t){if(s0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wf(n)?n:void 0,animate:wf(r)?r:void 0}}return e.inherit!==!1?t:{}}function Z9(e){const{initial:t,animate:n}=Q9(e,E.useContext(n0));return E.useMemo(()=>({initial:t,animate:n}),[YN(t),YN(n)])}function YN(e){return Array.isArray(e)?e.join(" "):e}const J9=Symbol.for("motionComponentSymbol");function rc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eU(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rc(n)&&(n.current=r))},[t])}const Fw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),tU="framerAppearId",XO="data-"+Fw(tU),{schedule:Uw}=KO(queueMicrotask,!1),QO=E.createContext({});function nU(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(n0),c=E.useContext(YO),u=E.useContext(t0),d=E.useContext(xf).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(QO);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&rU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[XO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return zO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Uw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function rU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ZO(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&rc(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function ZO(e){if(e)return e.options.allowProjection!==!1?e.projection:ZO(e.parent)}function sU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&Y9(e);function l(u,d){let f;const h={...E.useContext(xf),...u,layoutId:iU(u)},{isStatic:p}=h,m=Z9(u),g=r(u,p);if(!p&&Dw){aU();const w=oU(h);f=w.MeasureLayout,m.visualElement=nU(s,g,h,t,w.ProjectionNode)}return o.jsxs(n0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,eU(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[J9]=s,c}function iU({layoutId:e}){const t=E.useContext(jw).id;return t&&e!==void 0?t+"-"+e:e}function aU(e,t){E.useContext(YO).strict}function oU(e){const{drag:t,layout:n}=$c;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 lU=["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 $w(e){return typeof e!="string"||e.includes("-")?!1:!!(lU.indexOf(e)>-1||/[A-Z]/u.test(e))}function WN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Hw(e,t,n,r){if(typeof t=="function"){const[s,i]=WN(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]=WN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const aE=e=>Array.isArray(e),cU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),uU=e=>aE(e)?e[e.length-1]||0:e,vr=e=>!!(e&&e.getVelocity);function em(e){const t=vr(e)?e.get():e;return cU(t)?t.toValue():t}function dU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:fU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const JO=e=>(t,n)=>{const r=E.useContext(n0),s=E.useContext(t0),i=()=>dU(e,t,r,s);return n?i():e0(i)};function fU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=em(i[h]);let{initial:a,animate:l}=e;const c=s0(e),u=qO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!r0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),tL=eL("--"),hU=eL("var(--"),zw=e=>hU(e)?pU.test(e.split("/*")[0].trim()):!1,pU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,nL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,pa=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},vf={...mu,transform:e=>pa(0,1,e)},op={...mu,default:1},Jf=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ma=Jf("deg"),ji=Jf("%"),ct=Jf("px"),mU=Jf("vh"),gU=Jf("vw"),GN={...ji,parse:e=>ji.parse(e)/100,transform:e=>ji.transform(e*100)},yU={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,backgroundPositionX:ct,backgroundPositionY:ct},bU={rotate:Ma,rotateX:Ma,rotateY:Ma,rotateZ:Ma,scale:op,scaleX:op,scaleY:op,scaleZ:op,skew:Ma,skewX:Ma,skewY:Ma,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:vf,originX:GN,originY:GN,originZ:ct},qN={...mu,transform:Math.round},Vw={...yU,...bU,zIndex:qN,size:ct,fillOpacity:vf,strokeOpacity:vf,numOctaves:qN},EU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xU=pu.length;function wU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),rL=()=>({...Ww(),attrs:{}}),Gw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function sL(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 iL=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 aL(e,t,n,r){sL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(iL.has(s)?s:Fw(s),t.attrs[s])}const Wm={};function SU(e){Object.assign(Wm,e)}function oL(e,{layout:t,layoutId:n}){return yl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Wm[e]||e==="opacity")}function qw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(vr(s[a])||t.style&&vr(t.style[a])||oL(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 lL(e,t,n){const r=qw(e,t,n);for(const s in e)if(vr(e[s])||vr(t[s])){const i=pu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function TU(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 QN=["x","y","width","height","cx","cy","r"],AU={useVisualState:JO({scrapeMotionValuesFromProps:lL,createRenderState:rL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(yl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{TU(n,r),gn.render(()=>{Yw(r,s,Gw(n.tagName),e.transformTemplate),aL(n,r)})})}})},CU={useVisualState:JO({scrapeMotionValuesFromProps:qw,createRenderState:Ww})};function cL(e,t,n){for(const r in t)!vr(t[r])&&!oL(r,n)&&(e[r]=t[r])}function IU({transformTemplate:e},t){return E.useMemo(()=>{const n=Ww();return Kw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RU(e,t){const n=e.style||{},r={};return cL(r,n,e),Object.assign(r,IU(e,t)),r}function OU(e,t){const n={},r=RU(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 LU(e,t,n,r){const s=E.useMemo(()=>{const i=rL();return Yw(i,t,Gw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};cL(i,e.style,e),s.style={...i,...s.style}}return s}function MU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=($w(n)?LU:OU)(r,i,a,n),u=G9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>vr(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function jU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...$w(r)?AU:CU,preloadedFeatures:e,useRender:MU(s),createVisualElement:t,Component:r};return sU(a)}}function uL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(tm===void 0&&Di.set(ur.isProcessing||z9.useManualTiming?ur.timestamp:performance.now()),tm),set:e=>{tm=e,queueMicrotask(DU)}};function Qw(e,t){e.indexOf(t)===-1&&e.push(t)}function Zw(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Jw{constructor(){this.subscriptions=[]}add(t){return Qw(this.subscriptions,t),()=>Zw(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 BU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Di.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=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=PU(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 Jw);const r=this.events[t].add(n);return t==="change"?()=>{r(),gn.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=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ZN)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ZN);return fL(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 _f(e,t){return new BU(e,t)}function FU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_f(n))}function UU(e,t){const n=i0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=uU(i[a]);FU(e,a,l)}}function $U(e){return!!(vr(e)&&e.add)}function oE(e,t){const n=e.getValue("willChange");if($U(n))return n.add(t)}function hL(e){return e.props[XO]}function ev(e){let t;return()=>(t===void 0&&(t=e()),t)}const HU=ev(()=>window.ScrollTimeline!==void 0);class zU{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(HU()&&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 VU extends zU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const oa=e=>e*1e3,la=e=>e/1e3;function tv(e){return typeof e=="function"}function JN(e,t){e.timeline=t,e.onfinish=null}const nv=e=>Array.isArray(e)&&typeof e[0]=="number",KU={linearEasing:void 0};function YU(e,t){const n=ev(e);return()=>{var r;return(r=KU[t])!==null&&r!==void 0?r:n()}}const Gm=YU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},pL=(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})`,lE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:md([0,.65,.55,1]),circOut:md([.55,0,1,.45]),backIn:md([.31,.01,.66,-.59]),backOut:md([.33,1.53,.69,.99])};function gL(e,t){if(e)return typeof e=="function"&&Gm()?pL(e,t):nv(e)?md(e):Array.isArray(e)?e.map(n=>gL(n,t)||lE.easeOut):lE[e]}const yL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,WU=1e-7,GU=12;function qU(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=yL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>WU&&++lqU(i,0,1,e,n);return i=>i===0||i===1?i:yL(s(i),t,r)}const bL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,EL=e=>t=>1-e(1-t),xL=eh(.33,1.53,.69,.99),rv=EL(xL),wL=bL(rv),vL=e=>(e*=2)<1?.5*rv(e):.5*(2-Math.pow(2,-10*(e-1))),sv=e=>1-Math.sin(Math.acos(e)),_L=EL(sv),kL=bL(sv),NL=e=>/^0[^.\s]+$/u.test(e);function XU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||NL(e):!0}const jd=e=>Math.round(e*1e5)/1e5,iv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QU(e){return e==null}const ZU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,av=(e,t)=>n=>!!(typeof n=="string"&&ZU.test(n)&&n.startsWith(e)||t&&!QU(n)&&Object.prototype.hasOwnProperty.call(n,t)),SL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(iv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},JU=e=>pa(0,255,e),Hy={...mu,transform:e=>Math.round(JU(e))},$o={test:av("rgb","red"),parse:SL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hy.transform(e)+", "+Hy.transform(t)+", "+Hy.transform(n)+", "+jd(vf.transform(r))+")"};function e$(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 cE={test:av("#"),parse:e$,transform:$o.transform},sc={test:av("hsl","hue"),parse:SL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ji.transform(jd(t))+", "+ji.transform(jd(n))+", "+jd(vf.transform(r))+")"},xr={test:e=>$o.test(e)||cE.test(e)||sc.test(e),parse:e=>$o.test(e)?$o.parse(e):sc.test(e)?sc.parse(e):cE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$o.transform(e):sc.transform(e)},t$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(iv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(t$))===null||n===void 0?void 0:n.length)||0)>0}const TL="number",AL="color",r$="var",s$="var(",eS="${}",i$=/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 kf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(i$,c=>(xr.test(c)?(r.color.push(i),s.push(AL),n.push(xr.parse(c))):c.startsWith(s$)?(r.var.push(i),s.push(r$),n.push(c)):(r.number.push(i),s.push(TL),n.push(parseFloat(c))),++i,eS)).split(eS);return{values:n,split:l,indexes:r,types:s}}function CL(e){return kf(e).values}function IL(e){const{split:t,types:n}=kf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function o$(e){const t=CL(e);return IL(e)(t.map(a$))}const co={test:n$,parse:CL,createTransformer:IL,getAnimatableNone:o$},l$=new Set(["brightness","contrast","saturate","opacity"]);function c$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(iv)||[];if(!r)return e;const s=n.replace(r,"");let i=l$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const u$=/\b([a-z-]*)\(.*?\)/gu,uE={...co,getAnimatableNone:e=>{const t=e.match(u$);return t?t.map(c$).join(" "):e}},d$={...Vw,color:xr,backgroundColor:xr,outlineColor:xr,fill:xr,stroke:xr,borderColor:xr,borderTopColor:xr,borderRightColor:xr,borderBottomColor:xr,borderLeftColor:xr,filter:uE,WebkitFilter:uE},ov=e=>d$[e];function RL(e,t){let n=ov(e);return n!==uE&&(n=co),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const f$=new Set(["auto","none","0"]);function h$(e,t,n){let r=0,s;for(;re===mu||e===ct,nS=(e,t)=>parseFloat(e.split(", ")[t]),rS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return nS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?nS(i[1],e):0}},p$=new Set(["x","y","z"]),m$=pu.filter(e=>!p$.has(e));function g$(e){const t=[];return m$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zc={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:rS(4,13),y:rS(5,14)};zc.translateX=zc.x;zc.translateY=zc.y;const Go=new Set;let dE=!1,fE=!1;function OL(){if(fE){const e=Array.from(Go).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=g$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fE=!1,dE=!1,Go.forEach(e=>e.complete()),Go.clear()}function LL(){Go.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fE=!0)})}function y$(){LL(),OL()}class lv{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?(Go.add(this),dE||(dE=!0,gn.read(LL),gn.resolveKeyframes(OL))):(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),b$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function E$(e){const t=b$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function jL(e,t,n=1){const[r,s]=E$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return ML(a)?parseFloat(a):a}return zw(s)?jL(s,t,n+1):s}const DL=e=>t=>t.test(e),x$={test:e=>e==="auto",parse:e=>e},PL=[mu,ct,ji,Ma,gU,mU,x$],sS=e=>PL.find(DL(e));class BL extends lv{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 iS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(co.test(e)||e==="0")&&!e.startsWith("url("));function w$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function a0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(_$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const k$=40;class FL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Di.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>k$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&y$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Di.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!v$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(a0(t,this.options,n)),l&&l(),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 hE=2e4;function UL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=hE?1/0:t}const An=(e,t,n)=>e+(t-e)*n;function zy(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 N$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=zy(c,l,e+1/3),i=zy(c,l,e),a=zy(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function qm(e,t){return n=>n>0?t:e}const Vy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},S$=[cE,$o,sc],T$=e=>S$.find(t=>t.test(e));function aS(e){const t=T$(e);if(!t)return!1;let n=t.parse(e);return t===sc&&(n=N$(n)),n}const oS=(e,t)=>{const n=aS(e),r=aS(t);if(!n||!r)return qm(e,t);const s={...n};return i=>(s.red=Vy(n.red,r.red,i),s.green=Vy(n.green,r.green,i),s.blue=Vy(n.blue,r.blue,i),s.alpha=An(n.alpha,r.alpha,i),$o.transform(s))},A$=(e,t)=>n=>t(e(n)),th=(...e)=>e.reduce(A$),pE=new Set(["none","hidden"]);function C$(e,t){return pE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function I$(e,t){return n=>An(e,t,n)}function cv(e){return typeof e=="number"?I$:typeof e=="string"?zw(e)?qm:xr.test(e)?oS:L$:Array.isArray(e)?$L:typeof e=="object"?xr.test(e)?oS:R$:qm}function $L(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>cv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function O$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=co.createTransformer(t),r=kf(e),s=kf(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?pE.has(e)&&!s.values.length||pE.has(t)&&!r.values.length?C$(e,t):th($L(O$(r,s),s.values),n):qm(e,t)};function HL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?An(e,t,n):cv(e)(e,t)}const M$=5;function zL(e,t,n){const r=Math.max(t-M$,0);return fL(n-e(r),t-r)}const On={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ky=.001;function j$({duration:e=On.duration,bounce:t=On.bounce,velocity:n=On.velocity,mass:r=On.mass}){let s,i,a=1-t;a=pa(On.minDamping,On.maxDamping,a),e=pa(On.minDuration,On.maxDuration,la(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=mE(u,a),m=Math.exp(-f);return Ky-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),g=mE(Math.pow(u,2),a);return(-s(u)+Ky>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Ky+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=P$(s,i,l);if(e=oa(e),isNaN(c))return{stiffness:On.stiffness,damping:On.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const D$=12;function P$(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function U$(e){let t={velocity:On.velocity,stiffness:On.stiffness,damping:On.damping,mass:On.mass,isResolvedFromDuration:!1,...e};if(!lS(e,F$)&&lS(e,B$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*pa(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:On.mass,stiffness:s,damping:i}}else{const n=j$(e);t={...t,...n,mass:On.mass},t.isResolvedFromDuration=!0}return t}function VL(e=On.visualDuration,t=On.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=U$({...n,velocity:-la(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=la(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?On.restSpeed.granular:On.restSpeed.default),s||(s=b?On.restDelta.granular:On.restDelta.default);let x;if(g<1){const k=mE(y,g);x=N=>{const T=Math.exp(-g*y*N);return a-T*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const T=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-T*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let T=0;g<1&&(T=k===0?oa(m):zL(x,k,N));const S=Math.abs(T)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(UL(_),hE),N=pL(T=>_.next(k*T).value,k,30);return k+"ms "+N}};return _}function cS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const T=S=>{p(h.value)&&(k=S,N=VL({keyframes:[h.value,m(h.value)],velocity:zL(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),T(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const $$=eh(.42,0,1,1),H$=eh(0,0,.58,1),KL=eh(.42,0,.58,1),z$=e=>Array.isArray(e)&&typeof e[0]!="number",V$={linear:ds,easeIn:$$,easeInOut:KL,easeOut:H$,circIn:sv,circInOut:kL,circOut:_L,backIn:rv,backInOut:wL,backOut:xL,anticipate:vL},uS=e=>{if(nv(e)){VO(e.length===4);const[t,n,r,s]=e;return eh(t,n,r,s)}else if(typeof e=="string")return V$[e];return e};function K$(e,t,n){const r=[],s=n||HL,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 l=K$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(pa(e[0],e[i-1],d)):u}function W$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Hc(0,t,r);e.push(An(n,1,s))}}function G$(e){const t=[0];return W$(t,e.length-1),t}function q$(e,t){return e.map(n=>n*t)}function X$(e,t){return e.map(()=>t||KL).splice(0,e.length-1)}function Xm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=z$(r)?r.map(uS):uS(r),i={done:!1,value:t[0]},a=q$(n&&n.length===t.length?n:G$(t),e),l=Y$(a,t,{ease:Array.isArray(s)?s:X$(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const Q$=e=>{const t=({timestamp:n})=>e(n);return{start:()=>gn.update(t,!0),stop:()=>lo(t),now:()=>ur.isProcessing?ur.timestamp:Di.now()}},Z$={decay:cS,inertia:cS,tween:Xm,keyframes:Xm,spring:VL},J$=e=>e/100;class uv extends FL{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)||lv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=tv(n)?n:Z$[n]||Xm;let c,u;l!==Xm&&typeof t[0]!="number"&&(c=th(J$,HL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=UL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=pa(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return T&&s!==void 0&&(k.value=a0(c,this.options,s)),w&&w(k.value),T&&this.finish(),k}get duration(){const{resolved:t}=this;return t?la(t.calculatedDuration):0}get time(){return la(this.currentTime)}set time(t){t=oa(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=la(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Q$,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 e7=new Set(["opacity","clipPath","filter","transform"]);function t7(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=gL(l,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 n7=ev(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qm=10,r7=2e4;function s7(e){return tv(e.type)||e.type==="spring"||!mL(e.ease)}function i7(e,t){const n=new uv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Gm()&&a7(i)&&(i=YL[i]),s7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=i7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=t7(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(JN(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(a0(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 la(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return la(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=oa(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 ds;const{animation:r}=n;JN(r,t)}return ds}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:l}=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 uv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=oa(this.time);u.setWithVelocity(m.sample(g-Qm).value,m.sample(g).value,Qm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return n7()&&r&&e7.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const o7={type:"spring",stiffness:500,damping:25,restSpeed:10},l7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),c7={type:"keyframes",duration:.8},u7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},d7=(e,{keyframes:t})=>t.length>2?c7:yl.has(e)?e.startsWith("scale")?l7(t[1]):o7:u7;function f7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const dv=(e,t,n,r={},s,i)=>a=>{const l=Xw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-oa(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};f7(l)||(d={...d,...d7(e,d)}),d.duration&&(d.duration=oa(d.duration)),d.repeatDelay&&(d.repeatDelay=oa(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=a0(d.keyframes,l);if(h!==void 0)return gn.update(()=>{d.onUpdate(h),d.onComplete()}),new VU([])}return!i&&dS.supports(d)?new dS(d):new uv(d)};function h7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function WL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&h7(d,f))continue;const m={delay:n,...Xw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=hL(e);if(y){const b=window.MotionHandoffAnimation(y,f,gn);b!==null&&(m.startTime=b,g=!0)}}oE(e,f),h.start(dv(f,h,p,e.shouldReduceMotion&&dL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{gn.update(()=>{l&&UU(e,l)})}),u}function gE(e,t,n={}){var r;const s=i0(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(WL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return p7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function p7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(m7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(gE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function m7(e,t){return e.sortNodePosition(t)}function g7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>gE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=gE(e,t,n);else{const s=typeof t=="function"?i0(e,t,n.custom):t;r=Promise.all(WL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const y7=Bw.length;function GL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?GL(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})=>g7(e,n,r)))}function w7(e){let t=x7(e),n=fS(),r=!0;const s=c=>(u,d)=>{var f;const h=i0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=GL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(x)?x:[x];let D=I.reduce(s(y),{});k===!1&&(D={});const{prevResolvedValues:U={}}=b,W={...U,...D},M=j=>{S=!0,h.has(j)&&(R=!0,h.delete(j)),b.needsAnimating[j]=!0;const L=e.getValue(j);L&&(L.liveStyle=!1)};for(const j in W){const L=D[j],P=U[j];if(p.hasOwnProperty(j))continue;let A=!1;aE(L)&&aE(P)?A=!uL(L,P):A=L!==P,A?L!=null?M(j):h.add(j):L!==void 0&&h.has(j)?M(j):b.protectedKeys[j]=!0}b.prevProp=x,b.prevResolvedValues=D,b.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&T)||R)&&f.push(...I.map(j=>({animation:j,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=fS(),r=!0}}}function v7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!uL(t,e):!1}function No(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fS(){return{animate:No(!0),whileInView:No(),whileHover:No(),whileTap:No(),whileDrag:No(),whileFocus:No(),exit:No()}}class po{constructor(t){this.isMounted=!1,this.node=t}update(){}}class _7 extends po{constructor(t){super(t),t.animationState||(t.animationState=w7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();r0(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 k7=0;class N7 extends po{constructor(){super(...arguments),this.id=k7++}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 S7={animation:{Feature:_7},exit:{Feature:N7}},ni={x:!1,y:!1};function qL(){return ni.x||ni.y}function T7(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}const fv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Nf(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function nh(e){return{point:{x:e.pageX,y:e.pageY}}}const A7=e=>t=>fv(t)&&e(t,nh(t));function Dd(e,t,n,r){return Nf(e,t,A7(n),r)}const hS=(e,t)=>Math.abs(e-t);function C7(e,t){const n=hS(e.x,t.x),r=hS(e.y,t.y);return Math.sqrt(n**2+r**2)}class XL{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=Wy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=C7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=ur;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Yy(h,this.transformPagePoint),gn.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Wy(f.type==="pointercancel"?this.lastMoveEventInfo:Yy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!fv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=nh(t),l=Yy(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ur;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Wy(l,this.history)),this.removeListeners=th(Dd(this.contextWindow,"pointermove",this.handlePointerMove),Dd(this.contextWindow,"pointerup",this.handlePointerUp),Dd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lo(this.updatePoint)}}function Yy(e,t){return t?{point:t(e.point)}:e}function pS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wy({point:e},t){return{point:e,delta:pS(e,QL(t)),offset:pS(e,I7(t)),velocity:R7(t,.1)}}function I7(e){return e[0]}function QL(e){return e[e.length-1]}function R7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=QL(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>oa(t)));)n--;if(!r)return{x:0,y:0};const i=la(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 ZL=1e-4,O7=1-ZL,L7=1+ZL,JL=.01,M7=0-JL,j7=0+JL;function ms(e){return e.max-e.min}function D7(e,t,n){return Math.abs(e-t)<=n}function mS(e,t,n,r=.5){e.origin=r,e.originPoint=An(t.min,t.max,e.origin),e.scale=ms(n)/ms(t),e.translate=An(n.min,n.max,e.origin)-e.originPoint,(e.scale>=O7&&e.scale<=L7||isNaN(e.scale))&&(e.scale=1),(e.translate>=M7&&e.translate<=j7||isNaN(e.translate))&&(e.translate=0)}function Pd(e,t,n,r){mS(e.x,t.x,n.x,r?r.originX:void 0),mS(e.y,t.y,n.y,r?r.originY:void 0)}function gS(e,t,n){e.min=n.min+t.min,e.max=e.min+ms(t)}function P7(e,t,n){gS(e.x,t.x,n.x),gS(e.y,t.y,n.y)}function yS(e,t,n){e.min=t.min-n.min,e.max=e.min+ms(t)}function Bd(e,t,n){yS(e.x,t.x,n.x),yS(e.y,t.y,n.y)}function B7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?An(n,e,r.max):Math.min(e,n)),e}function bS(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 F7(e,{top:t,left:n,bottom:r,right:s}){return{x:bS(e.x,n,s),y:bS(e.y,t,r)}}function ES(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Hc(t.min,t.max-r,e.min):r>s&&(n=Hc(e.min,e.max-s,t.min)),pa(0,1,n)}function H7(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 yE=.35;function z7(e=yE){return e===!1?e=0:e===!0&&(e=yE),{x:xS(e,"left","right"),y:xS(e,"top","bottom")}}function xS(e,t,n){return{min:wS(e,t),max:wS(e,n)}}function wS(e,t){return typeof e=="number"?e:e[t]||0}const vS=()=>({translate:0,scale:1,origin:0,originPoint:0}),ic=()=>({x:vS(),y:vS()}),_S=()=>({min:0,max:0}),Bn=()=>({x:_S(),y:_S()});function Ts(e){return[e("x"),e("y")]}function eM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function V7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function K7(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 Gy(e){return e===void 0||e===1}function bE({scale:e,scaleX:t,scaleY:n}){return!Gy(e)||!Gy(t)||!Gy(n)}function Io(e){return bE(e)||tM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function tM(e){return kS(e.x)||kS(e.y)}function kS(e){return e&&e!=="0%"}function Zm(e,t,n){const r=e-n,s=t*r;return n+s}function NS(e,t,n,r,s){return s!==void 0&&(e=Zm(e,s,r)),Zm(e,n,r)+t}function EE(e,t=0,n=1,r,s){e.min=NS(e.min,t,n,r,s),e.max=NS(e.max,t,n,r,s)}function nM(e,{x:t,y:n}){EE(e.x,t.translate,t.scale,t.originPoint),EE(e.y,n.translate,n.scale,n.originPoint)}const SS=.999999999999,TS=1.0000000000001;function Y7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lSS&&(t.x=1),t.ySS&&(t.y=1)}function ac(e,t){e.min=e.min+t,e.max=e.max+t}function AS(e,t,n,r,s=.5){const i=An(e.min,e.max,s);EE(e,t,n,i,r)}function oc(e,t){AS(e.x,t.x,t.scaleX,t.scale,t.originX),AS(e.y,t.y,t.scaleY,t.scale,t.originY)}function rM(e,t){return eM(K7(e.getBoundingClientRect(),t))}function W7(e,t,n){const r=rM(e,n),{scroll:s}=t;return s&&(ac(r.x,s.offset.x),ac(r.y,s.offset.y)),r}const sM=({current:e})=>e?e.ownerDocument.defaultView:null,G7=new WeakMap;class q7{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=Bn(),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(nh(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=T7(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),Ts(w=>{let y=this.getAxisMotionValue(w).get()||0;if(ji.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=ms(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&gn.postRender(()=>m(d,f)),oE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=X7(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ts(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 XL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:sM(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&&gn.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||!lp(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=B7(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&&rc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=F7(s.layoutBox,n):this.constraints=!1,this.elastic=z7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ts(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=H7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rc(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=W7(r,s.root,this.visualElement.getTransformPagePoint());let a=U7(s.layout.layoutBox,i);if(n){const l=n(V7(a));this.hasMutatedConstraints=!!l,l&&(a=eM(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ts(d=>{if(!lp(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oE(this.visualElement,t),r.start(dv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ts(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ts(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){Ts(n=>{const{drag:r}=this.getProps();if(!lp(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-An(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ts(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=$7({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(),Ts(a=>{if(!lp(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(An(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;G7.set(this.visualElement,this);const t=this.visualElement.current,n=Dd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();rc(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()),gn.read(r);const a=Nf(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ts(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=yE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function lp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function X7(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Q7 extends po{constructor(t){super(t),this.removeGroupControls=ds,this.removeListeners=ds,this.controls=new q7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ds}unmount(){this.removeGroupControls(),this.removeListeners()}}const CS=e=>(t,n)=>{e&&gn.postRender(()=>e(t,n))};class Z7 extends po{constructor(){super(...arguments),this.removePointerDownListener=ds}onPointerDown(t){this.session=new XL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:CS(t),onStart:CS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&gn.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Dd(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 nm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function IS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=IS(e,t.target.x),r=IS(e,t.target.y);return`${n}% ${r}%`}},J7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=co.parse(e);if(s.length>5)return r;const i=co.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=An(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class eH extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;SU(tH),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()})),nm.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()||gn.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Uw.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 iM(e){const[t,n]=HO(),r=E.useContext(jw);return o.jsx(eH,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(QO),isPresent:t,safeToRemove:n})}const tH={borderRadius:{...qu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qu,borderTopRightRadius:qu,borderBottomLeftRadius:qu,borderBottomRightRadius:qu,boxShadow:J7};function nH(e,t,n){const r=vr(e)?e:_f(e);return r.start(dv("",r,t,n)),r.animation}function rH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const sH=(e,t)=>e.depth-t.depth;class iH{constructor(){this.children=[],this.isDirty=!1}add(t){Qw(this.children,t),this.isDirty=!0}remove(t){Zw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sH),this.isDirty=!1,this.children.forEach(t)}}function aH(e,t){const n=Di.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(lo(r),e(i-t))};return gn.read(r,!0),()=>lo(r)}const aM=["TopLeft","TopRight","BottomLeft","BottomRight"],oH=aM.length,RS=e=>typeof e=="string"?parseFloat(e):e,OS=e=>typeof e=="number"||ct.test(e);function lH(e,t,n,r,s,i){s?(e.opacity=An(0,n.opacity!==void 0?n.opacity:1,cH(r)),e.opacityExit=An(t.opacity!==void 0?t.opacity:1,0,uH(r))):i&&(e.opacity=An(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Hc(e,t,r))}function MS(e,t){e.min=t.min,e.max=t.max}function Ss(e,t){MS(e.x,t.x),MS(e.y,t.y)}function jS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function DS(e,t,n,r,s){return e-=t,e=Zm(e,1/n,r),s!==void 0&&(e=Zm(e,1/s,r)),e}function dH(e,t=0,n=1,r=.5,s,i=e,a=e){if(ji.test(t)&&(t=parseFloat(t),t=An(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=An(i.min,i.max,r);e===i&&(l-=t),e.min=DS(e.min,t,n,l,s),e.max=DS(e.max,t,n,l,s)}function PS(e,t,[n,r,s],i,a){dH(e,t[n],t[r],t[s],t.scale,i,a)}const fH=["x","scaleX","originX"],hH=["y","scaleY","originY"];function BS(e,t,n,r){PS(e.x,t,fH,n?n.x:void 0,r?r.x:void 0),PS(e.y,t,hH,n?n.y:void 0,r?r.y:void 0)}function FS(e){return e.translate===0&&e.scale===1}function lM(e){return FS(e.x)&&FS(e.y)}function US(e,t){return e.min===t.min&&e.max===t.max}function pH(e,t){return US(e.x,t.x)&&US(e.y,t.y)}function $S(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function cM(e,t){return $S(e.x,t.x)&&$S(e.y,t.y)}function HS(e){return ms(e.x)/ms(e.y)}function zS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class mH{constructor(){this.members=[]}add(t){Qw(this.members,t),t.scheduleRender()}remove(t){if(Zw(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 gH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Ro={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},gd=typeof window<"u"&&window.MotionDebug!==void 0,qy=["","X","Y","Z"],yH={visibility:"hidden"},VS=1e3;let bH=0;function Xy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function uM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=hL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",gn,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&uM(r)}function dM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=bH++,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,gd&&(Ro.totalNodes=Ro.resolvedTargetDeltas=Ro.recalculatedProjection=0),this.nodes.forEach(wH),this.nodes.forEach(SH),this.nodes.forEach(TH),this.nodes.forEach(vH),gd&&window.MotionDebug.record(Ro)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=aH(h,250),nm.hasAnimatedSinceResize&&(nm.hasAnimatedSinceResize=!1,this.nodes.forEach(YS))})}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 g=this.options.transition||d.getDefaultTransition()||OH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!cM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Xw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||YS(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,lo(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(AH),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&&uM(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;WS(f.x,a.x,k),WS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bd(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),IH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&pH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Bn()),Ss(x,this.relativeTarget)),g&&(this.animationValues=d,lH(d,u,this.latestValues,k,b,y)),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&&(lo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gn.update(()=>{nm.hasAnimatedSinceResize=!0,this.currentAnimation=nH(0,VS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(VS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&fM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Bn();const f=ms(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=ms(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Ss(l,c),oc(l,d),Pd(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new mH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Xy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(KS),this.root.sharedNodes.clear()}}}function EH(e){e.updateLayout()}function xH(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"?Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ms(h);h.min=r[f].min,h.max=h.min+p}):fM(i,n.layoutBox,r)&&Ts(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=ms(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=ic();Pd(l,r,n.layoutBox);const c=ic();a?Pd(c,e.applyTransform(s,!0),n.measuredBox):Pd(c,r,n.layoutBox);const u=!lM(l);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=Bn();Bd(m,n.layoutBox,h.layoutBox);const g=Bn();Bd(g,r,p.layoutBox),cM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function wH(e){gd&&Ro.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 vH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _H(e){e.clearSnapshot()}function KS(e){e.clearMeasurements()}function kH(e){e.isLayoutDirty=!1}function NH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function YS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function SH(e){e.resolveTargetDelta()}function TH(e){e.calcProjection()}function AH(e){e.resetSkewAndRotation()}function CH(e){e.removeLeadSnapshot()}function WS(e,t,n){e.translate=An(t.translate,0,n),e.scale=An(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function GS(e,t,n,r){e.min=An(t.min,n.min,r),e.max=An(t.max,n.max,r)}function IH(e,t,n,r){GS(e.x,t.x,n.x,r),GS(e.y,t.y,n.y,r)}function RH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const OH={duration:.45,ease:[.4,0,.1,1]},qS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),XS=qS("applewebkit/")&&!qS("chrome/")?Math.round:ds;function QS(e){e.min=XS(e.min),e.max=XS(e.max)}function LH(e){QS(e.x),QS(e.y)}function fM(e,t,n){return e==="position"||e==="preserve-aspect"&&!D7(HS(t),HS(n),.2)}function MH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const jH=dM({attachResizeListener:(e,t)=>Nf(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qy={current:void 0},hM=dM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qy.current){const e=new jH({});e.mount(window),e.setOptions({layoutScroll:!0}),Qy.current=e}return Qy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),DH={pan:{Feature:Z7},drag:{Feature:Q7,ProjectionNode:hM,MeasureLayout:iM}};function PH(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 pM(e,t){const n=PH(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ZS(e){return t=>{t.pointerType==="touch"||qL()||e(t)}}function BH(e,t,n={}){const[r,s,i]=pM(e,n),a=ZS(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=ZS(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function JS(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&&gn.postRender(()=>i(t,nh(t)))}class FH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=BH(t,n=>(JS(this.node,n,"Start"),r=>JS(this.node,r,"End"))))}unmount(){}}class UH extends po{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=th(Nf(this.node.current,"focus",()=>this.onFocus()),Nf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const mM=(e,t)=>t?e===t?!0:mM(e,t.parentElement):!1,$H=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HH(e){return $H.has(e.tagName)||e.tabIndex!==-1}const yd=new WeakSet;function eT(e){return t=>{t.key==="Enter"&&e(t)}}function Zy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=eT(()=>{if(yd.has(n))return;Zy(n,"down");const s=eT(()=>{Zy(n,"up")}),i=()=>Zy(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 tT(e){return fv(e)&&!qL()}function VH(e,t,n={}){const[r,s,i]=pM(e,n),a=l=>{const c=l.currentTarget;if(!tT(l)||yd.has(c))return;yd.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!tT(p)||!yd.has(c))&&(yd.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||mM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!HH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>zH(u,s),s)}),i}function nT(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&&gn.postRender(()=>i(t,nh(t)))}class KH extends po{mount(){const{current:t}=this.node;t&&(this.unmount=VH(t,n=>(nT(this.node,n,"Start"),(r,{success:s})=>nT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xE=new WeakMap,Jy=new WeakMap,YH=e=>{const t=xE.get(e.target);t&&t(e)},WH=e=>{e.forEach(YH)};function GH({root:e,...t}){const n=e||document;Jy.has(n)||Jy.set(n,{});const r=Jy.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(WH,{root:e,...t})),r[s]}function qH(e,t,n){const r=GH(t);return xE.set(e,n),r.observe(e),()=>{xE.delete(e),r.unobserve(e)}}const XH={some:0,all:1};class QH extends po{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:XH[s]},l=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 qH(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ZH(t,n))&&this.startObserver()}unmount(){}}function ZH({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const JH={inView:{Feature:QH},tap:{Feature:KH},focus:{Feature:UH},hover:{Feature:FH}},ez={layout:{ProjectionNode:hM,MeasureLayout:iM}},wE={current:null},gM={current:!1};function tz(){if(gM.current=!0,!!Dw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wE.current=e.matches;e.addListener(t),t()}else wE.current=!1}const nz=[...PL,xr,co],rz=e=>nz.find(DL(e)),rT=new WeakMap;function sz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(vr(s))e.addValue(r,s);else if(vr(i))e.addValue(r,_f(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,_f(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lv,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=Di.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),gM.current||tz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:wE.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){rT.delete(this.current),this.projection&&this.projection.unmount(),lo(this.notifyUpdate),lo(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=yl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&gn.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 $c){const n=$c[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):Bn()}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=_f(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"&&(ML(s)||NL(s))?s=parseFloat(s):!rz(s)&&co.test(n)&&(s=RL(t,n)),this.setBaseTarget(t,vr(s)?s.get():s)),vr(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=Hw(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&&!vr(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 Jw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class yM extends iz{constructor(){super(...arguments),this.KeyframeResolver=BL}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;vr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function az(e){return window.getComputedStyle(e)}class oz extends yM{constructor(){super(...arguments),this.type="html",this.renderInstance=sL}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}else{const r=az(t),s=(tL(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rM(t,n)}build(t,n,r){Kw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return qw(t,n,r)}}class lz extends yM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(yl.has(n)){const r=ov(n);return r&&r.default||0}return n=iL.has(n)?n:Fw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return lL(t,n,r)}build(t,n,r){Yw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){aL(t,n,r,s)}mount(t){this.isSVGTag=Gw(t.tagName),super.mount(t)}}const cz=(e,t)=>$w(e)?new lz(t):new oz(t,{allowProjection:e!==E.Fragment}),uz=jU({...S7,...JH,...DH,...ez},cz),Zt=X9(uz);function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Ul(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var dz=["container"];function fz(e){var t=e.container,n=t===void 0?document.body:t,r=o0(e,dz);return ps.createPortal(kt.createElement("div",er({},r)),n)}function hz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 pz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 mz(e){return kt.createElement("svg",er({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function gz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function aT(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 Fa=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function eb(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Fa(e,i,n,innerWidth)[0],f=Fa(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function kE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function tb(e,t,n){var r=kE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function up(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var bz={T:0,L:0,W:0,H:0,FIT:void 0},EM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},Ez=["className"];function xz(e){var t=e.className,n=t===void 0?"":t,r=o0(e,Ez);return kt.createElement("div",er({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var wz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function vz(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=o0(e,wz),u=EM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",er({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(xz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var _z={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 kz(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,T=e.expose,S=Jm(_z),R=S[0],I=S[1],D=E.useRef(0),U=EM(),W=R.naturalWidth,M=W===void 0?i:W,$=R.naturalHeight,C=$===void 0?l:$,j=R.width,L=j===void 0?i:j,P=R.height,A=P===void 0?l:P,z=R.loaded,G=z===void 0?!n:z,B=R.broken,re=R.x,Q=R.y,se=R.touched,de=R.stopRaf,te=R.maskTouched,pe=R.rotate,ne=R.scale,ye=R.CX,ge=R.CY,be=R.lastX,xe=R.lastY,ke=R.lastCX,Ae=R.lastCY,He=R.lastScale,Ce=R.touchTime,gt=R.touchLength,Ge=R.pause,ze=R.reach,le=qo({onScale:function(ce){return Ee(cp(ce))},onRotate:function(ce){pe!==ce&&(T({rotate:ce}),I(er({rotate:ce},tb(M,C,ce))))}});function Ee(ce,Ve,at){ne!==ce&&(T({scale:ce}),I(er({scale:ce},eb(re,Q,L,A,ne,ce,Ve,at),ce<=1&&{x:0,y:0})))}var ut=up(function(ce,Ve,at){if(at===void 0&&(at=0),(se||te)&&N){var rn=kE(pe,L,A),sn=rn[0],fn=rn[1];if(at===0&&D.current===0){var Wt=Math.abs(ce-ye)<=20,Jt=Math.abs(Ve-ge)<=20;if(Wt&&Jt)return void I({lastCX:ce,lastCY:Ve});D.current=Wt?Ve>ge?3:2:1}var Mn,Vn=ce-ke,Kn=Ve-Ae;if(at===0){var vt=Fa(Vn+be,ne,sn,innerWidth)[0],an=Fa(Kn+xe,ne,fn,innerHeight);Mn=function(Se,ve,Qe,ot){return ve&&Se===1||ot==="x"?"x":Qe&&Se>1||ot==="y"?"y":void 0}(D.current,vt,an[0],ze),Mn!==void 0&&x(Mn,ce,Ve,ne)}if(Mn==="x"||te)return void I({reach:"x"});var ue=cp(ne+(at-gt)/100/2*ne,M/L,.2);T({scale:ue}),I(er({touchLength:at,reach:Mn,scale:ue},eb(re,Q,L,A,ne,ue,ce,Ve,Vn,Kn)))}},{maxWait:8});function ft(ce){return!de&&!se&&(U.current&&I(er({},ce,{pause:u})),U.current)}var X,ee,me,Le,Ye,Ze,Pt,bt,Bt=(Ye=function(ce){return ft({x:ce})},Ze=function(ce){return ft({y:ce})},Pt=function(ce){return U.current&&(T({scale:ce}),I({scale:ce})),!se&&U.current},bt=qo({X:function(ce){return Ye(ce)},Y:function(ce){return Ze(ce)},S:function(ce){return Pt(ce)}}),function(ce,Ve,at,rn,sn,fn,Wt,Jt,Mn,Vn,Kn){var vt=kE(Vn,sn,fn),an=vt[0],ue=vt[1],Se=Fa(ce,Jt,an,innerWidth),ve=Se[0],Qe=Se[1],ot=Fa(Ve,Jt,ue,innerHeight),et=ot[0],lt=ot[1],Vt=Date.now()-Kn;if(Vt>=200||Jt!==Wt||Math.abs(Mn-Wt)>1){var Kt=eb(ce,Ve,sn,fn,Wt,Jt),J=Kt.x,rt=Kt.y,Ue=ve?Qe:J!==ce?J:null,qe=et?lt:rt!==Ve?rt:null;return Ue!==null&&jo(ce,Ue,bt.X),qe!==null&&jo(Ve,qe,bt.Y),void(Jt!==Wt&&jo(Wt,Jt,bt.S))}var Xe=(ce-at)/Vt,Rt=(Ve-rn)/Vt,Yn=Math.sqrt(Math.pow(Xe,2)+Math.pow(Rt,2)),Wn=!1,en=!1;(function(vn,Yt){var _n,kn=vn,Mt=0,Nn=0,mr=function(lr){_n||(_n=lr);var gr=lr-_n,Ar=Math.sign(vn),Ks=-.001*Ar,Hr=Math.sign(-kn)*Math.pow(kn,2)*2e-4,ns=kn*gr+(Ks+Hr)*Math.pow(gr,2)/2;Mt+=ns,_n=lr,Ar*(kn+=(Ks+Hr)*gr)<=0?jn():Yt(Mt)?Lt():jn()};function Lt(){Nn=requestAnimationFrame(mr)}function jn(){cancelAnimationFrame(Nn)}Lt()})(Yn,function(vn){var Yt=ce+vn*(Xe/Yn),_n=Ve+vn*(Rt/Yn),kn=Fa(Yt,Wt,an,innerWidth),Mt=kn[0],Nn=kn[1],mr=Fa(_n,Wt,ue,innerHeight),Lt=mr[0],jn=mr[1];if(Mt&&!Wn&&(Wn=!0,ve?jo(Yt,Nn,bt.X):oT(Nn,Yt+(Yt-Nn),bt.X)),Lt&&!en&&(en=!0,et?jo(_n,jn,bt.Y):oT(jn,_n+(_n-jn),bt.Y)),Wn&&en)return!1;var lr=Wn||bt.X(Nn),gr=en||bt.Y(jn);return lr&&gr})}),zt=(X=y,ee=function(ce,Ve){ze||Ee(ne!==1?1:Math.max(2,M/L),ce,Ve)},me=E.useRef(0),Le=up(function(){me.current=0,X.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ce=[].slice.call(arguments);me.current+=1,Le.apply(void 0,ce),me.current>=2&&(Le.cancel(),me.current=0,ee.apply(void 0,ce))});function Nt(ce,Ve){if(D.current=0,(se||te)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var at=cp(ne,M/L);if(Bt(re,Q,be,xe,L,A,ne,at,He,pe,Ce),_(ce,Ve),ye===ce&&ge===Ve){if(se)return void zt(ce,Ve);te&&b(ce,Ve)}}}function Ut(ce,Ve,at){at===void 0&&(at=0),I({touched:!0,CX:ce,CY:Ve,lastCX:ce,lastCY:Ve,lastX:re,lastY:Q,lastScale:ne,touchLength:at,touchTime:Date.now()})}function Be(ce){I({maskTouched:!0,CX:ce.clientX,CY:ce.clientY,lastX:re,lastY:Q})}Ul(Zi?void 0:"mousemove",function(ce){ce.preventDefault(),ut(ce.clientX,ce.clientY)}),Ul(Zi?void 0:"mouseup",function(ce){Nt(ce.clientX,ce.clientY)}),Ul(Zi?"touchmove":void 0,function(ce){ce.preventDefault();var Ve=aT(ce);ut.apply(void 0,Ve)},{passive:!1}),Ul(Zi?"touchend":void 0,function(ce){var Ve=ce.changedTouches[0];Nt(Ve.clientX,Ve.clientY)},{passive:!1}),Ul("resize",up(function(){G&&!se&&(I(tb(M,C,pe)),k())},{maxWait:8})),_E(function(){N&&T(er({scale:ne,rotate:pe},le))},[N]);var pt=function(ce,Ve,at,rn,sn,fn,Wt,Jt,Mn,Vn){var Kn=function(J,rt,Ue,qe,Xe){var Rt=E.useRef(!1),Yn=Jm({lead:!0,scale:Ue}),Wn=Yn[0],en=Wn.lead,vn=Wn.scale,Yt=Yn[1],_n=up(function(kn){try{return Xe(!0),Yt({lead:!1,scale:kn}),Promise.resolve()}catch(Mt){return Promise.reject(Mt)}},{wait:qe});return _E(function(){Rt.current?(Xe(!1),Yt({lead:!0}),_n(Ue)):Rt.current=!0},[Ue]),en?[J*vn,rt*vn,Ue/vn]:[J*Ue,rt*Ue,1]}(fn,Wt,Jt,Mn,Vn),vt=Kn[0],an=Kn[1],ue=Kn[2],Se=function(J,rt,Ue,qe,Xe){var Rt=E.useState(bz),Yn=Rt[0],Wn=Rt[1],en=E.useState(0),vn=en[0],Yt=en[1],_n=E.useRef(),kn=qo({OK:function(){return J&&Yt(4)}});function Mt(Nn){Xe(!1),Yt(Nn)}return E.useEffect(function(){if(_n.current||(_n.current=Date.now()),Ue){if(function(Nn,mr){var Lt=Nn&&Nn.current;if(Lt&&Lt.nodeType===1){var jn=Lt.getBoundingClientRect();mr({T:jn.top,L:jn.left,W:jn.width,H:jn.height,FIT:Lt.tagName==="IMG"?getComputedStyle(Lt).objectFit:void 0})}}(rt,Wn),J)return Date.now()-_n.current<250?(Yt(1),requestAnimationFrame(function(){Yt(2),requestAnimationFrame(function(){return Mt(3)})}),void setTimeout(kn.OK,qe)):void Yt(4);Mt(5)}},[J,Ue]),[vn,Yn]}(ce,Ve,at,Mn,Vn),ve=Se[0],Qe=Se[1],ot=Qe.W,et=Qe.FIT,lt=innerWidth/2,Vt=innerHeight/2,Kt=ve<3||ve>4;return[Kt?ot?Qe.L:lt:rn+(lt-fn*Jt/2),Kt?ot?Qe.T:Vt:sn+(Vt-Wt*Jt/2),vt,Kt&&et?vt*(Qe.H/ot):an,ve===0?ue:Kt?ot/(fn*Jt)||.01:ue,Kt?et?1:0:1,ve,et]}(u,c,G,re,Q,L,A,ne,d,function(ce){return I({pause:ce})}),Je=pt[4],Re=pt[6],It="transform "+d+"ms "+f,St={className:p,onMouseDown:Zi?void 0:function(ce){ce.stopPropagation(),ce.button===0&&Ut(ce.clientX,ce.clientY,0)},onTouchStart:Zi?function(ce){ce.stopPropagation(),Ut.apply(void 0,aT(ce))}:void 0,onWheel:function(ce){if(!ze){var Ve=cp(ne-ce.deltaY/100/2,M/L);I({stopRaf:!0}),Ee(Ve,ce.clientX,ce.clientY)}},style:{width:pt[2]+"px",height:pt[3]+"px",opacity:pt[5],objectFit:Re===4?void 0:pt[7],transform:pe?"rotate("+pe+"deg)":void 0,transition:Re>2?It+", opacity "+d+"ms ease, height "+(Re<4?d/2:Re>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Zi&&N?Be:void 0,onTouchStart:Zi&&N?function(ce){return Be(ce.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Je+", 0, 0, "+Je+", "+pt[0]+", "+pt[1]+")",transition:se||Ge?void 0:It,willChange:N?"transform":void 0}},n?kt.createElement(vz,er({src:n,loaded:G,broken:B},St,{onPhotoLoad:function(ce){I(er({},ce,ce.loaded&&tb(ce.naturalWidth||0,ce.naturalHeight||0,pe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:St,scale:Je,rotate:pe})))}var lT={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 Nz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,T=e.index,S=T===void 0?0:T,R=e.onIndexChange,I=e.visible,D=e.onClose,U=e.afterClose,W=e.portalContainer,M=Jm(lT),$=M[0],C=M[1],j=E.useState(0),L=j[0],P=j[1],A=$.x,z=$.touched,G=$.pause,B=$.lastCX,re=$.lastCY,Q=$.bg,se=Q===void 0?u:Q,de=$.lastBg,te=$.overlay,pe=$.minimal,ne=$.scale,ye=$.rotate,ge=$.onScale,be=$.onRotate,xe=e.hasOwnProperty("index"),ke=xe?S:L,Ae=xe?R:P,He=E.useRef(ke),Ce=N.length,gt=N[ke],Ge=typeof n=="boolean"?n:Ce>n,ze=function(Je,Re){var It=E.useReducer(function(at){return!at},!1)[1],St=E.useRef(0),ce=function(at){var rn=E.useRef(at);function sn(fn){rn.current=fn}return E.useMemo(function(){(function(fn){Je?(fn(Je),St.current=1):St.current=2})(sn)},[at]),[rn.current,sn]}(Je),Ve=ce[1];return[ce[0],St.current,function(){It(),St.current===2&&(Ve(!1),Re&&Re()),St.current=0}]}(I,U),le=ze[0],Ee=ze[1],ut=ze[2];_E(function(){if(le)return C({pause:!0,x:ke*-(innerWidth+Ol)}),void(He.current=ke);C(lT)},[le]);var ft=qo({close:function(Je){be&&be(0),C({overlay:!0,lastBg:se}),D(Je)},changeIndex:function(Je,Re){Re===void 0&&(Re=!1);var It=Ge?He.current+(Je-ke):Je,St=Ce-1,ce=vE(It,0,St),Ve=Ge?It:ce,at=innerWidth+Ol;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-at*Ve,pause:Re}),He.current=Ve,Ae&&Ae(Ge?Je<0?St:Je>St?0:Je:ce)}}),X=ft.close,ee=ft.changeIndex;function me(Je){return Je?X():C({overlay:!te})}function Le(){C({x:-(innerWidth+Ol)*ke,lastCX:void 0,lastCY:void 0,pause:!0}),He.current=ke}function Ye(Je,Re,It,St){Je==="x"?function(ce){if(B!==void 0){var Ve=ce-B,at=Ve;!Ge&&(ke===0&&Ve>0||ke===Ce-1&&Ve<0)&&(at=Ve/2),C({touched:!0,lastCX:B,x:-(innerWidth+Ol)*He.current+at,pause:!1})}else C({touched:!0,lastCX:ce,x:A,pause:!1})}(Re):Je==="y"&&function(ce,Ve){if(re!==void 0){var at=u===null?null:vE(u,.01,u-Math.abs(ce-re)/100/4);C({touched:!0,lastCY:re,bg:Ve===1?at:u,minimal:Ve===1})}else C({touched:!0,lastCY:ce,bg:se,minimal:!0})}(It,St)}function Ze(Je,Re){var It=Je-(B??Je),St=Re-(re??Re),ce=!1;if(It<-40)ee(ke+1);else if(It>40)ee(ke-1);else{var Ve=-(innerWidth+Ol)*He.current;Math.abs(St)>100&&pe&&f&&(ce=!0,X()),C({touched:!1,x:Ve,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ce||te})}}Ul("keydown",function(Je){if(I)switch(Je.key){case"ArrowLeft":ee(ke-1,!0);break;case"ArrowRight":ee(ke+1,!0);break;case"Escape":X()}});var Pt=function(Je,Re,It){return E.useMemo(function(){var St=Je.length;return It?Je.concat(Je).concat(Je).slice(St+Re-1,St+Re+2):Je.slice(Math.max(Re-1,0),Math.min(Re+2,St+1))},[Je,Re,It])}(N,ke,Ge);if(!le)return null;var bt=te&&!Ee,Bt=I?se:de,zt=ge&&be&&{images:N,index:ke,visible:I,onClose:X,onIndexChange:ee,overlayVisible:bt,overlay:gt&>.overlay,scale:ne,rotate:ye,onScale:ge,onRotate:be},Nt=r?r(Ee):400,Ut=s?s(Ee):iT,Be=r?r(3):600,pt=s?s(3):iT;return kt.createElement(fz,{className:"PhotoView-Portal"+(bt?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(Je){return Je.stopPropagation()},container:W},I&&kt.createElement(gz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ee===1?" PhotoView-Slider__fadeIn":Ee===2?" PhotoView-Slider__fadeOut":""),style:{background:Bt?"rgba(0, 0, 0, "+Bt+")":void 0,transitionTimingFunction:Ut,transitionDuration:(z?0:Nt)+"ms",animationDuration:Nt+"ms"},onAnimationEnd:ut}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},ke+1," / ",Ce),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&zt&&g(zt),kt.createElement(hz,{className:"PhotoView-Slider__toolbarIcon",onClick:X}))),Pt.map(function(Je,Re){var It=Ge||ke!==0?He.current-1+Re:ke+Re;return kt.createElement(kz,{key:Ge?Je.key+"/"+Je.src+"/"+It:Je.key,item:Je,speed:Nt,easing:Ut,visible:I,onReachMove:Ye,onReachUp:Ze,onPhotoTap:function(){return me(i)},onMaskTap:function(){return me(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Ol)*It+"px",transform:"translate3d("+A+"px, 0px, 0)",transition:z||G?void 0:"transform "+Be+"ms "+pt},loadingElement:_,brokenElement:k,onPhotoResize:Le,isActive:He.current===It,expose:C})}),!Zi&&p&&kt.createElement(kt.Fragment,null,(Ge||ke!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ee(ke-1,!0)}},kt.createElement(pz,null)),(Ge||ke+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=qo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return er({},a,h)},[a,h]);return kt.createElement(bM.Provider,{value:m},t,kt.createElement(Nz,er({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var xM=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(bM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=qo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,er({},g,{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 Cz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wM=(...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 Iz={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 Rz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...Iz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wM("lucide",s),...l},[...a.map(([u,d])=>E.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 De=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(Rz,{ref:i,iconNode:t,className:wM(`lucide-${Cz(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 Oz=De("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 Lz=De("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** - * @license lucide-react v0.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 hv=De("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 vM=De("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 Fd=De("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 _M=De("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 kM=De("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 Mz=De("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 il=De("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 NM=De("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 jz=De("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 Dz=De("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 zs=De("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 pv=De("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 Pz=De("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 Ds=De("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 l0=De("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 SM=De("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 NE=De("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 Bz=De("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 mv=De("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 c0=De("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 Fz=De("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 Uz=De("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 rm=De("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 u0=De("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 $z=De("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 gv=De("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 Hz=De("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 yv=De("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 zz=De("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 cT=De("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 Vz=De("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 Kz=De("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 bv=De("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 Yz=De("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 TM=De("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 Wz=De("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 Gz=De("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 qz=De("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 Ev=De("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 AM=De("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 Xz=De("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 Qz=De("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 d0=De("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 Zz=De("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 Jz=De("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 xv=De("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 mo=De("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 eV=De("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 CM=De("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 tV=De("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 IM=De("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 nV=De("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 Ft=De("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 rV=De("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 sV=De("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 _c=De("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 iV=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @license lucide-react v0.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 RM=De("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 aV=De("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 oV=De("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 lV=De("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 cV=De("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** - * @license lucide-react v0.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 OM=De("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 uV=De("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 dV=De("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 fV=De("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 hV=De("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 dr=De("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 LM=De("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 wv=De("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 pV=De("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 mV=De("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 Sf=De("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 gV=De("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 yV=De("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 uT=De("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 al=De("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 bV=De("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 Fi=De("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 EV=De("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 xV=De("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 wV=De("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 vV=De("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 _V=De("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 MM=De("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 pr=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),dT="veadk_auth_qs";let Xu=null;function kV(){if(Xu!==null)return Xu;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(dT,t),Xu=t):Xu=sessionStorage.getItem(dT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Xu}function Pi(e){const t=kV();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 gu=3e4,rh=12e4,jM=1e4;function pi(e,t=gu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const eg="veadk_local_user",tg="veadk_local_user_tab",NV=/^[A-Za-z0-9]{1,16}$/;function DM(){try{const e=sessionStorage.getItem(tg);if(e)return e;const t=localStorage.getItem(eg);return t&&sessionStorage.setItem(tg,t),t}catch{try{return localStorage.getItem(eg)}catch{return null}}}function fT(e){try{sessionStorage.setItem(tg,e)}catch{}try{localStorage.setItem(eg,e)}catch{}}function SV(){try{sessionStorage.removeItem(tg)}catch{}try{localStorage.removeItem(eg)}catch{}}function f0(e){const t=new Headers(e),n=DM();return n&&t.set("X-VeADK-Local-User",n),t}async function PM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:pi(void 0,jM)})}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 TV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function AV(){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 CV(){const[e,t]=await Promise.all([SE(),PM()]);return e.status==="unauthenticated"&&t.length>0}function IV(){window.location.assign("/oauth2/logout")}async function SE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:pi(void 0,jM)})}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=DM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function RV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function OV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const TE="veadk:authentication-required";let Ud=null,bd=null;function LV(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 MV(e){Ud||(Ud=new Promise(n=>{bd=n}),window.dispatchEvent(new Event(TE)));const t=Ud;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 jV(){return Ud!==null}function DV(){bd==null||bd(),bd=null,Ud=null}async function h0(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 PV=/\brun_sse\s*failed\s*:\s*404\b/i,BV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,hT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function dp(e){const t=String(e);return BV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!PV.test(t)||t.includes(hT)?t:`${t} - -${hT}`}async function*vv(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 l=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const c=l.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 FV=255,UV=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function $V(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let r=0,s="";for(const i of t){if(!UV.test(i))continue;const a=n.encode(i).byteLength;if(r+a>FV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const _v="veadk.messageFeedback.v1";function kv(e,t,n,r){return[e,t,n,r].join(":")}function Nv(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(_v)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function HV(e,t,n){if(typeof window>"u")return;const r=Nv();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(_v,JSON.stringify(r))}function BM(e){if(typeof window>"u")return;const t=kv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Nv(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(_v,JSON.stringify(n))}}const sm="",Sv=new Map;function FM(e,t){Sv.set(e,t)}function UM(){Sv.clear()}function Qn(e){const t=Sv.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 mt(e,t={},n={},r=gu){const s={...t,headers:f0(t.headers)},i=()=>{const c={...s,signal:pi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Pi(`${sm}/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(Pi(`${sm}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Pi(`${sm}${e}`),c)},a=async c=>{if(LV(c))return!0;if(c.status!==401)return!1;try{return await CV()}catch{return!1}};let l=await i();for(;await a(l);)await MV(t.signal),l=await i();return l}function zV(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 dn(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return zV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function $M(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class sh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Ya extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const VV="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",KV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",YV=3e4,AE=new Map;function HM(e,t){return`${t}:${e}`}async function WV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function p0(e,t,n){const r=await mt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await WV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new sh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new Ya(VV);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new Ya(KV);if(n!=null&&n.runtimeId&&r.status===404)throw new Ya("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new Ya("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await dn(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&AE.set(HM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+YV}),i}async function ng(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,l=await dn(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Tv(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function rg(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(`/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 l=kv(s.runtimeId,r,t,n);a.state={...Nv()[l]??{},...a.state??{}}}return a}async function zM(e){const{app:t,ep:n}=Qn(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},rh);if(!r.ok)throw new Error(await dn(r,"提交反馈失败"));const s=await r.json(),i=kv(n.runtimeId,t,e.userId,e.sessionId);return HV(i,e.eventId,s),s}async function VM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await mt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await dn(n,"读取评测集失败"));return n.json()}async function KM(e){const t=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},rh);if(!t.ok)throw new Error(await dn(t,"删除评测案例失败"));return t.json()}async function CE(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}function GV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function WM(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await mt(c,{},a,rh);if(!u.ok)throw new Error(await dn(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=GV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function GM(e,t,n,r,s){const{blob:i}=await WM(e,t,n,r,s);return URL.createObjectURL(i)}async function qV(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await dn(t,"media capabilities failed"));return t.json()}async function qM(e,t,n,r){const{app:s}=Qn(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 mt("/web/media",{method:"POST",body:i},{},rh);if(!a.ok)throw new Error(await dn(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function IE(e,t,n){const{app:r}=Qn(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await mt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await dn(i,"media cleanup failed"))}function XM(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 im(e,t){const n=XM(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await mt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await dn(r,"media cleanup failed"))}function QM(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=XM(t);if(!n)return t;const r=`${n}/content`;return Pi(`${sm}${r}`)}async function ZM(e,t){const{app:n,ep:r}=Qn(e),s=await mt(`/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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Av(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 Cv(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function RE(e,t,n){const{app:r,ep:s}=Qn(e),i=await mt(Cv(r,t,n),{},s);if(!i.ok)throw new Error(await dn(i,"读取会话能力失败"));return Av(await i.json())}async function Iv(e){const{ep:t}=Qn(e),n=await mt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await dn(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function XV(e){const{ep:t}=Qn(e),n=await mt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await dn(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function QV(e,t,n){const{ep:r}=Qn(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await mt(i,{},r);if(!a.ok)throw new Error(await dn(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function JM(e,t,n=1,r=20){const{ep:s}=Qn(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await mt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await dn(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function OE(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=await mt(Cv(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(!l.ok)throw new Error(await dn(l,"添加会话能力失败"));return Av(await l.json())}async function ej(e,t,n,r,s){const{app:i,ep:a}=Qn(e),l=`${Cv(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await mt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await dn(c,"移除会话能力失败"));return Av(await c.json())}async function tj(e,t,n=!0){const r=await mt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await mt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Rv(e){const{app:t,ep:n}=Qn(e);return tj(t,n,!1)}async function Ov(e,t,n){const r={runtimeId:e,region:t},s=HM(e,t),i=AE.get(s);i&&i.expiresAt<=Date.now()&&AE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await p0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return tj(a,r)}async function nj(e,t,n,r){const{app:s,ep:i}=Qn(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await mt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await dn(l,"Agent 检索失败"));return l.json()}async function rj(e,t){const{app:n}=Qn(e),r=await mt(`/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*Tf({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=Qn(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,veadkInvocation:h}}}const m=await mt(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:l},d,0);if(!m.ok)throw new Error(dp(`run_sse failed: ${m.status}`));for await(const g of vv(m)){const w=g;typeof w.error=="string"&&(w.error=dp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=dp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=dp(w.error_message)),yield w}}const $d=new Map;async function m0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&$d.set(s,i);const a=()=>{s&&$d.get(s)===i&&$d.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await mt("/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:$V((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of vv(l)){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 sj(e){var n;const t=await mt("/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=$d.get(e))==null||n.abort(),$d.delete(e)}async function ZV(e="cn-beijing"){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Af={title:"VeADK Studio",logoUrl:""},nb={studio:!1,version:"",branding:Af,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function ij(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return nb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Af.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:Af.title,logoUrl:s?Pi(s):""},features:{...nb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return nb}}const aj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function oj(){var n,r,s;const e=await mt("/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 lj(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 mt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function cj(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},rh);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 kc(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 mt(`/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 uj(e,t){try{return await p0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof sh||n instanceof Ya)throw n;return null}}async function dj(e,t){const n=await mt("/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 Lv(e,t){const n=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await dn(n,"加载 Runtime 详情失败"));return n.json()}async function Mv(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await dn(t,"生成项目失败"));return t.json()}const JV=19e4;async function fj(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},JV);if(!t.ok)throw new Error(await dn(t,"生成 Agent 配置失败"));return h0(t,"生成 Agent 配置失败")}async function hj(e){const t=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await dn(t,"创建调试运行失败"));return h0(t,"创建调试运行失败")}async function pj(e,t){const n=await mt(`/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 dn(n,"创建调试会话失败"));return(await h0(n,"创建调试会话失败")).id}async function mj(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await dn(n,"加载调试调用链路失败"));const r=await h0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*gj({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await mt(`/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 dn(a,"调试运行失败"));for await(const l of vv(a))yield l}async function $l(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await dn(t,"清理调试运行失败"))}const eK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Af,DEFAULT_STUDIO_ACCESS:aj,RuntimeAccessDeniedError:sh,RuntimeProbeError:Ya,addSessionCapability:OE,cancelAgentkitDeployment:sj,clearMessageFeedbackCache:BM,clearRemoteApps:UM,componentSearch:nj,createGeneratedAgentTestRun:hj,createGeneratedAgentTestSession:pj,createSession:ng,deleteAgentFeedbackCases:KM,deleteGeneratedAgentTestRun:$l,deleteMedia:im,deleteRuntime:dj,deleteSession:CE,deleteSessionMedia:IE,deployAgentkitProject:m0,downloadArtifact:YM,fetchRemoteApps:p0,generateAgentDraftFromRequirement:fj,generateAgentProject:Mv,getAgentFeedbackCases:VM,getAgentInfo:Rv,getGeneratedAgentTestTrace:mj,getMediaCapabilities:qV,getMyRuntimes:ZV,getRuntimeAgentInfo:Ov,getRuntimeDetail:Lv,getRuntimes:kc,getSession:rg,getSessionCapabilities:RE,getSessionTrace:ZM,getStudioAccess:oj,getStudioUpdateStatus:lj,getUiConfig:ij,listApps:$M,listSessionBuiltinTools:Iv,listSessionSkillSpaces:XV,listSessionSkillsInSpace:QV,listSessions:Tv,mediaContentUrl:QM,previewArtifact:GM,probeRuntimeApps:uj,registerRemoteApp:FM,removeSessionCapability:ej,runGeneratedAgentTestSSE:gj,runSSE:Tf,searchSessionPublicSkills:JM,startStudioUpdate:cj,submitMessageFeedback:zM,uploadMedia:qM,webSearch:rj},Symbol.toStringTag,{value:"Module"})),tK="send_a2ui_json_to_client",nK="validated_a2ui_json",LE="adk_request_credential",pT="transfer_to_agent";function rK(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 ci(){return{blocks:[],liveStart:0}}const mT=e=>e.functionCall??e.function_call,ME=e=>e.functionResponse??e.function_response;function sK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function iK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function yj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:iK(l.data),name:l.displayName??l.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 jE(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 aK=new Set(["llm","sequential","parallel","loop","a2a"]);function oK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&aK.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 lK(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 cK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function gT(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 fp(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Vc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>mT(p)||ME(p));if(t.partial&&!i){for(const p of s){const m=jE(p);typeof m=="string"&&m&&gT(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=mT(p),g=ME(p),w=yj([p]),y=jE(p);if(typeof y=="string"&&y)gT(n,p.thought?"thinking":"text",y);else if(w.length)fp(n),lK(n,w);else if(m)if(fp(n),m.name===pT){const b=sK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===LE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:rK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(fp(n),g.name===pT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===LE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===tK){const b=((d=g.response)==null?void 0:d[nK])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&cK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),fp(n),r=n.length,{blocks:n,liveStart:r}}function uK(e,t={}){var s,i;const n=[];let r=ci();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=ME(p))==null?void 0:m.name)===LE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(jE).filter(p=>!!p).join(""),d=yj(c),f=oK(c);if(!u&&!d.length&&!f){r=ci();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=ci()}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=ci()),r=Vc(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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function dK(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 fK=50,yT=48;function hK(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 pK(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 mK(e,t,n){const r=Math.max(0,t-yT),s=Math.min(e.length,t+n+yT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await rg(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of hK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:pK(l),snippet:mK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,fK)}async function yK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await rj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function bK(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await nj(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function EK(e,t,n){return e==="session"?{results:await gK(n.userId,n.appId,t)}:e==="web"?yK(n.appId,t):bK(e,n.appId,n.userId,t)}function bj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function xK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function wK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(bj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function vK(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 sg(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 bT(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 _K({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var $,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=vK(t,n,r),T=N.find(j=>j.id===a),S=a==="knowledge"?($=n==null?void 0:n.components)==null?void 0:$.find(j=>j.source==="knowledgebase"||j.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(j=>j.source==="long_term_memory"||j.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function j(L){var P;(P=k.current)!=null&&P.contains(L.target)||x(!1)}return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[b]);async function R(j,L){var G;const P=j.trim();if(!P||!((G=N.find(B=>B.id===L))!=null&&G.ready))return;const A=++_.current;g(!0),y(!0);let z;try{z=await EK(L,P,{userId:e,appId:t})}catch(B){const re=B instanceof Error?B.message:String(B);z={results:[],note:`搜索失败:${re}`}}A===_.current&&(f(z.results),p(z.note),g(!1))}function I(j){_.current+=1,u(j),f([]),p(void 0),y(!1),g(!1)}function D(j){_.current+=1,l(j),x(!1),f([]),p(void 0),y(!1),g(!1)}const U=!!(T!=null&&T.ready),W=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?sg(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(j=>!j),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),M&&o.jsx("small",{children:M}),o.jsx(xK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(j=>{var A,z;const L=j.id==="knowledge"?(A=n==null?void 0:n.components)==null?void 0:A.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):j.id==="memory"?(z=n==null?void 0:n.components)==null?void 0:z.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,P=L?[L.name,L.backend?sg(L.backend):""].filter(Boolean).join(" · "):j.ready?j.description:j.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===j.id,disabled:!j.ready,onClick:()=>D(j.id),children:[o.jsx("span",{children:j.label}),P&&o.jsx("small",{children:P})]},j.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:j=>I(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),R(c,a))},placeholder:W,disabled:!U,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx(Ft,{className:"icon spin"}):o.jsx(bj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:U?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((j,L)=>o.jsx(kK,{result:j,agentLabel:s,onOpen:i},L)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function kK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(RM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${bT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(d0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(gv,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(ET,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${sg(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(ET,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${sg(e.sourceType)}`:"",e.ts?` · ${bT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function ET({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 jv="/assets/volcengine-DM14a-L-.svg",xT="(max-width: 860px)";function NK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function SK(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 TK={admin:"管理员",developer:"开发者",user:"普通用户"};function wT({role:e}){const t=TK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function AK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),ps.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(pr,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function CK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=RV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=SK(d||f||h),m=OV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} -${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(wT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(wT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(mo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(sV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(AK,{version:n,onClose:()=>l(!1)}):null]})}function IK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(xT).matches),[k,N]=E.useState(_.current),T=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(xT),I=D=>{D.matches?N(U=>U||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(dV,{className:"icon"}):o.jsx(uV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(dr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(NK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(wK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(dr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[T.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),T.map(R=>{const I=dK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(D=>D===R.id?null:R.id),children:o.jsx($z,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(Fi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(CK,{access:s,userInfo:m,version:g,onLogout:w})]})}const Ej="veadk_agentkit_connections";function As(){try{const e=localStorage.getItem(Ej);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function g0(e){try{localStorage.setItem(Ej,JSON.stringify(e))}catch{}}function ro(e,t){return`agentkit:${e}:${t}`}function xj(e){try{return new URL(e).host}catch{return e}}function yu(e){UM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)FM(ro(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function wj(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=As(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,g0(l),yu(l),a}async function ig(e,t,n,r){let s;try{s=await uj(e,n)}catch(l){throw l instanceof sh&&ag(e),l}if(!s||s.length===0)throw ag(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=wj(e,t,n,s,i,r);return ro(a.id,s[0])}async function vj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await p0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||xj(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...As().filter(c=>c.base!==s),a];return g0(l),yu(l),a}function RK(e){const t=As().filter(n=>n.id!==e);return g0(t),yu(t),t}function ag(e){const t=As().filter(n=>n.runtimeId!==e);return g0(t),yu(t),t}function _j(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:ro(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:xj(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const vT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:vj,addRuntimeConnection:wj,buildAgentEntries:_j,connectRuntime:ig,loadConnections:As,registerConnections:yu,remoteAppId:ro,removeConnection:RK,removeRuntimeConnection:ag},Symbol.toStringTag,{value:"Module"}));function Kc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 DE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function OK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function kj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const _T=15,LK=1e4,MK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function jK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function Nj(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 rb(e,t=LK){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 DK({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,T]=E.useState(!1),[S,R]=E.useState(""),[I,D]=E.useState(""),[U,W]=E.useState(null),[M,$]=E.useState(new Set),[C,j]=E.useState(),[L,P]=E.useState("agent"),A=E.useRef(!1);function z(ne){j(ye=>(ye==null?void 0:ye.runtimeId)===ne.runtimeId?void 0:{runtimeId:ne.runtimeId,name:ne.name,region:ne.region})}const G=E.useCallback(async ne=>{if(d[ne]){g(ne);return}const ye=h[ne];if(ye!==void 0){T(!0),R("");try{const ge=await rb(kc({nextToken:ye,pageSize:_T,region:_,scope:"all"}));f(be=>{const xe=[...be];return xe[ne]=ge.runtimes,xe}),p(be=>{const xe=[...be];return ge.nextToken&&(xe[ne+1]=ge.nextToken),xe}),g(ne)}catch(ge){R(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[h,d,_]),B=E.useCallback(async()=>{T(!0),R("");try{const ne=[];let ye="";do{const ge=await rb(kc({scope:"mine",nextToken:ye,pageSize:100,region:_}));ne.push(...ge.runtimes),ye=ge.nextToken}while(ye&&ne.length<2e3);x(ne)}catch(ne){R(ne instanceof Error?ne.message:String(ne))}finally{T(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),A.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!A.current&&(A.current=!0,G(0))},[e,s,w,G]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&B()},[w,b,s,B]),E.useEffect(()=>{e&&(j(void 0),P("agent"))},[e]);function re(){$(new Set),w?(x(null),B()):(f([]),p([""]),g(0),A.current=!0,T(!0),R(""),rb(kc({nextToken:"",pageSize:_T,region:_,scope:"all"})).then(ne=>{f([ne.runtimes]),p(ne.nextToken?["",ne.nextToken]:[""])}).catch(ne=>R(ne instanceof Error?ne.message:String(ne))).finally(()=>T(!1)))}function Q(ne){ne!==_&&(k(ne),f([]),p([""]),g(0),x(null),$(new Set),A.current=!1)}const se=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function de(ne){W(ne.runtimeId),ig(ne.runtimeId,ne.name,ne.region).then(async ye=>{await u(ye),t()}).catch(ye=>{if(ye instanceof sh){R(ye.message);return}if(ye instanceof Ya){ye.unsupported&&$(ge=>new Set(ge).add(ne.runtimeId)),R(ye.message);return}$(ge=>new Set(ge).add(ne.runtimeId))}).finally(()=>W(null))}if(!e)return null;const pe=(w?b??[]:d[m]??[]).filter(ne=>I?ne.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Kc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:re,title:"刷新",disabled:N,children:o.jsx(LM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(pr,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(ne=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${ne===a?"active":""}`,onClick:()=>{u(ne),t()},children:[o.jsx(Kc,{}),o.jsx("span",{className:"agentsel-item-name",children:ne})]})},ne))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(Sf,{className:"icon"}),o.jsx("input",{value:I,onChange:ne=>D(ne.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:MK.map(ne=>o.jsx("button",{type:"button",className:_===ne.value?"active":"","aria-pressed":_===ne.value,onClick:()=>Q(ne.value),children:ne.label},ne.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:ne=>y(ne.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[pe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:pe.map(ne=>{const ye=M.has(ne.runtimeId),ge=U===ne.runtimeId,be=(l==null?void 0:l.runtimeId)===ne.runtimeId,xe=(C==null?void 0:C.runtimeId)===ne.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${be?"active":""} ${xe?"is-previewed":""}`,title:ne.runtimeId,children:[o.jsx(kj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:ne.name,children:ne.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${ye?"bad":zK(ne.status)}`,children:ye?"不支持":Sj(ne.status)}),ne.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||be,onClick:()=>de(ne),children:ge?"连接中…":be?"已连接":ye?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${xe?"active":""}`,"aria-label":`查看 ${ne.name} 信息`,"aria-pressed":xe,title:"查看信息",onClick:()=>z(ne),children:o.jsx(mo,{className:"icon"})}):null]})]})},ne.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void G(m-1),"aria-label":"上一页",children:o.jsx(Pz,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!se||N,onClick:()=>void G(m+1),"aria-label":"下一页",children:o.jsx(Ds,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(UK,{runtime:C,tab:L,onTabChange:P})]})]})}const PK={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function BK(e){return PK[e.toLowerCase()]??e}function FK(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 UK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx($K,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(HK,{runtime:e})})]})}function $K({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),Ov(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(Nj(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx(Ft,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Kc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(kT,{icon:o.jsx(OM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(kT,{icon:o.jsx(DE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(OK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(NM,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[BK(d.kind),d.backend?` · ${FK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function kT({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function HK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Lv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(Nj(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",Sj(t.status)]),t.region&&u.push(["区域",jK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(kj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx(Ft,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function zK(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 VK={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function Sj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return VK[t]??(e||"-")}function KK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx(Ds,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(YK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function YK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Lz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(pv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx(DK,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function ih(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 Tj(){return(await ih("/web/skill-spaces?region=all")).items||[]}async function WK(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),ih(`/web/skill-spaces?${t.toString()}`)}async function Aj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function GK(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),ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function qK(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 ih(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function XK(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 QK(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const ZK="https://ark.cn-beijing.volces.com/api/v3/",am=[{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:ZK}],Yc=[],Qu=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],mi={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Cj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:mi.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:mi.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:mi.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],ol=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Yc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Yc},{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"}]}],PE=[{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}]}],BE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:am,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},...am],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},...am],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Yc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Wc="viking",FE=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Yc},{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},...am],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Yc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],UE=[{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:[...Yc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],JK={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function $E(e){const t=ol.find(n=>n.id===e||n.toolNames.includes(e));return JK[e]??(t==null?void 0:t.label)??e}function NT(e){const t=ol.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function eY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function tY(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function ST(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Ij({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),ps.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(eY,{})})]}),i]})]}),document.body)}function om({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(tY,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function nY({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${$E(m)} ${m} ${NT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Ij,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(DE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(om,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(DE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:$E(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:NT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function rY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,T]=E.useState([]),[S,R]=E.useState(""),[I,D]=E.useState(""),[U,W]=E.useState(!0),[M,$]=E.useState(!1),[C,j]=E.useState(""),[L,P]=E.useState(""),A=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let Q=!0;const se=window.setTimeout(()=>{g(!0),y(""),JM(e,c.trim()).then(de=>{Q&&(f(de.items),p(de.totalCount))}).catch(de=>{Q&&(f([]),p(0),y(de instanceof Error?de.message:"搜索 Skill Hub 失败"))}).finally(()=>{Q&&g(!1)})},250);return()=>{Q=!1,window.clearTimeout(se)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let Q=!0;return W(!0),j(""),Tj().then(se=>{Q&&(x(se),k(se[0]??null))}).catch(se=>{Q&&j(se instanceof Error?se.message:"读取 Skill Space 失败")}).finally(()=>{Q&&W(!1)}),()=>{Q=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){T([]);return}let Q=!0;return $(!0),j(""),Aj(_.id,_.region).then(se=>{Q&&T(se)}).catch(se=>{Q&&j(se instanceof Error?se.message:"读取技能失败")}).finally(()=>{Q&&$(!1)}),()=>{Q=!1}},[_,a]);const z=E.useMemo(()=>{const Q=S.trim().toLowerCase();return Q?b.filter(se=>`${se.name} ${se.id} ${se.description}`.toLowerCase().includes(Q)):b},[S,b]),G=E.useMemo(()=>{const Q=I.trim().toLowerCase();return Q?N.filter(se=>`${se.skillName} ${se.skillDescription}`.toLowerCase().includes(Q)):N},[I,N]),B=async Q=>{if(!_)return;P(Q.skillId);const se=await s({kind:"skill",name:Q.skillName,skillSourceId:_.id,description:Q.skillDescription,version:Q.version});P(""),se&&i()},re=async Q=>{P(Q.slug);const se=await s({kind:"skill",name:Q.name,skillSourceId:`findskill:${Q.slug}`,description:Q.description,version:Q.version||Q.updatedAt});P(""),se&&i()};return o.jsx(Ij,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(om,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(Q=>{const se=A.has(Q.name),de=L===Q.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.name}),o.jsx("span",{children:Q.description||"暂无描述"}),o.jsxs("small",{children:[Q.sourceRepo||Q.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.downloadCount.toLocaleString()," 次下载",Q.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),Q.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:se||r||!!L,onClick:()=>void re(Q),children:se?"已添加":de?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(ST,{}),"添加"]})})]},Q.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(om,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:U?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):z.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):z.map(Q=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===Q.id?" is-active":""}`,onClick:()=>{k(Q),D("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:Q.name||Q.id}),o.jsx("small",{children:Q.description||Q.id}),o.jsxs("em",{children:[Q.skillCount??0," 个技能"]})]})},`${Q.projectName??"default"}:${Q.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(om,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:D})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?M?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):G.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):G.map(Q=>{const se=A.has(Q.skillName),de=L===Q.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:Q.skillName}),o.jsx("span",{children:Q.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",Q.version||"—"]})]}),o.jsx("button",{type:"button",disabled:se||r||!!L,onClick:()=>void B(Q),children:se?"已添加":de?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(ST,{}),"添加"]})})]},`${Q.skillId}:${Q.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function ma({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const sY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Rj(e){return 1+e.children.reduce((t,n)=>t+Rj(n),0)}function Gc(e){return e.id||e.name}function iY(e,t){const n=Gc(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 Oj(e,t=!0){return{...e,id:Gc(e),name:iY(e,t),children:e.children.map(n=>Oj(n,!1))}}function Lj(e,t){t.set(Gc(e),e.name||Gc(e)),e.children.forEach(n=>Lj(n,t))}function aY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function oY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Mj({node:e,activeAgent:t,seen:n,path:r}){const s=Gc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Kc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:sY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Mj,{node:c,activeAgent:t,seen:n,path:r},Gc(c)))})]})}function sb({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function jj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(ma,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=Oj(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:[]}),w=(l==null?void 0:l.tools)??aY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??oY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Lj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(sb,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:$E(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(sb,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(sb,{title:"拓扑",count:Rj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Mj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(nY,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(rY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function lY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function cY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(lY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(jj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function $1e(){}function TT(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 Dj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uY=/[$_\p{ID_Start}]/u,dY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,fY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,hY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pj={};function H1e(e){return e?uY.test(String.fromCodePoint(e)):!1}function z1e(e,t){const r=(t||Pj).jsx?fY:dY;return e?r.test(String.fromCodePoint(e)):!1}function AT(e,t){return(Pj.jsx?pY:hY).test(e)}const mY=/[ \t\n\f\r]/g;function gY(e){return typeof e=="object"?e.type==="text"?CT(e.value):!1:CT(e)}function CT(e){return e.replace(mY,"")===""}let ah=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function Bj(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ah(n,r,t)}function Cf(e){return e.toLowerCase()}class ts{constructor(t,n){this.attribute=n,this.property=t}}ts.prototype.attribute="";ts.prototype.booleanish=!1;ts.prototype.boolean=!1;ts.prototype.commaOrSpaceSeparated=!1;ts.prototype.commaSeparated=!1;ts.prototype.defined=!1;ts.prototype.mustUseProperty=!1;ts.prototype.number=!1;ts.prototype.overloadedBoolean=!1;ts.prototype.property="";ts.prototype.spaceSeparated=!1;ts.prototype.space=void 0;let yY=0;const xt=bl(),qn=bl(),HE=bl(),Oe=bl(),ln=bl(),Nc=bl(),as=bl();function bl(){return 2**++yY}const zE=Object.freeze(Object.defineProperty({__proto__:null,boolean:xt,booleanish:qn,commaOrSpaceSeparated:as,commaSeparated:Nc,number:Oe,overloadedBoolean:HE,spaceSeparated:ln},Symbol.toStringTag,{value:"Module"})),ib=Object.keys(zE);class Dv extends ts{constructor(t,n,r,s){let i=-1;if(super(t,n),IT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&vY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(RT,kY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!RT.test(i)){let a=i.replace(wY,_Y);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Dv}return new s(r,t)}function _Y(e){return"-"+e.toLowerCase()}function kY(e){return e.charAt(1).toUpperCase()}const oh=Bj([Fj,bY,Hj,zj,Vj],"html"),go=Bj([Fj,EY,Hj,zj,Vj],"svg");function OT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Kj(e){return e.join(" ").trim()}var Pv={},LT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NY=/\n/g,SY=/^\s*/,TY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,AY=/^:\s*/,CY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,IY=/^[;\s]*/,RY=/^\s+|\s+$/g,OY=` -`,MT="/",jT="*",Do="",LY="comment",MY="declaration";function jY(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 g=m.match(NY);g&&(n+=g.length);var w=m.lastIndexOf(OY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(SY)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(MT!=e.charAt(0)||jT!=e.charAt(1))){for(var g=2;Do!=e.charAt(g)&&(jT!=e.charAt(g)||MT!=e.charAt(g+1));)++g;if(g+=2,Do===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:LY,comment:w})}}function h(){var m=i(),g=c(TY);if(g){if(f(),!c(AY))return l("property missing ':'");var w=c(CY),y=m({type:MY,property:DT(g[0].replace(LT,Do)),value:w?DT(w[0].replace(LT,Do)):Do});return c(IY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function DT(e){return e?e.replace(RY,Do):Do}var DY=jY,PY=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pv,"__esModule",{value:!0});Pv.default=FY;const BY=PY(DY);function FY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,BY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var b0={};Object.defineProperty(b0,"__esModule",{value:!0});b0.camelCase=void 0;var UY=/^--[a-zA-Z0-9_-]+$/,$Y=/-([a-z])/g,HY=/^[^-]+$/,zY=/^-(webkit|moz|ms|o|khtml)-/,VY=/^-(ms)-/,KY=function(e){return!e||HY.test(e)||UY.test(e)},YY=function(e,t){return t.toUpperCase()},PT=function(e,t){return"".concat(t,"-")},WY=function(e,t){return t===void 0&&(t={}),KY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(VY,PT):e=e.replace(zY,PT),e.replace($Y,YY))};b0.camelCase=WY;var GY=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qY=GY(Pv),XY=b0;function VE(e,t){var n={};return!e||typeof e!="string"||(0,qY.default)(e,function(r,s){r&&s&&(n[(0,XY.camelCase)(r,t)]=s)}),n}VE.default=VE;var QY=VE;const ZY=Wf(QY),E0=Yj("end"),$i=Yj("start");function Yj(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 JY(e){const t=$i(e),n=E0(e);if(t&&n)return{start:t,end:n}}function Hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?BT(e.position):"start"in e||"end"in e?BT(e):"line"in e||"column"in e?KE(e):""}function KE(e){return FT(e&&e.line)+":"+FT(e&&e.column)}function BT(e){return KE(e&&e.start)+"-"+KE(e&&e.end)}function FT(e){return e&&typeof e=="number"?e:1}class Sr 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Hd(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}}Sr.prototype.file="";Sr.prototype.name="";Sr.prototype.reason="";Sr.prototype.message="";Sr.prototype.stack="";Sr.prototype.column=void 0;Sr.prototype.line=void 0;Sr.prototype.ancestors=void 0;Sr.prototype.cause=void 0;Sr.prototype.fatal=void 0;Sr.prototype.place=void 0;Sr.prototype.ruleId=void 0;Sr.prototype.source=void 0;const Bv={}.hasOwnProperty,eW=new Map,tW=/[A-Z]/g,nW=new Set(["table","tbody","thead","tfoot","tr"]),rW=new Set(["td","th"]),Wj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sW(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=fW(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=dW(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"?go:oh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Gj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Gj(e,t,n){if(t.type==="element")return iW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lW(e,t,n);if(t.type==="mdxjsEsm")return oW(e,t);if(t.type==="root")return cW(e,t,n);if(t.type==="text")return uW(e,t)}function iW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=Xj(e,t.tagName,!1),a=hW(e,t);let l=Uv(e,t);return nW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!gY(c):!0})),qj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function aW(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)}If(e,t.position)}function oW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);If(e,t.position)}function lW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=go,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Xj(e,t.name,!0),a=pW(e,t),l=Uv(e,t);return qj(e,a,i,t),Fv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function cW(e,t,n){const r={};return Fv(r,Uv(e,t)),e.create(t,e.Fragment,r,n)}function uW(e,t){return t.value}function qj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function fW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=$i(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function hW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Bv.call(t.properties,s)){const i=mW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&rW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else If(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else If(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Uv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:eW;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?(fs(e,e.length,0,t),e):t}const HT={}.hasOwnProperty;function Zj(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 gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Dr=yo(/[A-Za-z]/),_r=yo(/[\dA-Za-z]/),kW=yo(/[#-'*+\--9=?A-Z^-~]/);function og(e){return e!==null&&(e<32||e===127)}const YE=yo(/\d/),NW=yo(/[\dA-Fa-f]/),SW=yo(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const x0=yo(new RegExp("\\p{P}|\\p{S}","u")),ll=yo(/\s/);function yo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),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 jt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return At(c)?(e.enter(n),l(c)):t(c)}function l(c){return At(c)&&i++a))return;const T=t.events.length;let S=T,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=T;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function RW(e,t,n){return jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qc(e){if(e===null||nn(e)||ll(e))return 1;if(x0(e))return 2}function w0(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};VT(f,-c),VT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rs(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rs(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Rs(u,w0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rs(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Rs(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,fs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&At(N)?jt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||st(N)?e.check(KT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||st(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,T,S){let R=0;return I;function I($){return N.enter("lineEnding"),N.consume($),N.exit("lineEnding"),D}function D($){return N.enter("codeFencedFence"),At($)?jt(N,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):U($)}function U($){return $===l?(N.enter("codeFencedFenceSequence"),W($)):S($)}function W($){return $===l?(R++,N.consume($),W):R>=a?(N.exit("codeFencedFenceSequence"),At($)?jt(N,M,"whitespace")($):M($)):S($)}function M($){return $===null||st($)?(N.exit("codeFencedFence"),T($)):S($)}}}function zW(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 ob={name:"codeIndented",tokenize:KW},VW={partial:!0,tokenize:YW};function KW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),jt(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):st(u)?e.attempt(VW,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||st(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function YW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):st(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):jt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):st(a)?s(a):n(a)}}const WW={name:"codeText",previous:qW,resolve:GW,tokenize:XW};function GW(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&&Zu(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),Zu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Zu(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,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||og(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||st(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||nn(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):st(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||st(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!At(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function a3(e,t,n,r,s,i){let a;return l;function l(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):st(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),jt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||st(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 zd(e,t){let n;return r;function r(s){return st(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):At(s)?jt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const sG={name:"definition",tokenize:aG},iG={partial:!0,tokenize:oG};function aG(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,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=gi(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 nn(p)?zd(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(iG,f,f)(p)}function f(p){return At(p)?jt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||st(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function oG(e,t,n){return r;function r(l){return nn(l)?zd(e,s)(l):n(l)}function s(l){return a3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return At(l)?jt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||st(l)?t(l):n(l)}}const lG={name:"hardBreakEscape",tokenize:cG};function cG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return st(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const uG={name:"headingAtx",resolve:dG,tokenize:fG};function dG(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"},fs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function fG(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||nn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||st(d)?(e.exit("atxHeading"),t(d)):At(d)?jt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||nn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const hG=["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"],WT=["pre","script","style","textarea"],pG={concrete:!0,name:"htmlFlow",resolveTo:yG,tokenize:bG},mG={partial:!0,tokenize:xG},gG={partial:!0,tokenize:EG};function yG(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 bG(e,t,n){const r=this;let s,i,a,l,c;return u;function u(B){return d(B)}function d(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),f}function f(B){return B===33?(e.consume(B),h):B===47?(e.consume(B),i=!0,g):B===63?(e.consume(B),s=3,r.interrupt?t:A):Dr(B)?(e.consume(B),a=String.fromCharCode(B),w):n(B)}function h(B){return B===45?(e.consume(B),s=2,p):B===91?(e.consume(B),s=5,l=0,m):Dr(B)?(e.consume(B),s=4,r.interrupt?t:A):n(B)}function p(B){return B===45?(e.consume(B),r.interrupt?t:A):n(B)}function m(B){const re="CDATA[";return B===re.charCodeAt(l++)?(e.consume(B),l===re.length?r.interrupt?t:U:m):n(B)}function g(B){return Dr(B)?(e.consume(B),a=String.fromCharCode(B),w):n(B)}function w(B){if(B===null||B===47||B===62||nn(B)){const re=B===47,Q=a.toLowerCase();return!re&&!i&&WT.includes(Q)?(s=1,r.interrupt?t(B):U(B)):hG.includes(a.toLowerCase())?(s=6,re?(e.consume(B),y):r.interrupt?t(B):U(B)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):i?b(B):x(B))}return B===45||_r(B)?(e.consume(B),a+=String.fromCharCode(B),w):n(B)}function y(B){return B===62?(e.consume(B),r.interrupt?t:U):n(B)}function b(B){return At(B)?(e.consume(B),b):I(B)}function x(B){return B===47?(e.consume(B),I):B===58||B===95||Dr(B)?(e.consume(B),_):At(B)?(e.consume(B),x):I(B)}function _(B){return B===45||B===46||B===58||B===95||_r(B)?(e.consume(B),_):k(B)}function k(B){return B===61?(e.consume(B),N):At(B)?(e.consume(B),k):x(B)}function N(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),c=B,T):At(B)?(e.consume(B),N):S(B)}function T(B){return B===c?(e.consume(B),c=null,R):B===null||st(B)?n(B):(e.consume(B),T)}function S(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||nn(B)?k(B):(e.consume(B),S)}function R(B){return B===47||B===62||At(B)?x(B):n(B)}function I(B){return B===62?(e.consume(B),D):n(B)}function D(B){return B===null||st(B)?U(B):At(B)?(e.consume(B),D):n(B)}function U(B){return B===45&&s===2?(e.consume(B),C):B===60&&s===1?(e.consume(B),j):B===62&&s===4?(e.consume(B),z):B===63&&s===3?(e.consume(B),A):B===93&&s===5?(e.consume(B),P):st(B)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(mG,G,W)(B)):B===null||st(B)?(e.exit("htmlFlowData"),W(B)):(e.consume(B),U)}function W(B){return e.check(gG,M,G)(B)}function M(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),$}function $(B){return B===null||st(B)?W(B):(e.enter("htmlFlowData"),U(B))}function C(B){return B===45?(e.consume(B),A):U(B)}function j(B){return B===47?(e.consume(B),a="",L):U(B)}function L(B){if(B===62){const re=a.toLowerCase();return WT.includes(re)?(e.consume(B),z):U(B)}return Dr(B)&&a.length<8?(e.consume(B),a+=String.fromCharCode(B),L):U(B)}function P(B){return B===93?(e.consume(B),A):U(B)}function A(B){return B===62?(e.consume(B),z):B===45&&s===2?(e.consume(B),A):U(B)}function z(B){return B===null||st(B)?(e.exit("htmlFlowData"),G(B)):(e.consume(B),z)}function G(B){return e.exit("htmlFlow"),t(B)}}function EG(e,t,n){const r=this;return s;function s(a){return st(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 xG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(lh,t,n)}}const wG={name:"htmlText",tokenize:vG};function vG(e,t,n){const r=this;let s,i,a;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),k):A===63?(e.consume(A),x):Dr(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,m):Dr(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):st(A)?(a=f,j(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?C(A):A===45?h(A):f(A)}function m(A){const z="CDATA[";return A===z.charCodeAt(i++)?(e.consume(A),i===z.length?g:m):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),w):st(A)?(a=g,j(A)):(e.consume(A),g)}function w(A){return A===93?(e.consume(A),y):g(A)}function y(A){return A===62?C(A):A===93?(e.consume(A),y):g(A)}function b(A){return A===null||A===62?C(A):st(A)?(a=b,j(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),_):st(A)?(a=x,j(A)):(e.consume(A),x)}function _(A){return A===62?C(A):x(A)}function k(A){return Dr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||_r(A)?(e.consume(A),N):T(A)}function T(A){return st(A)?(a=T,j(A)):At(A)?(e.consume(A),T):C(A)}function S(A){return A===45||_r(A)?(e.consume(A),S):A===47||A===62||nn(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),C):A===58||A===95||Dr(A)?(e.consume(A),I):st(A)?(a=R,j(A)):At(A)?(e.consume(A),R):C(A)}function I(A){return A===45||A===46||A===58||A===95||_r(A)?(e.consume(A),I):D(A)}function D(A){return A===61?(e.consume(A),U):st(A)?(a=D,j(A)):At(A)?(e.consume(A),D):R(A)}function U(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,W):st(A)?(a=U,j(A)):At(A)?(e.consume(A),U):(e.consume(A),M)}function W(A){return A===s?(e.consume(A),s=void 0,$):A===null?n(A):st(A)?(a=W,j(A)):(e.consume(A),W)}function M(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||nn(A)?R(A):(e.consume(A),M)}function $(A){return A===47||A===62||nn(A)?R(A):n(A)}function C(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function j(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),L}function L(A){return At(A)?jt(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):P(A)}function P(A){return e.enter("htmlTextData"),a(A)}}const zv={name:"labelEnd",resolveAll:SG,resolveTo:TG,tokenize:AG},_G={tokenize:CG},kG={tokenize:IG},NG={tokenize:RG};function SG(e){let t=-1;const n=[];for(;++t=3&&(u===null||st(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),At(u)?jt(e,l,"whitespace")(u):l(u))}}const Wr={continuation:{tokenize:$G},exit:zG,name:"list",tokenize:UG},BG={partial:!0,tokenize:VG},FG={partial:!0,tokenize:HG};function UG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:YE(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(lm,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 YE(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(lh,r.interrupt?n:d,e.attempt(BG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return At(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function $G(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(lh,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!At(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(FG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,jt(e,e.attempt(Wr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function HG(e,t,n){const r=this;return jt(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 zG(e){e.exit(this.containerState.type)}function VG(e,t,n){const r=this;return jt(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!At(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const GT={name:"setextUnderline",resolveTo:KG,tokenize:YG};function KG(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 YG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),At(u)?jt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||st(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const WG={tokenize:GG};function GG(e){const t=this,n=e.attempt(lh,r,e.attempt(this.parser.constructs.flowInitial,s,jt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(JW,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 qG={resolveAll:l3()},XG=o3("string"),QG=o3("text");function o3(e){return{resolveAll:l3(e==="text"?ZG:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function dq(e,t){let n=-1;const r=[];let s;for(;++n0){const Ze=me.tokenStack[me.tokenStack.length-1];(Ze[1]||XT).call(me,void 0,Ze[0])}for(ee.position={start:Ia(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Ia(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye0&&(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 Nq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Eu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Aq(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 Cq(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 Iq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={src:Eu(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 Rq(e,t){const n={src:Eu(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 Oq(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 Lq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return d3(e,t);const s={href:Eu(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 Mq(e,t){const n={href:Eu(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 jq(e,t,n){const r=e.all(t),s=n?Dq(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 l=-1;for(;++l1}function Pq(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)},l=$i(t.children[1]),c=E0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Hq(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,l=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(JT(t.slice(s),s>0,!1)),i.join("")}function JT(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===QT||i===ZT;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===QT||i===ZT;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Kq(e,t){const n={type:"text",value:Vq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Wq={blockquote:vq,break:_q,code:kq,delete:Nq,emphasis:Sq,footnoteReference:Tq,heading:Aq,html:Cq,imageReference:Iq,image:Rq,inlineCode:Oq,linkReference:Lq,link:Mq,listItem:jq,list:Pq,paragraph:Bq,root:Fq,strong:Uq,table:$q,tableCell:zq,tableRow:Hq,text:Kq,thematicBreak:Yq,toml:hp,yaml:hp,definition:hp,footnoteDefinition:hp};function hp(){}const h3=-1,v0=0,Vd=1,lg=2,Vv=3,Kv=4,Yv=5,Wv=6,p3=7,m3=8,Gq=typeof self=="object"?self:globalThis,e2=(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 Gq[e](t)},qq=(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 v0:case h3:return n(a,s);case Vd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case lg:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Vv:return n(new Date(a),s);case Kv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case Yv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Wv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case p3:{const{name:l,message:c}=a;return n(e2(l,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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(e2(i,a),s)};return r},t2=e=>qq(new Map,e)(0),Ll="",{toString:Xq}={},{keys:Qq}=Object,Ju=e=>{const t=typeof e;if(t!=="object"||!e)return[v0,t];const n=Xq.call(e).slice(8,-1);switch(n){case"Array":return[Vd,Ll];case"Object":return[lg,Ll];case"Date":return[Vv,Ll];case"RegExp":return[Kv,Ll];case"Map":return[Yv,Ll];case"Set":return[Wv,Ll];case"DataView":return[Vd,n]}return n.includes("Array")?[Vd,n]:n.includes("Error")?[p3,n]:[lg,n]},pp=([e,t])=>e===v0&&(t==="function"||t==="symbol"),Zq=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Ju(a);switch(l){case v0:{let d=a;switch(c){case"bigint":l=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([l,d],a)}case Vd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case lg:{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([l,d],a);for(const h of Qq(a))(e||!pp(Ju(a[h])))&&d.push([i(h),i(a[h])]);return f}case Vv:return s([l,a.toISOString()],a);case Kv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case Yv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(pp(Ju(h))||pp(Ju(p))))&&d.push([i(h),i(p)]);return f}case Wv:{const d=[],f=s([l,d],a);for(const h of a)(e||!pp(Ju(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},n2=(e,{json:t,lossy:n}={})=>{const r=[];return Zq(!(t||n),!!t,new Map,r)(e),r},Xc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?t2(n2(e,t)):structuredClone(e):(e,t)=>t2(n2(e,t));function Jq(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 eX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Jq,r=e.options.footnoteBackLabel||eX,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Xc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const ch=function(e){if(e==null)return iX;if(typeof e=="function")return _0(e);if(typeof e=="object")return Array.isArray(e)?nX(e):rX(e);if(typeof e=="string")return sX(e);throw new Error("Expected function, string, or object as test")};function nX(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=g3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=cX(n(c,d)),p[0]===GE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==lX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` -`}),n}function r2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function s2(e,t){const n=dX(e,t),r=n.one(e,void 0),s=tX(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function gX(e,t){return e&&"run"in e?async function(n,r){const s=s2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return s2(n,{file:r,...e||t})}}function i2(e){if(e)throw e}var cm=Object.prototype.hasOwnProperty,b3=Object.prototype.toString,a2=Object.defineProperty,o2=Object.getOwnPropertyDescriptor,l2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):b3.call(t)==="[object Array]"},c2=function(t){if(!t||b3.call(t)!=="[object Object]")return!1;var n=cm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||cm.call(t,s)},u2=function(t,n){a2&&n.name==="__proto__"?a2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},d2=function(t,n){if(n==="__proto__")if(cm.call(t,n)){if(o2)return o2(t,n).value}else return;return t[n]},yX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Ai={basename:xX,dirname:wX,extname:vX,join:_X,sep:"/"};function xX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dh(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function wX(e){if(dh(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 vX(e){dh(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 _X(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function dh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const SX={cwd:TX};function TX(){return"/"}function QE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AX(e){if(typeof e=="string")e=new URL(e);else if(!QE(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 CX(e)}function CX(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 g=r[h][1];XE(g)&&XE(p)&&(p=cb(!0,g,p)),r[h]=[u,p,...m]}}}}const LX=new Gv().freeze();function hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mb(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 h2(e){if(!XE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function p2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mp(e){return MX(e)?e:new E3(e)}function MX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jX(e){return typeof e=="string"||DX(e)}function DX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",m2=[],g2={allowDangerousHtml:!0},BX=/^(https?|ircs?|mailto|xmpp)$/i,FX=[{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 UX(e){const t=$X(e),n=HX(e);return zX(t.runSync(t.parse(n),n),e)}function $X(e){const t=e.rehypePlugins||m2,n=e.remarkPlugins||m2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...g2}:g2;return LX().use(wq).use(n).use(gX,r).use(t)}function HX(e){const t=e.children||"",n=new E3;return typeof t=="string"&&(n.value=t),n}function zX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||VX;for(const d of FX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+PX+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),uh(e,u),sW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 ab)if(Object.hasOwn(ab,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=ab[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function VX(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||BX.test(e.slice(0,t))?e:""}function y2(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 KX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function YX(e,t,n){const s=ch((n||{}).ignore||[]),i=WX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=y2(e,"(");let i=y2(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||ll(n)||x0(n))&&(!t||n!==47)}w3.peek=gQ;function lQ(){this.buffer()}function cQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uQ(){this.buffer()}function dQ(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=gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hQ(e){this.exit(e)}function pQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mQ(e){this.exit(e)}function gQ(){return"["}function w3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function yQ(){return{enter:{gfmFootnoteCallString:lQ,gfmFootnoteCall:cQ,gfmFootnoteDefinitionLabelString:uQ,gfmFootnoteDefinition:dQ},exit:{gfmFootnoteCallString:fQ,gfmFootnoteCall:hQ,gfmFootnoteDefinitionLabelString:pQ,gfmFootnoteDefinition:mQ}}}function bQ(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 l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?v3:EQ))),u(),c}}function EQ(e,t,n){return t===0?e:v3(e,t,n)}function v3(e,t,n){return(n?"":" ")+e}const xQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_3.peek=NQ;function wQ(){return{canContainEols:["delete"],enter:{strikethrough:_Q},exit:{strikethrough:kQ}}}function vQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xQ}],handlers:{delete:_3}}}function _Q(e){this.enter({type:"delete",children:[]},e)}function kQ(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 NQ(){return"~"}function SQ(e){return e.length}function TQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||SQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),IQ);return s(),a}function IQ(e,t,n){return">"+(n?"":" ")+e}function RQ(e,t){return x2(e,t.inConstruct,!0)&&!x2(e,t.notInConstruct,!1)}function x2(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 LQ(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 MQ(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 jQ(e,t,n,r){const s=MQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(LQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,DQ);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(OQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` -`,encode:["`"],...l.current()})),f()}return d+=l.move(` -`),i&&(d+=l.move(i+` -`)),d+=l.move(c),u(),d}function DQ(e,t,n){return(n?"":" ")+e}function qv(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 PQ(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function BQ(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 Rf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cg(e,t,n){const r=qc(e),s=qc(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=FQ;function N3(e,t,n,r){const s=BQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=cg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Rf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=cg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Rf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function FQ(e,t,n){return n.options.emphasis||"*"}function UQ(e,t){let n=!1;return uh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,GE}),!!((!e.depth||e.depth<3)&&$v(e)&&(t.options.setext||n))}function $Q(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(UQ(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),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Rf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}S3.peek=HQ;function S3(e){return e.value||""}function HQ(){return"<"}T3.peek=zQ;function T3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function zQ(){return"!"}A3.peek=VQ;function A3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function VQ(){return"!"}C3.peek=KQ;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))}R3.peek=YQ;function R3(e,t,n,r){const s=qv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(I3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function YQ(e,t,n){return I3(e,n)?"<":"["}O3.peek=WQ;function O3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function WQ(){return"["}function Xv(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 GQ(e){const t=Xv(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 qQ(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 XQ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?qQ(n):Xv(n);const l=e.ordered?a==="."?")":".":GQ(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 JQ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const eZ=ch(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tZ(e,t,n,r){return(e.children.some(function(a){return eZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nZ(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=rZ;function M3(e,t,n,r){const s=nZ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=cg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Rf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=cg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Rf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function rZ(e,t,n){return n.options.strong||"*"}function sZ(e,t,n,r){return n.safe(e.value,r)}function iZ(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 aZ(e,t,n){const r=(L3(n)+(n.options.ruleSpaces?" ":"")).repeat(iZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const j3={blockquote:CQ,break:w2,code:jQ,definition:PQ,emphasis:N3,hardBreak:w2,heading:$Q,html:S3,image:T3,imageReference:A3,inlineCode:C3,link:R3,linkReference:O3,list:XQ,listItem:ZQ,paragraph:JQ,root:tZ,strong:M3,text:sZ,thematicBreak:aZ};function oZ(){return{enter:{table:lZ,tableData:v2,tableHeader:v2,tableRow:uZ},exit:{codeText:dZ,table:cZ,tableData:Eb,tableHeader:Eb,tableRow:Eb}}}function lZ(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 cZ(e){this.exit(e),this.data.inTable=void 0}function uZ(e){this.enter({type:"tableRow",children:[]},e)}function Eb(e){this.exit(e)}function v2(e){this.enter({type:"tableCell",children:[]},e)}function dZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fZ(e,t){return t==="|"?t:e}function hZ(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:l}};function a(p,m,g,w){return u(d(p,g,w),p.align)}function l(p,m,g,w){const y=f(p,g,w),b=u([y]);return b.slice(0,b.indexOf(` -`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return TQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const RZ={tokenize:FZ,partial:!0};function OZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DZ,continuation:{tokenize:PZ},exit:BZ}},text:{91:{name:"gfmFootnoteCall",tokenize:jZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LZ,resolveTo:MZ}}}}function LZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=gi(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 MZ(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)},l=[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,...l),e}function jZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||nn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(gi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return nn(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 DZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||nn(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=gi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return nn(m)||(l=!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),jt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function PZ(e,t,n){return e.check(lh,t,e.attempt(RZ,t,n))}function BZ(e){e.exit("gfmFootnoteDefinition")}function FZ(e,t,n){const r=this;return jt(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 UZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=qc(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class $Z{constructor(){this.map=[]}add(t,n,r){HZ(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 HZ(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,W=U==="tableHead"||U==="tableRow"?N:c;return W===N&&r.parser.lazy[r.now().line]?n(I):W(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):st(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):At(I)?jt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||nn(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,At(I)?jt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return At(I)?jt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||st(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return At(I)?jt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||st(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||st(I)?(e.exit("tableRow"),t(I)):At(I)?jt(e,T,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||nn(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function YZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new $Z;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Hl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function k2(e,t,n,r,s){const i=[],a=Hl(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 Hl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const WZ={name:"tasklistCheck",tokenize:qZ};function GZ(){return{text:{91:WZ}}}function qZ(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 nn(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"),l):n(c)}function l(c){return st(c)?t(c):At(c)?e.check({tokenize:XZ},t,n)(c):n(c)}}function XZ(e,t,n){return jt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function QZ(e){return Zj([vZ(),OZ(),UZ(e),VZ(),GZ()])}const ZZ={};function JZ(e){const t=this,n=e||ZZ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(QZ(n)),i.push(bZ()),a.push(EZ(n))}const N2=function(e,t,n){const r=ch(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"?oJ(e,t,n):e.type==="text"?n.whitespace==="normal"?Y3(e,n):lJ(e):[]}function oJ(e,t,n){const r=W3(e,n),s=e.children||[];let i=-1,a=[];if(iJ(e))return a;let l,c;for(JE(e)||C2(e)&&N2(t,e,C2)?c=` -`:sJ(e)?(l=2,c=2):V3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mJ(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=pJ(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 G3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function gJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function yJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bJ(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const EJ=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_-]*/}}),xJ=["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"],wJ=["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"],vJ=[...xJ,...wJ],_J=["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(),kJ=["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(),NJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),SJ=["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 TJ(e){const t=e.regex,n=EJ(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_-]*",l=[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:":("+kJ.join("|")+")"},{begin:":(:)?("+NJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+SJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:_J.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vJ.join("|")+")\\b"}]}}function AJ(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 CJ(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 RJ(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,I2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I2,u]}}const R2="[A-Za-z$_][0-9A-Za-z$_]*",OJ=["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"],LJ=["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"],MJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jJ=[].concat(J3,Q3,Z3);function eD(e){const t=e.regex,n=(L,{after:P})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,P)=>{const A=L[0].length+L.index,z=L.input[A];if(z==="<"||z===","){P.ignoreMatch();return}z===">"&&(n(L,{after:A})||P.ignoreMatch());let G;const B=L.input.substring(A);if(G=B.match(/^\s*=/)){P.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){P.ignoreMatch();return}}},l={$pattern:R2,keyword:OJ,literal:LJ,built_in:jJ,"variable.language":MJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,U([...J3,"super","import"].map(L=>`${L}\\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},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,T,$,{match:/\$[(.]/}]}}function tD(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 Vl="[0-9](_*[0-9])*",Ep=`\\.(${Vl})`,xp="[0-9a-fA-F](_*[0-9a-fA-F])*",DJ={className:"number",variants:[{begin:`(\\b(${Vl})((${Ep})|\\.)?|(${Ep}))[eE][+-]?(${Vl})[fFdD]?\\b`},{begin:`\\b(${Vl})((${Ep})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ep})[fFdD]?\\b`},{begin:`\\b(${Vl})[fFdD]\\b`},{begin:`\\b0[xX]((${xp})\\.?|(${xp})?\\.(${xp}))[pP][+-]?(${Vl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${xp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function PJ(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 l={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=DJ,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const BJ=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_-]*/}}),FJ=["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"],UJ=["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"],$J=[...FJ,...UJ],HJ=["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(),nD=["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(),rD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),zJ=["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(),VJ=nD.concat(rD).sort().reverse();function KJ(e){const t=BJ(e),n=VJ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:HJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+zJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+$J.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:":("+nD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+rD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function YJ(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 sD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 WJ(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_]*/,l={"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:l,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 GJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 qJ(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},l={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,$)=>{$.data._beginMatch=M[1]||M[2]},"on:end":(M,$)=>{$.data._beginMatch!==M[1]&&$.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(M=>{const $=[];return M.forEach(C=>{$.push(C),C.toLowerCase()===C?$.push(C.toUpperCase()):$.push(C.toLowerCase())}),$})(w),built_in:b},k=M=>M.map($=>$.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const U=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],W={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[W,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}]}},l,{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",W,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function XJ(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 QJ(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function ZJ(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function JJ(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 eee(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function tee(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const nee=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_-]*/}}),ree=["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"],see=["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"],iee=[...ree,...see],aee=["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(),oee=["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(),lee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cee=["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 uee(e){const t=nee(e),n=lee,r=oee,s="@[a-z-]+",i="and or not only",l={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("+iee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cee.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,l,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:aee.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function dee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function fee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:T}={}){const S=T;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function oD(e){return e?typeof e=="string"?e:e.source:null}function ed(e){return Qt("(?=",e,")")}function Qt(...e){return e.map(n=>oD(n)).join("")}function hee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Lr(...e){return"("+(hee(e).capture?"":"?:")+e.map(r=>oD(r)).join("|")+")"}const Jv=e=>Qt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),pee=["Protocol","Type"].map(Jv),O2=["init","self"].map(Jv),mee=["Any","Self"],xb=["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"],L2=["false","nil","true"],gee=["assignment","associativity","higherThan","left","lowerThan","none","right"],yee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],M2=["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"],lD=Lr(/[/=\-+!*%<>&|^~?]/,/[\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]/),cD=Lr(lD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wb=Qt(lD,cD,"*"),uD=Lr(/[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]/),ug=Lr(uD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Si=Qt(uD,ug,"*"),wp=Qt(/[A-Z]/,ug,"*"),bee=["attached","autoclosure",Qt(/convention\(/,Lr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Qt(/objc\(/,Si,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Eee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function xee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,Lr(...pee,...O2)],className:{2:"keyword"}},i={match:Qt(/\./,Lr(...xb)),relevance:0},a=xb.filter(Ae=>typeof Ae=="string").concat(["_|0"]),l=xb.filter(Ae=>typeof Ae!="string").concat(mee).map(Jv),c={variants:[{className:"keyword",match:Lr(...l,...O2)}]},u={$pattern:Lr(/\b\w+/,/#\w+/),keyword:a.concat(yee),literal:L2},d=[s,i,c],f={match:Qt(/\./,Lr(...M2)),relevance:0},h={className:"built_in",match:Qt(/\b/,Lr(...M2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:wb},{match:`\\.(\\.|${cD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Ae="")=>({className:"subst",variants:[{match:Qt(/\\/,Ae,/[0\\tnr"']/)},{match:Qt(/\\/,Ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Ae="")=>({className:"subst",match:Qt(/\\/,Ae,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Ae="")=>({className:"subst",label:"interpol",begin:Qt(/\\/,Ae,/\(/),end:/\)/}),T=(Ae="")=>({begin:Qt(Ae,/"""/),end:Qt(/"""/,Ae),contains:[_(Ae),k(Ae),N(Ae)]}),S=(Ae="")=>({begin:Qt(Ae,/"/),end:Qt(/"/,Ae),contains:[_(Ae),N(Ae)]}),R={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},U=Ae=>{const He=Qt(Ae,/\//),Ce=Qt(/\//,Ae);return{begin:He,end:Ce,contains:[...I,{scope:"comment",begin:`#(?!.*${Ce})`,end:/$/}]}},W={scope:"regexp",variants:[U("###"),U("##"),U("#"),D]},M={match:Qt(/`/,Si,/`/)},$={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${ug}+`},j=[M,$,C],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Eee,contains:[...w,x,R]}]}},P={scope:"keyword",match:Qt(/@/,Lr(...bee),ed(Lr(/\(/,/\s+/)))},A={scope:"meta",match:Qt(/@/,Si)},z=[L,P,A],G={match:ed(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Qt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ug,"+")},{className:"type",match:wp,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Qt(/\s+&\s+/,ed(wp)),relevance:0}]},B={begin://,keywords:u,contains:[...r,...d,...z,m,G]};G.contains.push(B);const re={match:Qt(Si,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",re,...r,W,...d,...p,...w,x,R,...j,...z,G]},se={begin://,keywords:"repeat each",contains:[...r,G]},de={begin:Lr(ed(Qt(Si,/\s*:/)),ed(Qt(Si,/\s+/,Si,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Si}]},te={begin:/\(/,end:/\)/,keywords:u,contains:[de,...r,...d,...w,x,R,...z,G,Q],endsParent:!0,illegal:/["']/},pe={match:[/(func|macro)/,/\s+/,Lr(M.match,Si,wb)],className:{1:"keyword",3:"title.function"},contains:[se,te,t],illegal:[/\[/,/%/]},ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[se,te,t],illegal:/\[|%/},ye={match:[/operator/,/\s+/,wb],className:{1:"keyword",3:"title"}},ge={begin:[/precedencegroup/,/\s+/,wp],className:{1:"keyword",3:"title"},contains:[G],keywords:[...gee,...L2],end:/}/},be={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},xe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ke={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Si,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[se,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:wp},...d],relevance:0}]};for(const Ae of R.variants){const He=Ae.contains.find(gt=>gt.label==="interpol");He.keywords=u;const Ce=[...d,...p,...w,x,R,...j];He.contains=[...Ce,{begin:/\(/,end:/\)/,contains:["self",...Ce]}]}return{name:"Swift",keywords:u,contains:[...r,pe,ne,be,xe,ke,ye,ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...p,...w,x,R,...j,...z,G,Q]}}const dg="[A-Za-z$_][0-9A-Za-z$_]*",dD=["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"],fD=["true","false","null","undefined","NaN","Infinity"],hD=["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"],pD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yD=[].concat(mD,hD,pD);function wee(e){const t=e.regex,n=(L,{after:P})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,P)=>{const A=L[0].length+L.index,z=L.input[A];if(z==="<"||z===","){P.ignoreMatch();return}z===">"&&(n(L,{after:A})||P.ignoreMatch());let G;const B=L.input.substring(A);if(G=B.match(/^\s*=/)){P.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){P.ignoreMatch();return}}},l={$pattern:dg,keyword:dD,literal:fD,built_in:yD,"variable.language":gD},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...hD,...pD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,U([...mD,"super","import"].map(L=>`${L}\\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},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},j,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},W,D,T,$,{match:/\$[(.]/}]}}function bD(e){const t=e.regex,n=wee(e),r=dg,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:dg,keyword:dD.concat(c),literal:fD,built_in:yD.concat(s),"variable.language":gD},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function vee(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 _ee(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},l={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,l]}}function kee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 ED(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Nee={arduino:mJ,bash:G3,c:gJ,cpp:yJ,csharp:bJ,css:TJ,diff:AJ,go:CJ,graphql:IJ,ini:q3,java:RJ,javascript:eD,json:tD,kotlin:PJ,less:KJ,lua:YJ,makefile:sD,markdown:iD,objectivec:WJ,perl:GJ,php:qJ,"php-template":XJ,plaintext:QJ,python:aD,"python-repl":ZJ,r:JJ,ruby:eee,rust:tee,scss:uee,shell:dee,sql:fee,swift:xee,typescript:bD,vbnet:vee,wasm:_ee,xml:kee,yaml:ED};function xD(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)&&xD(n)}),e}let j2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wD(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Wa(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 See="",D2=e=>!!e.scope,Tee=(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 Aee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=wD(t)}openNode(t){if(!D2(t))return;const n=Tee(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){D2(t)&&(this.buffer+=See)}value(){return this.buffer}span(t){this.buffer+=``}}const P2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class e_{constructor(){this.rootNode=P2(),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=P2({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=>{e_._collapse(n)}))}}class Cee extends e_{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 Aee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Of(e){return e?typeof e=="string"?e:e.source:null}function vD(e){return xl("(?=",e,")")}function Iee(e){return xl("(?:",e,")*")}function Ree(e){return xl("(?:",e,")?")}function xl(...e){return e.map(n=>Of(n)).join("")}function Oee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function t_(...e){return"("+(Oee(e).capture?"":"?:")+e.map(r=>Of(r)).join("|")+")"}function _D(e){return new RegExp(e.toString()+"|").exec("").length-1}function Lee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Mee=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function n_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=Of(r),a="";for(;i.length>0;){const l=Mee.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const jee=/\b\B/,kD="[a-zA-Z]\\w*",r_="[a-zA-Z_]\\w*",ND="\\b\\d+(\\.\\d+)?",SD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",TD="\\b(0b[01]+)",Dee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Pee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=xl(t,/.*\b/,e.binary,/\b.*/)),Wa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Lf={begin:"\\\\[\\s\\S]",relevance:0},Bee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Lf]},Fee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Lf]},Uee={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/},k0=function(e,t,n={}){const r=Wa({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=t_("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:xl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},$ee=k0("//","$"),Hee=k0("/\\*","\\*/"),zee=k0("#","$"),Vee={scope:"number",begin:ND,relevance:0},Kee={scope:"number",begin:SD,relevance:0},Yee={scope:"number",begin:TD,relevance:0},Wee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Lf,{begin:/\[/,end:/\]/,relevance:0,contains:[Lf]}]},Gee={scope:"title",begin:kD,relevance:0},qee={scope:"title",begin:r_,relevance:0},Xee={begin:"\\.\\s*"+r_,relevance:0},Qee=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 vp=Object.freeze({__proto__:null,APOS_STRING_MODE:Bee,BACKSLASH_ESCAPE:Lf,BINARY_NUMBER_MODE:Yee,BINARY_NUMBER_RE:TD,COMMENT:k0,C_BLOCK_COMMENT_MODE:Hee,C_LINE_COMMENT_MODE:$ee,C_NUMBER_MODE:Kee,C_NUMBER_RE:SD,END_SAME_AS_BEGIN:Qee,HASH_COMMENT_MODE:zee,IDENT_RE:kD,MATCH_NOTHING_RE:jee,METHOD_GUARD:Xee,NUMBER_MODE:Vee,NUMBER_RE:ND,PHRASAL_WORDS_MODE:Uee,QUOTE_STRING_MODE:Fee,REGEXP_MODE:Wee,RE_STARTERS_RE:Dee,SHEBANG:Pee,TITLE_MODE:Gee,UNDERSCORE_IDENT_RE:r_,UNDERSCORE_TITLE_MODE:qee});function Zee(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Jee(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ete(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Zee,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function tte(e,t){Array.isArray(e.illegal)&&(e.illegal=t_(...e.illegal))}function nte(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 rte(e,t){e.relevance===void 0&&(e.relevance=1)}const ste=(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=xl(n.beforeMatch,vD(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ite=["of","and","for","in","not","or","if","then","parent","list","value"],ate="keyword";function AD(e,t,n=ate){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,AD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,ote(c[0],c[1])]})}}function ote(e,t){return t?Number(t):lte(e)?0:1}function lte(e){return ite.includes(e.toLowerCase())}const B2={},Xo=e=>{console.error(e)},F2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ml=(e,t)=>{B2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),B2[`${e}/${t}`]=!0)},fg=new Error;function CD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=_D(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function cte(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Xo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fg;if(typeof e.beginScope!="object"||e.beginScope===null)throw Xo("beginScope must be object"),fg;CD(e,e.begin,{key:"beginScope"}),e.begin=n_(e.begin,{joinWith:""})}}function ute(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Xo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fg;if(typeof e.endScope!="object"||e.endScope===null)throw Xo("endScope must be object"),fg;CD(e,e.end,{key:"endScope"}),e.end=n_(e.end,{joinWith:""})}}function dte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function fte(e){dte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),cte(e),ute(e)}function hte(e){function t(a,l){return new RegExp(Of(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=_D(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(n_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[Jee,nte,fte,ste].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[ete,tte,rte].forEach(d=>d(a,l)),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=AD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=Of(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return pte(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Wa(e.classNameAliases||{}),i(e)}function ID(e){return e?e.endsWithParent||ID(e.starts):!1}function pte(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Wa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ID(e)?Wa(e,{starts:e.starts?Wa(e.starts):null}):Object.isFrozen(e)?Wa(e):e}var mte="11.11.1";class gte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const vb=wD,U2=Wa,$2=Symbol("nomatch"),yte=7,RD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Cee};function c(C){return l.noHighlightRe.test(C)}function u(C){let j=C.className+" ";j+=C.parentNode?C.parentNode.className:"";const L=l.languageDetectRe.exec(j);if(L){const P=S(L[1]);return P||(F2(i.replace("{}",L[1])),F2("Falling back to no-highlight mode for this block.",C)),P?L[1]:"no-highlight"}return j.split(/\s+/).find(P=>c(P)||S(P))}function d(C,j,L){let P="",A="";typeof j=="object"?(P=C,L=j.ignoreIllegals,A=j.language):(Ml("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ml("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),A=C,P=j),L===void 0&&(L=!0);const z={code:P,language:A};M("before:highlight",z);const G=z.result?z.result:f(z.language,z.code,L);return G.code=z.code,M("after:highlight",G),G}function f(C,j,L,P){const A=Object.create(null);function z(X,ee){return X.keywords[ee]}function G(){if(!Ce.keywords){Ge.addText(ze);return}let X=0;Ce.keywordPatternRe.lastIndex=0;let ee=Ce.keywordPatternRe.exec(ze),me="";for(;ee;){me+=ze.substring(X,ee.index);const Le=ke.case_insensitive?ee[0].toLowerCase():ee[0],Ye=z(Ce,Le);if(Ye){const[Ze,Pt]=Ye;if(Ge.addText(me),me="",A[Le]=(A[Le]||0)+1,A[Le]<=yte&&(le+=Pt),Ze.startsWith("_"))me+=ee[0];else{const bt=ke.classNameAliases[Ze]||Ze;Q(ee[0],bt)}}else me+=ee[0];X=Ce.keywordPatternRe.lastIndex,ee=Ce.keywordPatternRe.exec(ze)}me+=ze.substring(X),Ge.addText(me)}function B(){if(ze==="")return;let X=null;if(typeof Ce.subLanguage=="string"){if(!t[Ce.subLanguage]){Ge.addText(ze);return}X=f(Ce.subLanguage,ze,!0,gt[Ce.subLanguage]),gt[Ce.subLanguage]=X._top}else X=p(ze,Ce.subLanguage.length?Ce.subLanguage:null);Ce.relevance>0&&(le+=X.relevance),Ge.__addSublanguage(X._emitter,X.language)}function re(){Ce.subLanguage!=null?B():G(),ze=""}function Q(X,ee){X!==""&&(Ge.startScope(ee),Ge.addText(X),Ge.endScope())}function se(X,ee){let me=1;const Le=ee.length-1;for(;me<=Le;){if(!X._emit[me]){me++;continue}const Ye=ke.classNameAliases[X[me]]||X[me],Ze=ee[me];Ye?Q(Ze,Ye):(ze=Ze,G(),ze=""),me++}}function de(X,ee){return X.scope&&typeof X.scope=="string"&&Ge.openNode(ke.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(Q(ze,ke.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),ze=""):X.beginScope._multi&&(se(X.beginScope,ee),ze="")),Ce=Object.create(X,{parent:{value:Ce}}),Ce}function te(X,ee,me){let Le=Lee(X.endRe,me);if(Le){if(X["on:end"]){const Ye=new j2(X);X["on:end"](ee,Ye),Ye.isMatchIgnored&&(Le=!1)}if(Le){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return te(X.parent,ee,me)}function pe(X){return Ce.matcher.regexIndex===0?(ze+=X[0],1):(ft=!0,0)}function ne(X){const ee=X[0],me=X.rule,Le=new j2(me),Ye=[me.__beforeBegin,me["on:begin"]];for(const Ze of Ye)if(Ze&&(Ze(X,Le),Le.isMatchIgnored))return pe(ee);return me.skip?ze+=ee:(me.excludeBegin&&(ze+=ee),re(),!me.returnBegin&&!me.excludeBegin&&(ze=ee)),de(me,X),me.returnBegin?0:ee.length}function ye(X){const ee=X[0],me=j.substring(X.index),Le=te(Ce,X,me);if(!Le)return $2;const Ye=Ce;Ce.endScope&&Ce.endScope._wrap?(re(),Q(ee,Ce.endScope._wrap)):Ce.endScope&&Ce.endScope._multi?(re(),se(Ce.endScope,X)):Ye.skip?ze+=ee:(Ye.returnEnd||Ye.excludeEnd||(ze+=ee),re(),Ye.excludeEnd&&(ze=ee));do Ce.scope&&Ge.closeNode(),!Ce.skip&&!Ce.subLanguage&&(le+=Ce.relevance),Ce=Ce.parent;while(Ce!==Le.parent);return Le.starts&&de(Le.starts,X),Ye.returnEnd?0:ee.length}function ge(){const X=[];for(let ee=Ce;ee!==ke;ee=ee.parent)ee.scope&&X.unshift(ee.scope);X.forEach(ee=>Ge.openNode(ee))}let be={};function xe(X,ee){const me=ee&&ee[0];if(ze+=X,me==null)return re(),0;if(be.type==="begin"&&ee.type==="end"&&be.index===ee.index&&me===""){if(ze+=j.slice(ee.index,ee.index+1),!s){const Le=new Error(`0 width match regex (${C})`);throw Le.languageName=C,Le.badRule=be.rule,Le}return 1}if(be=ee,ee.type==="begin")return ne(ee);if(ee.type==="illegal"&&!L){const Le=new Error('Illegal lexeme "'+me+'" for mode "'+(Ce.scope||"")+'"');throw Le.mode=Ce,Le}else if(ee.type==="end"){const Le=ye(ee);if(Le!==$2)return Le}if(ee.type==="illegal"&&me==="")return ze+=` -`,1;if(ut>1e5&&ut>ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=me,me.length}const ke=S(C);if(!ke)throw Xo(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Ae=hte(ke);let He="",Ce=P||Ae;const gt={},Ge=new l.__emitter(l);ge();let ze="",le=0,Ee=0,ut=0,ft=!1;try{if(ke.__emitTokens)ke.__emitTokens(j,Ge);else{for(Ce.matcher.considerAll();;){ut++,ft?ft=!1:Ce.matcher.considerAll(),Ce.matcher.lastIndex=Ee;const X=Ce.matcher.exec(j);if(!X)break;const ee=j.substring(Ee,X.index),me=xe(ee,X);Ee=X.index+me}xe(j.substring(Ee))}return Ge.finalize(),He=Ge.toHTML(),{language:C,value:He,relevance:le,illegal:!1,_emitter:Ge,_top:Ce}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:C,value:vb(j),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Ee,context:j.slice(Ee-100,Ee+100),mode:X.mode,resultSoFar:He},_emitter:Ge};if(s)return{language:C,value:vb(j),illegal:!1,relevance:0,errorRaised:X,_emitter:Ge,_top:Ce};throw X}}function h(C){const j={value:vb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return j._emitter.addText(C),j}function p(C,j){j=j||l.languages||Object.keys(t);const L=h(C),P=j.filter(S).filter(I).map(re=>f(re,C,!1));P.unshift(L);const A=P.sort((re,Q)=>{if(re.relevance!==Q.relevance)return Q.relevance-re.relevance;if(re.language&&Q.language){if(S(re.language).supersetOf===Q.language)return 1;if(S(Q.language).supersetOf===re.language)return-1}return 0}),[z,G]=A,B=z;return B.secondBest=G,B}function m(C,j,L){const P=j&&n[j]||L;C.classList.add("hljs"),C.classList.add(`language-${P}`)}function g(C){let j=null;const L=u(C);if(c(L))return;if(M("before:highlightElement",{el:C,language:L}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new gte("One of your code blocks includes unescaped HTML.",C.innerHTML);j=C;const P=j.textContent,A=L?d(P,{language:L,ignoreIllegals:!0}):p(P);C.innerHTML=A.value,C.dataset.highlighted="yes",m(C,L,A.language),C.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(C.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),M("after:highlightElement",{el:C,result:A,text:P})}function w(C){l=U2(l,C)}const y=()=>{_(),Ml("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Ml("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,j){let L=null;try{L=j(e)}catch(P){if(Xo("Language definition for '{}' could not be registered.".replace("{}",C)),s)Xo(P);else throw P;L=a}L.name||(L.name=C),t[C]=L,L.rawDefinition=j.bind(null,e),L.aliases&&R(L.aliases,{languageName:C})}function N(C){delete t[C];for(const j of Object.keys(n))n[j]===C&&delete n[j]}function T(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:j}){typeof C=="string"&&(C=[C]),C.forEach(L=>{n[L.toLowerCase()]=j})}function I(C){const j=S(C);return j&&!j.disableAutodetect}function D(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=j=>{C["before:highlightBlock"](Object.assign({block:j.el},j))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=j=>{C["after:highlightBlock"](Object.assign({block:j.el},j))})}function U(C){D(C),r.push(C)}function W(C){const j=r.indexOf(C);j!==-1&&r.splice(j,1)}function M(C,j){const L=C;r.forEach(function(P){P[L]&&P[L](j)})}function $(C){return Ml("10.7.0","highlightBlock will be removed entirely in v12.0"),Ml("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:$,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:T,getLanguage:S,registerAliases:R,autoDetection:I,inherit:U2,addPlugin:U,removePlugin:W}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=mte,e.regex={concat:xl,lookahead:vD,either:t_,optional:Ree,anyNumberOfTimes:Iee};for(const C in vp)typeof vp[C]=="object"&&xD(vp[C]);return Object.assign(e,vp),e},Qc=RD({});Qc.newInstance=()=>RD({});var bte=Qc;Qc.HighlightJS=Qc;Qc.default=Qc;const es=Wf(bte),H2={},Ete="hljs-";function xte(e){const t=es.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||H2,h=typeof f.prefix=="string"?f.prefix:Ete;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:wte,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||H2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class wte{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,l){return l?a+"_".repeat(l):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 vte={};function z2(e){const t=e||vte,n=t.aliases,r=t.detect||!1,s=t.languages||Nee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=xte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){uh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=_te(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=aJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function _te(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 l=n[a];if(l===void 0){const c=Y2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 qte(e){return e>=56320&&e<=57343}function Xte(e,t){return(e-55296)*1024+9216+t}function PD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function BD(e){return e>=64976&&e<=65007||Gte.has(e)}var he;(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"})(he||(he={}));const Qte=65536;class Zte{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=Qte,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(qte(n))return this.pos++,this._addGap(),Xte(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(he.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,DD(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){PD(t)?this._err(he.controlCharacterInInputStream):BD(t)&&this._err(he.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 Jte=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))),ene=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 tne(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ene.get(e))!==null&&t!==void 0?t:e}var ar;(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"})(ar||(ar={}));const nne=32;var Ga;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ga||(Ga={}));function tx(e){return e>=ar.ZERO&&e<=ar.NINE}function rne(e){return e>=ar.UPPER_A&&e<=ar.UPPER_F||e>=ar.LOWER_A&&e<=ar.LOWER_F}function sne(e){return e>=ar.UPPER_A&&e<=ar.UPPER_Z||e>=ar.LOWER_A&&e<=ar.LOWER_Z||tx(e)}function ine(e){return e===ar.EQUALS||sne(e)}var sr;(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"})(sr||(sr={}));var ta;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ta||(ta={}));class ane{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=sr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ta.Strict}startEntity(t){this.decodeMode=t,this.state=sr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case sr.EntityStart:return t.charCodeAt(n)===ar.NUM?(this.state=sr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=sr.NamedEntity,this.stateNamedEntity(t,n));case sr.NumericStart:return this.stateNumericStart(t,n);case sr.NumericDecimal:return this.stateNumericDecimal(t,n);case sr.NumericHex:return this.stateNumericHex(t,n);case sr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|nne)===ar.LOWER_X?(this.state=sr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=sr.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===ar.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ta.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]&Ga.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]&~Ga.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case sr.NamedEntity:return this.result!==0&&(this.decodeMode!==ta.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sr.NumericDecimal:return this.emitNumericEntity(0,2);case sr.NumericHex:return this.emitNumericEntity(0,3);case sr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sr.EntityStart:return 0}}}function one(e,t,n,r){const s=(t&Ga.BRANCH_LENGTH)>>7,i=t&Ga.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=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 Qo;(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"})(Qo||(Qo={}));var Os;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Os||(Os={}));var ae;(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"})(ae||(ae={}));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 lne=new Map([[ae.A,v.A],[ae.ADDRESS,v.ADDRESS],[ae.ANNOTATION_XML,v.ANNOTATION_XML],[ae.APPLET,v.APPLET],[ae.AREA,v.AREA],[ae.ARTICLE,v.ARTICLE],[ae.ASIDE,v.ASIDE],[ae.B,v.B],[ae.BASE,v.BASE],[ae.BASEFONT,v.BASEFONT],[ae.BGSOUND,v.BGSOUND],[ae.BIG,v.BIG],[ae.BLOCKQUOTE,v.BLOCKQUOTE],[ae.BODY,v.BODY],[ae.BR,v.BR],[ae.BUTTON,v.BUTTON],[ae.CAPTION,v.CAPTION],[ae.CENTER,v.CENTER],[ae.CODE,v.CODE],[ae.COL,v.COL],[ae.COLGROUP,v.COLGROUP],[ae.DD,v.DD],[ae.DESC,v.DESC],[ae.DETAILS,v.DETAILS],[ae.DIALOG,v.DIALOG],[ae.DIR,v.DIR],[ae.DIV,v.DIV],[ae.DL,v.DL],[ae.DT,v.DT],[ae.EM,v.EM],[ae.EMBED,v.EMBED],[ae.FIELDSET,v.FIELDSET],[ae.FIGCAPTION,v.FIGCAPTION],[ae.FIGURE,v.FIGURE],[ae.FONT,v.FONT],[ae.FOOTER,v.FOOTER],[ae.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ae.FORM,v.FORM],[ae.FRAME,v.FRAME],[ae.FRAMESET,v.FRAMESET],[ae.H1,v.H1],[ae.H2,v.H2],[ae.H3,v.H3],[ae.H4,v.H4],[ae.H5,v.H5],[ae.H6,v.H6],[ae.HEAD,v.HEAD],[ae.HEADER,v.HEADER],[ae.HGROUP,v.HGROUP],[ae.HR,v.HR],[ae.HTML,v.HTML],[ae.I,v.I],[ae.IMG,v.IMG],[ae.IMAGE,v.IMAGE],[ae.INPUT,v.INPUT],[ae.IFRAME,v.IFRAME],[ae.KEYGEN,v.KEYGEN],[ae.LABEL,v.LABEL],[ae.LI,v.LI],[ae.LINK,v.LINK],[ae.LISTING,v.LISTING],[ae.MAIN,v.MAIN],[ae.MALIGNMARK,v.MALIGNMARK],[ae.MARQUEE,v.MARQUEE],[ae.MATH,v.MATH],[ae.MENU,v.MENU],[ae.META,v.META],[ae.MGLYPH,v.MGLYPH],[ae.MI,v.MI],[ae.MO,v.MO],[ae.MN,v.MN],[ae.MS,v.MS],[ae.MTEXT,v.MTEXT],[ae.NAV,v.NAV],[ae.NOBR,v.NOBR],[ae.NOFRAMES,v.NOFRAMES],[ae.NOEMBED,v.NOEMBED],[ae.NOSCRIPT,v.NOSCRIPT],[ae.OBJECT,v.OBJECT],[ae.OL,v.OL],[ae.OPTGROUP,v.OPTGROUP],[ae.OPTION,v.OPTION],[ae.P,v.P],[ae.PARAM,v.PARAM],[ae.PLAINTEXT,v.PLAINTEXT],[ae.PRE,v.PRE],[ae.RB,v.RB],[ae.RP,v.RP],[ae.RT,v.RT],[ae.RTC,v.RTC],[ae.RUBY,v.RUBY],[ae.S,v.S],[ae.SCRIPT,v.SCRIPT],[ae.SEARCH,v.SEARCH],[ae.SECTION,v.SECTION],[ae.SELECT,v.SELECT],[ae.SOURCE,v.SOURCE],[ae.SMALL,v.SMALL],[ae.SPAN,v.SPAN],[ae.STRIKE,v.STRIKE],[ae.STRONG,v.STRONG],[ae.STYLE,v.STYLE],[ae.SUB,v.SUB],[ae.SUMMARY,v.SUMMARY],[ae.SUP,v.SUP],[ae.TABLE,v.TABLE],[ae.TBODY,v.TBODY],[ae.TEMPLATE,v.TEMPLATE],[ae.TEXTAREA,v.TEXTAREA],[ae.TFOOT,v.TFOOT],[ae.TD,v.TD],[ae.TH,v.TH],[ae.THEAD,v.THEAD],[ae.TITLE,v.TITLE],[ae.TR,v.TR],[ae.TRACK,v.TRACK],[ae.TT,v.TT],[ae.U,v.U],[ae.UL,v.UL],[ae.SVG,v.SVG],[ae.VAR,v.VAR],[ae.WBR,v.WBR],[ae.XMP,v.XMP]]);function wu(e){var t;return(t=lne.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ne=v,cne={[we.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[we.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[we.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[we.XLINK]:new Set,[we.XML]:new Set,[we.XMLNS]:new Set},nx=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);ae.STYLE,ae.SCRIPT,ae.XMP,ae.IFRAME,ae.NOEMBED,ae.NOFRAMES,ae.PLAINTEXT;var Y;(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"})(Y||(Y={}));const Un={DATA:Y.DATA,RCDATA:Y.RCDATA,RAWTEXT:Y.RAWTEXT,SCRIPT_DATA:Y.SCRIPT_DATA,PLAINTEXT:Y.PLAINTEXT,CDATA_SECTION:Y.CDATA_SECTION};function une(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function Ed(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function dne(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function ja(e){return dne(e)||Ed(e)}function G2(e){return ja(e)||une(e)}function _p(e){return e+32}function UD(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function q2(e){return UD(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function fne(e){return e===H.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:DD(e)?he.surrogateCharacterReference:BD(e)?he.noncharacterCharacterReference:PD(e)||e===H.CARRIAGE_RETURN?he.controlCharacterReference:null}class hne{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=Y.DATA,this.returnState=Y.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Zte(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new ane(Jte,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=fne(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(he.endTagWithAttributes),t.selfClosing&&this._err(he.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 Tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Tt.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:Tt.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=UD(t)?Tt.WHITESPACE_CHARACTER:t===H.NULL?Tt.NULL_CHARACTER:Tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Y.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ta.Attribute:ta.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Y.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Y.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Y.DATA:{this._stateData(t);break}case Y.RCDATA:{this._stateRcdata(t);break}case Y.RAWTEXT:{this._stateRawtext(t);break}case Y.SCRIPT_DATA:{this._stateScriptData(t);break}case Y.PLAINTEXT:{this._statePlaintext(t);break}case Y.TAG_OPEN:{this._stateTagOpen(t);break}case Y.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Y.TAG_NAME:{this._stateTagName(t);break}case Y.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Y.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Y.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Y.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Y.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Y.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Y.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Y.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Y.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Y.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Y.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Y.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Y.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Y.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Y.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Y.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Y.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Y.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Y.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Y.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Y.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Y.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Y.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Y.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Y.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Y.COMMENT_START:{this._stateCommentStart(t);break}case Y.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Y.COMMENT:{this._stateComment(t);break}case Y.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Y.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Y.COMMENT_END:{this._stateCommentEnd(t);break}case Y.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Y.DOCTYPE:{this._stateDoctype(t);break}case Y.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Y.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Y.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Y.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Y.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Y.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Y.CDATA_SECTION:{this._stateCdataSection(t);break}case Y.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Y.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Y.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Y.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(he.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=Y.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=Y.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(yn);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ja(t))this._createStartTagToken(),this.state=Y.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=Y.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=Y.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Y.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Y.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ja(t))this._createEndTagToken(),this.state=Y.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=Y.DATA;break}case H.EOF:{this._err(he.eofBeforeTagName),this._emitChars("");break}case H.NULL:{this._err(he.unexpectedNullCharacter),this.state=Y.SCRIPT_DATA_ESCAPED,this._emitChars(yn);break}case H.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ja(t)?(this._emitChars("<"),this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ja(t)?(this.state=Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case H.NULL:{this._err(he.unexpectedNullCharacter),this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(yn);break}case H.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.SOLIDUS?(this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Yr.SCRIPT,!1)&&q2(this.preprocessor.peek(Yr.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(bne,we.HTML)}clearBackToTableBodyContext(){this.clearBackTo(yne,we.HTML)}clearBackToTableRowContext(){this.clearBackTo(gne,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(Z2.has(s))return!1;break}case we.MATHML:{if(Q2.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,hg)}hasInListItemScope(t){return this.hasInDynamicScope(t,pne)}hasInButtonScope(t){return this.hasInDynamicScope(t,mne)}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(nx.has(n))return!0;if(hg.has(n))return!1;break}case we.SVG:{if(Z2.has(n))return!1;break}case we.MATHML:{if(Q2.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&&$D.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&X2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&X2.has(this.currentTagId);)this.pop()}}const _b=3;var Ci;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ci||(Ci={}));const J2={type:Ci.Marker};class wne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=_b&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(J2)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ci.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ci.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(J2);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ci.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ci.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ci.Element&&n.element===t)}}const Da={createDocument(){return{nodeName:"#document",mode:Os.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};Da.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(Da.isTextNode(n)){n.value+=t;return}}Da.appendChild(e,Da.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Da.isTextNode(r)?r.value+=t:Da.insertBefore(e,Da.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Tne(e){return e.name===HD&&e.publicId===null&&(e.systemId===null||e.systemId===vne)}function Ane(e){if(e.name!==HD)return Os.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===_ne)return Os.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Nne.has(n))return Os.QUIRKS;let r=t===null?kne:zD;if(eA(n,r))return Os.QUIRKS;if(r=t===null?VD:Sne,eA(n,r))return Os.LIMITED_QUIRKS}return Os.NO_QUIRKS}const tA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Cne="definitionurl",Ine="definitionURL",Rne=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])),One=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}]]),Lne=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])),Mne=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 jne(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===Qo.COLOR||r===Qo.SIZE||r===Qo.FACE)||Mne.has(t)}function KD(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=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=Un.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)===ae.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=Un.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Un.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Un.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Un.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(l=>this.treeAdapter.isDocumentTypeNode(l));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(ae.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===Tt.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)===ae.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 Tt.CHARACTER:{this.onCharacter(t);break}case Tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Tt.COMMENT:{this.onComment(t);break}case Tt.DOCTYPE:{this.onDoctype(t);break}case Tt.START_TAG:{this._processStartTag(t);break}case Tt.END_TAG:{this.onEndTag(t);break}case Tt.EOF:{this.onEof(t);break}case Tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Fne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ci.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(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=Z.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Z.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Z.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Z.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Z.IN_TABLE;return}case v.BODY:{this.insertionMode=Z.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Z.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?Z.AFTER_HEAD:Z.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Z.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Z.IN_HEAD;return}break}}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===v.TEMPLATE)break;if(r===v.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(t){return WD.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 cne[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Ese(this,t);return}switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:{qD(this,t);break}case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_TABLE_TEXT:{tP(this,t);break}case Z.IN_COLUMN_GROUP:{pg(this,t);break}case Z.AFTER_BODY:{mg(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bse(this,t);return}switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.TEXT:{this._insertCharacters(t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_COLUMN_GROUP:{pg(this,t);break}case Z.AFTER_BODY:{mg(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){rx(this,t);return}switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:{rx(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.AFTER_BODY:{Xne(this,t);break}case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{Qne(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:{Zne(this,t);break}case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?xse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Jne(this,t);break}case Z.BEFORE_HEAD:{tre(this,t);break}case Z.IN_HEAD:{Ei(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{sre(this,t);break}case Z.AFTER_HEAD:{are(this,t);break}case Z.IN_BODY:{Tr(this,t);break}case Z.IN_TABLE:{Zc(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_CAPTION:{nse(this,t);break}case Z.IN_COLUMN_GROUP:{c_(this,t);break}case Z.IN_TABLE_BODY:{T0(this,t);break}case Z.IN_ROW:{A0(this,t);break}case Z.IN_CELL:{ise(this,t);break}case Z.IN_SELECT:{sP(this,t);break}case Z.IN_SELECT_IN_TABLE:{ose(this,t);break}case Z.IN_TEMPLATE:{cse(this,t);break}case Z.AFTER_BODY:{dse(this,t);break}case Z.IN_FRAMESET:{fse(this,t);break}case Z.AFTER_FRAMESET:{pse(this,t);break}case Z.AFTER_AFTER_BODY:{gse(this,t);break}case Z.AFTER_AFTER_FRAMESET:{yse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?wse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{ere(this,t);break}case Z.BEFORE_HEAD:{nre(this,t);break}case Z.IN_HEAD:{rre(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{ire(this,t);break}case Z.AFTER_HEAD:{ore(this,t);break}case Z.IN_BODY:{S0(this,t);break}case Z.TEXT:{Yre(this,t);break}case Z.IN_TABLE:{Mf(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_CAPTION:{rse(this,t);break}case Z.IN_COLUMN_GROUP:{sse(this,t);break}case Z.IN_TABLE_BODY:{sx(this,t);break}case Z.IN_ROW:{rP(this,t);break}case Z.IN_CELL:{ase(this,t);break}case Z.IN_SELECT:{iP(this,t);break}case Z.IN_SELECT_IN_TABLE:{lse(this,t);break}case Z.IN_TEMPLATE:{use(this,t);break}case Z.AFTER_BODY:{oP(this,t);break}case Z.IN_FRAMESET:{hse(this,t);break}case Z.AFTER_FRAMESET:{mse(this,t);break}case Z.AFTER_AFTER_BODY:{dm(this,t);break}}}onEof(t){switch(this.insertionMode){case Z.INITIAL:{td(this,t);break}case Z.BEFORE_HTML:{Kd(this,t);break}case Z.BEFORE_HEAD:{Yd(this,t);break}case Z.IN_HEAD:{Wd(this,t);break}case Z.IN_HEAD_NO_SCRIPT:{Gd(this,t);break}case Z.AFTER_HEAD:{qd(this,t);break}case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:{JD(this,t);break}case Z.TEXT:{Wre(this,t);break}case Z.IN_TABLE_TEXT:{nd(this,t);break}case Z.IN_TEMPLATE:{aP(this,t);break}case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{l_(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 Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:{this._insertCharacters(t);break}case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:{GD(this,t);break}case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:{kb(this,t);break}case Z.IN_TABLE_TEXT:{eP(this,t);break}}}};function Vne(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):ZD(e,t),n}function Kne(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 Yne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Hne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Wne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Wne(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 Gne(e,t,n){const r=e.treeAdapter.getTagName(t),s=wu(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 qne(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 o_(e,t){for(let n=0;n<$ne;n++){const r=Vne(e,t);if(!r)break;const s=Kne(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=Yne(e,s,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),a&&Gne(e,a,i),qne(e,s,r)}}function rx(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Xne(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Qne(e,t){e._appendCommentNode(t,e.document)}function l_(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=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 Zne(e,t){e._setDocumentType(t);const n=t.forceQuirks?Os.QUIRKS:Ane(t);Tne(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function td(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Os.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function Jne(e,t){t.tagID===v.HTML?(e._insertElement(t,we.HTML),e.insertionMode=Z.BEFORE_HEAD):Kd(e,t)}function ere(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Kd(e,t)}function Kd(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function tre(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.HEAD:{e._insertElement(t,we.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break}default:Yd(e,t)}}function nre(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?Yd(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function Yd(e,t){e._insertFakeElement(ae.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function Ei(e,t){switch(t.tagID){case v.HTML:{Tr(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,Un.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Un.RAWTEXT):(e._insertElement(t,we.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Un.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Un.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Wd(e,t)}}function rre(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Wd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function wl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Wd(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function sre(e,t){switch(t.tagID){case v.HTML:{Tr(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,he.nestedNoscriptInHead);break}default:Gd(e,t)}}function ire(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break}case v.BR:{Gd(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Gd(e,t){const n=t.type===Tt.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function are(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.BODY:{e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,we.HTML),e.insertionMode=Z.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,he.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),Ei(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:qd(e,t)}}function ore(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{qd(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function qd(e,t){e._insertFakeElement(ae.BODY,v.BODY),e.insertionMode=Z.IN_BODY,N0(e,t)}function N0(e,t){switch(t.type){case Tt.CHARACTER:{qD(e,t);break}case Tt.WHITESPACE_CHARACTER:{GD(e,t);break}case Tt.COMMENT:{rx(e,t);break}case Tt.START_TAG:{Tr(e,t);break}case Tt.END_TAG:{S0(e,t);break}case Tt.EOF:{JD(e,t);break}}}function GD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function qD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function lre(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function cre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function ure(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_FRAMESET)}function dre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML)}function fre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&nx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,we.HTML)}function hre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function pre(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 mre(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 gre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.tokenizer.state=Un.PLAINTEXT}function yre(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 bre(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ae.A);n&&(o_(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 Ere(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(o_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,we.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function wre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function vre(e,t){e.treeAdapter.getDocumentMode(e.document)!==Os.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function XD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function QD(e){const t=FD(e,Qo.TYPE);return t!=null&&t.toLowerCase()===Une}function _re(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,we.HTML),QD(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function kre(e,t){e._appendElement(t,we.HTML),t.ackSelfClosing=!0}function Nre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,we.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sre(e,t){t.tagName=ae.IMG,t.tagID=v.IMG,XD(e,t)}function Tre(e,t){e._insertElement(t,we.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Un.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function Are(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function Cre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Un.RAWTEXT)}function sA(e,t){e._switchToTextParsing(t,Un.RAWTEXT)}function Ire(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function Rre(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function Ore(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,we.HTML)}function Lre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,we.HTML)}function Mre(e,t){e._reconstructActiveFormattingElements(),KD(t),a_(t),t.selfClosing?e._appendElement(t,we.MATHML):e._insertElement(t,we.MATHML),t.ackSelfClosing=!0}function jre(e,t){e._reconstructActiveFormattingElements(),YD(t),a_(t),t.selfClosing?e._appendElement(t,we.SVG):e._insertElement(t,we.SVG),t.ackSelfClosing=!0}function iA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,we.HTML)}function Tr(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:{Ere(e,t);break}case v.A:{bre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{fre(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:{dre(e,t);break}case v.LI:case v.DD:case v.DT:{mre(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{XD(e,t);break}case v.HR:{Nre(e,t);break}case v.RB:case v.RTC:{Ore(e,t);break}case v.RT:case v.RP:{Lre(e,t);break}case v.PRE:case v.LISTING:{hre(e,t);break}case v.XMP:{Are(e,t);break}case v.SVG:{jre(e,t);break}case v.HTML:{lre(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:{cre(e,t);break}case v.FORM:{pre(e,t);break}case v.NOBR:{xre(e,t);break}case v.MATH:{Mre(e,t);break}case v.TABLE:{vre(e,t);break}case v.INPUT:{_re(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{kre(e,t);break}case v.IMAGE:{Sre(e,t);break}case v.BUTTON:{yre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{wre(e,t);break}case v.IFRAME:{Cre(e,t);break}case v.SELECT:{Ire(e,t);break}case v.OPTION:case v.OPTGROUP:{Rre(e,t);break}case v.NOEMBED:case v.NOFRAMES:{sA(e,t);break}case v.FRAMESET:{ure(e,t);break}case v.TEXTAREA:{Tre(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?sA(e,t):iA(e,t);break}case v.PLAINTEXT:{gre(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:iA(e,t)}}function Dre(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Pre(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Z.AFTER_BODY,oP(e,t))}function Bre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Fre(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 Ure(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ae.P,v.P),e._closePElement()}function $re(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Hre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function zre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Vre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Kre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ae.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function ZD(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 S0(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:{o_(e,t);break}case v.P:{Ure(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:{Bre(e,t);break}case v.LI:{$re(e);break}case v.DD:case v.DT:{Hre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{zre(e);break}case v.BR:{Kre(e);break}case v.BODY:{Dre(e,t);break}case v.HTML:{Pre(e,t);break}case v.FORM:{Fre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Vre(e,t);break}case v.TEMPLATE:{wl(e,t);break}default:ZD(e,t)}}function JD(e,t){e.tmplInsertionModeStack.length>0?aP(e,t):l_(e,t)}function Yre(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 Wre(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function kb(e,t){if(e.openElements.currentTagId!==void 0&&WD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case Tt.CHARACTER:{tP(e,t);break}case Tt.WHITESPACE_CHARACTER:{eP(e,t);break}}else fh(e,t)}function Gre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_CAPTION}function qre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function Xre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.COLGROUP,v.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,c_(e,t)}function Qre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,we.HTML),e.insertionMode=Z.IN_TABLE_BODY}function Zre(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ae.TBODY,v.TBODY),e.insertionMode=Z.IN_TABLE_BODY,T0(e,t)}function Jre(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ese(e,t){QD(t)?e._appendElement(t,we.HTML):fh(e,t),t.ackSelfClosing=!0}function tse(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,we.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Zc(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{Zre(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{Ei(e,t);break}case v.COL:{Xre(e,t);break}case v.FORM:{tse(e,t);break}case v.TABLE:{Jre(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{Qre(e,t);break}case v.INPUT:{ese(e,t);break}case v.CAPTION:{Gre(e,t);break}case v.COLGROUP:{qre(e,t);break}default:fh(e,t)}}function Mf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{wl(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:fh(e,t)}}function fh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,N0(e,t),e.fosterParentingEnabled=n}function eP(e,t){e.pendingCharacterTokens.push(t)}function tP(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function nd(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:{wl(e,t);break}}}function ose(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)):sP(e,t)}function lse(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)):iP(e,t)}function cse(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]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,Zc(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,c_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,T0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,A0(e,t);break}default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,Tr(e,t)}}function use(e,t){t.tagID===v.TEMPLATE&&wl(e,t)}function aP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):l_(e,t)}function dse(e,t){t.tagID===v.HTML?Tr(e,t):mg(e,t)}function oP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Z.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 mg(e,t)}function mg(e,t){e.insertionMode=Z.IN_BODY,N0(e,t)}function fse(e,t){switch(t.tagID){case v.HTML:{Tr(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 hse(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function pse(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.NOFRAMES:{Ei(e,t);break}}}function mse(e,t){t.tagID===v.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function gse(e,t){t.tagID===v.HTML?Tr(e,t):dm(e,t)}function dm(e,t){e.insertionMode=Z.IN_BODY,N0(e,t)}function yse(e,t){switch(t.tagID){case v.HTML:{Tr(e,t);break}case v.NOFRAMES:{Ei(e,t);break}}}function bse(e,t){t.chars=yn,e._insertCharacters(t)}function Ese(e,t){e._insertCharacters(t),e.framesetOk=!1}function lP(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 xse(e,t){if(jne(t))lP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===we.MATHML?KD(t):r===we.SVG&&(Dne(t),YD(t)),a_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function wse(e,t){if(t.tagID===v.P||t.tagID===v.BR){lP(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}}}ae.AREA,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BR,ae.COL,ae.EMBED,ae.FRAME,ae.HR,ae.IMG,ae.INPUT,ae.KEYGEN,ae.LINK,ae.META,ae.PARAM,ae.SOURCE,ae.TRACK,ae.WBR;const vse=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_se=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),aA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function cP(e,t){const n=Lse(e),r=k3("type",{handlers:{root:kse,element:Nse,text:Sse,comment:dP,doctype:Tse,raw:Cse},unknown:Ise}),s={parser:n?new rA(aA):rA.getFragmentParser(void 0,aA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),vu(s,$i());const i=n?s.parser.document:s.parser.getFragment(),a=Mte(i,{file:s.options.file});return s.stitches&&uh(a,"comment",function(l,c,u){const d=l;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 uP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Tt.CHARACTER,chars:e.value,location:hh(e)};vu(t,$i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Tse(e,t){const n={type:Tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:hh(e)};vu(t,$i(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ase(e,t){t.stitches=!0;const n=Mse(e);if("children"in e&&"children"in n){const r=cP({type:"root",children:e.children},t.options);n.children=r.children}dP({type:"comment",value:{stitch:n}},t)}function dP(e,t){const n=e.value,r={type:Tt.COMMENT,data:n,location:hh(e)};vu(t,$i(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Cse(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,fP(t,$i(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(vse,"<$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 Ise(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ase(n,t);else{let r="";throw _se.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 vu(e,t){fP(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=Un.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 fP(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 Rse(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Un.PLAINTEXT)return;vu(t,$i(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Ho.html;s===Ho.html&&n==="svg"&&(s=Ho.svg);const i=Fte({...e,children:[]},{space:s===Ho.svg?"svg":"html"}),a={type:Tt.START_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:hh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ose(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Wte.includes(n)||t.parser.tokenizer.state===Un.PLAINTEXT)return;vu(t,E0(e));const r={type:Tt.END_TAG,tagName:n,tagID:wu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:hh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Un.RCDATA||t.parser.tokenizer.state===Un.RAWTEXT||t.parser.tokenizer.state===Un.SCRIPT_DATA)&&(t.parser.tokenizer.state=Un.DATA)}function Lse(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function hh(e){const t=$i(e)||{line:void 0,column:void 0,offset:void 0},n=E0(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 Mse(e){return"children"in e?Xc({...e,children:[]}):Xc(e)}function jse(e){return function(t,n){return cP(t,{...e,file:n})}}const hP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function pP(e){if(!e)return!1;try{const t=e.toLowerCase();return hP.some(n=>t.includes(n))}catch{return!1}}function Dse(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(pP(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 hP.some(i=>s.includes(i))}return!1}function Pse({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(UX,{remarkPlugins:[JZ],rehypePlugins:n?[jse,z2]:[z2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(pP(d)||Dse(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(xM,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(_c,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(u0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(pr,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const ph=E.memo(Pse),oA=6,lA=7,Bse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ix(e){return Bse[(e||"").trim().toLowerCase()]||"未知"}function cA(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 Fse(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 Use(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 $se({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Hse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function uA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 ax(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function dA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(uA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(uA,{direction:"right"})})]})]})}function fm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function zse({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx($se,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Hse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ix(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(ax,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(ph,{text:Use(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(fm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function Vse(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,T]=E.useState(""),[S,R]=E.useState(null),[I,D]=E.useState(null),[U,W]=E.useState(!1),[M,$]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let z=!0;return u(!0),f(""),WK({region:e,page:s,pageSize:oA}).then(G=>{if(!z)return;const B=G.items||[];r(B),l(G.totalCount||0),p(re=>B.find(Q=>Q.id===(re==null?void 0:re.id))||null)}).catch(G=>{z&&(r([]),l(0),p(null),f(G instanceof Error?G.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{z&&u(!1)}),()=>{z=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let z=!0;return k(!0),T(""),GK(h.id,{region:e,page:w,pageSize:lA,project:h.projectName}).then(G=>{z&&(g(G.items||[]),x(G.totalCount||0))}).catch(G=>{z&&(g([]),x(0),T(G instanceof Error?G.message:"读取技能失败,请稍后重试"))}).finally(()=>{z&&k(!1)}),()=>{z=!1}},[e,h,w]);const j=z=>{z!==e&&(P(),t(z),i(1),y(1),p(null),g([]))},L=z=>{P(),p(z),y(1)},P=()=>{C.current+=1,R(null),D(null),$(""),W(!1)},A=async z=>{if(!h)return;const G=C.current+1;C.current=G,R(z),D(null),$(""),W(!0);try{const B=await qK(h.id,z.skillId,z.version,e,h.projectName);C.current===G&&D(B)}catch(B){C.current===G&&$(B instanceof Error?B.message:"读取技能详情失败,请稍后重试")}finally{C.current===G&&W(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>j("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>j("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(fm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(z=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===z.id?"active":""}`,onClick:()=>L(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.name,children:z.name}),o.jsx("span",{className:"skillcenter-item-description",children:z.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${cA(z.status)}`,children:ix(z.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:z.projectName||"default",children:["Project · ",z.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[z.skillCount??0," 个技能"]}),z.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",Fse(z.updatedAt)]})]})]})},`${z.projectName||"default"}:${z.id}`))})]}),o.jsx(dA,{page:s,total:a,pageSize:oA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(ax,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(fm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(z=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void A(z),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:z.skillName,children:z.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:z.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${cA(z.skillStatus)}`,children:ix(z.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",z.version||"—"]})]})]})},`${z.skillId}:${z.version}`))})]}),o.jsx(dA,{page:w,total:b,pageSize:lA,onPage:y})]}):o.jsx(fm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(zse,{skill:S,space:h,region:e,detail:I,loading:U,error:M,onClose:P})]})}function Kse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await vj(a,n,s,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(ro(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx(Ft,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function Zn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function C0(){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}})}hm.prototype=C0.prototype={constructor:hm,on:function(e,t){var n=this._,r=Wse(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)),hA.hasOwnProperty(t)?{space:hA[t],local:e}:e}function qse(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ox&&t.documentElement.namespaceURI===ox?t.createElement(e):t.createElementNS(n,e)}}function Xse(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mP(e){var t=I0(e);return(t.local?Xse:qse)(t)}function Qse(){}function u_(e){return e==null?Qse:function(){return this.querySelector(e)}}function Zse(e){typeof e!="function"&&(e=u_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function _ie(e){e||(e=kie);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 Nie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sie(){return Array.from(this)}function Tie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Bie:typeof t=="function"?Uie:Fie)(e,t,n??"")):Jc(this.node(),e)}function Jc(e,t){return e.style.getPropertyValue(t)||xP(e).getComputedStyle(e,null).getPropertyValue(t)}function Hie(e){return function(){delete this[e]}}function zie(e,t){return function(){this[e]=t}}function Vie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kie(e,t){return arguments.length>1?this.each((t==null?Hie:typeof t=="function"?Vie:zie)(e,t)):this.node()[e]}function wP(e){return e.trim().split(/^|\s+/)}function d_(e){return e.classList||new vP(e)}function vP(e){this._node=e,this._names=wP(e.getAttribute("class")||"")}vP.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 _P(e,t){for(var n=d_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Eae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function lx(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}lx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Cae(e){return!e.ctrlKey&&!e.button}function Iae(){return this.parentNode}function Rae(e,t){return t??{x:e.x,y:e.y}}function Oae(){return navigator.maxTouchPoints||"ontouchstart"in this}function CP(){var e=Cae,t=Iae,n=Rae,r=Oae,s={},i=C0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Aae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(ls(_.view).on("mousemove.drag",m,jf).on("mouseup.drag",g,jf),TP(_.view),Nb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Sc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){ls(_.view).on("mousemove.drag mouseup.drag",null),AP(_.view,u),Sc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,T=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Np(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Np(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=Mae.exec(e))?new Xr(t[1],t[2],t[3],1):(t=jae.exec(e))?new Xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dae.exec(e))?Np(t[1],t[2],t[3],t[4]):(t=Pae.exec(e))?Np(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Bae.exec(e))?xA(t[1],t[2]/100,t[3]/100,1):(t=Fae.exec(e))?xA(t[1],t[2]/100,t[3]/100,t[4]):pA.hasOwnProperty(e)?yA(pA[e]):e==="transparent"?new Xr(NaN,NaN,NaN,0):null}function yA(e){return new Xr(e>>16&255,e>>8&255,e&255,1)}function Np(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xr(e,t,n,r)}function Hae(e){return e instanceof gh||(e=cl(e)),e?(e=e.rgb(),new Xr(e.r,e.g,e.b,e.opacity)):new Xr}function cx(e,t,n,r){return arguments.length===1?Hae(e):new Xr(e,t,n,r??1)}function Xr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}f_(Xr,cx,IP(gh,{brighter(e){return e=e==null?yg:Math.pow(yg,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new Xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xr(Zo(this.r),Zo(this.g),Zo(this.b),bg(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:bA,formatHex:bA,formatHex8:zae,formatRgb:EA,toString:EA}));function bA(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}`}function zae(){return`#${zo(this.r)}${zo(this.g)}${zo(this.b)}${zo((isNaN(this.opacity)?1:this.opacity)*255)}`}function EA(){const e=bg(this.opacity);return`${e===1?"rgb(":"rgba("}${Zo(this.r)}, ${Zo(this.g)}, ${Zo(this.b)}${e===1?")":`, ${e})`}`}function bg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zo(e){return e=Zo(e),(e<16?"0":"")+e.toString(16)}function xA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new li(e,t,n,r)}function RP(e){if(e instanceof li)return new li(e.h,e.s,e.l,e.opacity);if(e instanceof gh||(e=cl(e)),!e)return new li;if(e instanceof li)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new li(a,l,c,e.opacity)}function Vae(e,t,n,r){return arguments.length===1?RP(e):new li(e,t,n,r??1)}function li(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}f_(li,Vae,IP(gh,{brighter(e){return e=e==null?yg:Math.pow(yg,e),new li(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Df:Math.pow(Df,e),new li(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 Xr(Sb(e>=240?e-240:e+120,s,r),Sb(e,s,r),Sb(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new li(wA(this.h),Sp(this.s),Sp(this.l),bg(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=bg(this.opacity);return`${e===1?"hsl(":"hsla("}${wA(this.h)}, ${Sp(this.s)*100}%, ${Sp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wA(e){return e=(e||0)%360,e<0?e+360:e}function Sp(e){return Math.max(0,Math.min(1,e||0))}function Sb(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 h_=e=>()=>e;function Kae(e,t){return function(n){return e+n*t}}function Yae(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 Wae(e){return(e=+e)==1?OP:function(t,n){return n-t?Yae(t,n,e):h_(isNaN(t)?n:t)}}function OP(e,t){var n=t-e;return n?Kae(e,n):h_(isNaN(e)?t:e)}const Eg=function e(t){var n=Wae(t);function r(s,i){var a=n((s=cx(s)).r,(i=cx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=OP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Gae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:Ii(r,s)})),n=Tb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Ii(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Ii(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:Ii(u,f)},{i:g-2,x:Ii(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--eu}function kA(){ul=(wg=Bf.now())+R0,eu=xd=0;try{coe()}finally{eu=0,doe(),ul=0}}function uoe(){var e=Bf.now(),t=e-wg;t>DP&&(R0-=t,wg=e)}function doe(){for(var e,t=xg,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:xg=n);wd=e,fx(r)}function fx(e){if(!eu){xd&&(xd=clearTimeout(xd));var t=e-ul;t>24?(e<1/0&&(xd=setTimeout(kA,e-Bf.now()-R0)),rd&&(rd=clearInterval(rd))):(rd||(wg=Bf.now(),rd=setInterval(uoe,DP)),eu=1,PP(kA))}}function NA(e,t,n){var r=new vg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var foe=C0("start","end","cancel","interrupt"),hoe=[],FP=0,SA=1,hx=2,mm=3,TA=4,px=5,gm=6;function O0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;poe(e,n,{name:t,index:r,group:s,on:foe,tween:hoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:FP})}function m_(e,t){var n=xi(e,t);if(n.state>FP)throw new Error("too late; already scheduled");return n}function zi(e,t){var n=xi(e,t);if(n.state>mm)throw new Error("too late; already running");return n}function xi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function poe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=BP(i,0,n.time);function i(u){n.state=SA,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!==SA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===mm)return NA(a);p.state===TA?(p.state=gm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dhx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Voe(e,t,n){var r,s,i=zoe(t)?m_:zi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function Koe(e,t){var n=this._id;return arguments.length<2?xi(this.node(),n).on.on(e):this.each(Voe(n,e,t))}function Yoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Woe(){return this.on("end.remove",Yoe(this._id))}function Goe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=u_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function Ele(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 sa(e,t,n){this.k=e,this.x=t,this.y=n}sa.prototype={constructor:sa,scale:function(e){return e===1?this:new sa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sa(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 L0=new sa(1,0,0);zP.prototype=sa.prototype;function zP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return L0;return e.__zoom}function Ab(e){e.stopImmediatePropagation()}function sd(e){e.preventDefault(),e.stopImmediatePropagation()}function xle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wle(){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 AA(){return this.__zoom||L0}function vle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _le(){return navigator.maxTouchPoints||"ontouchstart"in this}function kle(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 VP(){var e=xle,t=wle,n=kle,r=vle,s=_le,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=pm,u=C0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(M){M.property("__zoom",AA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",D).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(M,$,C,j){var L=M.selection?M.selection():M;L.property("__zoom",AA),M!==L?k(M,$,C,j):L.interrupt().each(function(){N(this,arguments).event(j).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},y.scaleBy=function(M,$,C,j){y.scaleTo(M,function(){var L=this.__zoom.k,P=typeof $=="function"?$.apply(this,arguments):$;return L*P},C,j)},y.scaleTo=function(M,$,C,j){y.transform(M,function(){var L=t.apply(this,arguments),P=this.__zoom,A=C==null?_(L):typeof C=="function"?C.apply(this,arguments):C,z=P.invert(A),G=typeof $=="function"?$.apply(this,arguments):$;return n(x(b(P,G),A,z),L,a)},C,j)},y.translateBy=function(M,$,C,j){y.transform(M,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,j)},y.translateTo=function(M,$,C,j,L){y.transform(M,function(){var P=t.apply(this,arguments),A=this.__zoom,z=j==null?_(P):typeof j=="function"?j.apply(this,arguments):j;return n(L0.translate(z[0],z[1]).scale(A.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof C=="function"?-C.apply(this,arguments):-C),P,a)},j,L)};function b(M,$){return $=Math.max(i[0],Math.min(i[1],$)),$===M.k?M:new sa($,M.x,M.y)}function x(M,$,C){var j=$[0]-C[0]*M.k,L=$[1]-C[1]*M.k;return j===M.x&&L===M.y?M:new sa(M.k,j,L)}function _(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function k(M,$,C,j){M.on("start.zoom",function(){N(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(j).end()}).tween("zoom",function(){var L=this,P=arguments,A=N(L,P).event(j),z=t.apply(L,P),G=C==null?_(z):typeof C=="function"?C.apply(L,P):C,B=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),re=L.__zoom,Q=typeof $=="function"?$.apply(L,P):$,se=c(re.invert(G).concat(B/re.k),Q.invert(G).concat(B/Q.k));return function(de){if(de===1)de=Q;else{var te=se(de),pe=B/te[2];de=new sa(pe,G[0]-te[0]*pe,G[1]-te[1]*pe)}A.zoom(null,de)}})}function N(M,$,C){return!C&&M.__zooming||new T(M,$)}function T(M,$){this.that=M,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,$),this.taps=0}T.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,$){return this.mouse&&M!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var $=ls(this.that).datum();u.call(M,this.that,new Ele(M,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),$)}};function S(M,...$){if(!e.apply(this,arguments))return;var C=N(this,$).event(M),j=this.__zoom,L=Math.max(i[0],Math.min(i[1],j.k*Math.pow(2,r.apply(this,arguments)))),P=ii(M);if(C.wheel)(C.mouse[0][0]!==P[0]||C.mouse[0][1]!==P[1])&&(C.mouse[1]=j.invert(C.mouse[0]=P)),clearTimeout(C.wheel);else{if(j.k===L)return;C.mouse=[P,j.invert(P)],ym(this),C.start()}sd(M),C.wheel=setTimeout(A,m),C.zoom("mouse",n(x(b(j,L),C.mouse[0],C.mouse[1]),C.extent,a));function A(){C.wheel=null,C.end()}}function R(M,...$){if(h||!e.apply(this,arguments))return;var C=M.currentTarget,j=N(this,$,!0).event(M),L=ls(M.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",B,!0),P=ii(M,C),A=M.clientX,z=M.clientY;TP(M.view),Ab(M),j.mouse=[P,this.__zoom.invert(P)],ym(this),j.start();function G(re){if(sd(re),!j.moved){var Q=re.clientX-A,se=re.clientY-z;j.moved=Q*Q+se*se>g}j.event(re).zoom("mouse",n(x(j.that.__zoom,j.mouse[0]=ii(re,C),j.mouse[1]),j.extent,a))}function B(re){L.on("mousemove.zoom mouseup.zoom",null),AP(re.view,j.moved),sd(re),j.event(re).end()}}function I(M,...$){if(e.apply(this,arguments)){var C=this.__zoom,j=ii(M.changedTouches?M.changedTouches[0]:M,this),L=C.invert(j),P=C.k*(M.shiftKey?.5:2),A=n(x(b(C,P),j,L),t.apply(this,$),a);sd(M),l>0?ls(this).transition().duration(l).call(k,A,j,M):ls(this).call(y.transform,A,j,M)}}function D(M,...$){if(e.apply(this,arguments)){var C=M.touches,j=C.length,L=N(this,$,M.changedTouches.length===j).event(M),P,A,z,G;for(Ab(M),A=0;A`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.`},Ff=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],KP=["Enter"," ","Escape"],YP={"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 tu;(function(e){e.Strict="strict",e.Loose="loose"})(tu||(tu={}));var Jo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Jo||(Jo={}));var Uf;(function(e){e.Partial="partial",e.Full="full"})(Uf||(Uf={}));const WP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var za;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(za||(za={}));var nu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nu||(nu={}));var Fe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Fe||(Fe={}));const CA={[Fe.Left]:Fe.Right,[Fe.Right]:Fe.Left,[Fe.Top]:Fe.Bottom,[Fe.Bottom]:Fe.Top};function GP(e){return e===null?null:e?"valid":"invalid"}const qP=e=>"id"in e&&"source"in e&&"target"in e,Nle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),y_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yh=(e,t=[0,0])=>{const{width:n,height:r}=Ea(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Sle=(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):y_(s)?s:t.nodeLookup.get(s.id));const l=a?_g(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return M0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return j0(n)},bh=(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=M0(n,_g(s)),r=!0)}),r?j0(n):{x:0,y:0,width:0,height:0}},b_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={..._u(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,g=$f(l,su(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},Tle=(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 Ale(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 Cle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Ale(e,a),c=bh(l),u=x_(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 XP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",bi.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&fl(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=fl(f)?dl(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",bi.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 Ile({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=Tle(a,c);for(const h of c)l.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 ru=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dl=(e={x:0,y:0},t,n)=>({x:ru(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ru(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function QP(e,t,n){const{width:r,height:s}=Ea(n),{x:i,y:a}=n.internals.positionAbsolute;return dl(e,[[i,a],[i+r,a+s]],t)}const IA=(e,t,n)=>en?-ru(Math.abs(e-n),1,t)/t:0,E_=(e,t,n=15,r=40)=>{const s=IA(e.x,r,t.width-r)*n,i=IA(e.y,r,t.height-r)*n;return[s,i]},M0=(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)}),mx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),j0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),su=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:yh(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}},_g=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=y_(e)?e.internals.positionAbsolute:yh(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)}},ZP=(e,t)=>j0(M0(mx(e),mx(t))),$f=(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)},RA=e=>ui(e.width)&&ui(e.height)&&ui(e.x)&&ui(e.y),ui=e=>!isNaN(e)&&isFinite(e),JP=(e,t)=>(n,r)=>{},Eh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),_u=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?Eh(l,a):l},iu=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function jl(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 Rle(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jl(e,n),s=jl(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=jl(e.top??e.y??0,n),s=jl(e.bottom??e.y??0,n),i=jl(e.left??e.x??0,t),a=jl(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 Ole(e,t,n,r,s,i){const{x:a,y:l}=iu(e,[t,n,r]),{x:c,y:u}=iu({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const x_=(e,t,n,r,s,i)=>{const a=Rle(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=ru(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,g=Ole(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Hf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function fl(e){return e!=null&&e!=="parent"}function Ea(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 w_(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 e4(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function OA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Lle(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Mle(e){return{...YP,...e||{}}}function Qd(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=di(e),l=_u({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?Eh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const v_=e=>({width:e.offsetWidth,height:e.offsetHeight}),t4=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jle=["INPUT","SELECT","TEXTAREA"];function n4(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:jle.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const r4=e=>"clientX"in e,di=(e,t)=>{var i,a;const n=r4(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)}},LA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...v_(a)}})};function s4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Cp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function MA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case Fe.Left:return[t-Cp(t-r,i),n];case Fe.Right:return[t+Cp(r-t,i),n];case Fe.Top:return[t,n-Cp(n-s,i)];case Fe.Bottom:return[t,n+Cp(s-n,i)]}}function i4({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top,curvature:a=.25}){const[l,c]=MA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=MA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=s4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function a4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const Ble=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Fle=(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)),Ule=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",bi.error006()),t;const r=n.getEdgeId||Ble;let s;return qP(e)?s={...e}:s={...e,id:r(e)},Fle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function o4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=a4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const jA={[Fe.Left]:{x:-1,y:0},[Fe.Right]:{x:1,y:0},[Fe.Top]:{x:0,y:-1},[Fe.Bottom]:{x:0,y:1}},$le=({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 Hle({source:e,sourcePosition:t=Fe.Bottom,target:n,targetPosition:r=Fe.Top,center:s,offset:i,stepPosition:a}){const l=jA[t],c=jA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=$le({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=a4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const M=Math.abs(e[h]-n[h]);if(M<=i){const $=Math.min(i-1,i-M);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*$:b[h]=(d[h]>n[h]?-1:1)*$}}if(t!==r){const M=h==="x"?"y":"x",$=l[h]===c[M],C=u[M]>d[M],j=u[M]=W?(g=(I.x+D.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+D.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function zle(e,t,n,r){const s=Math.min(DA(e,t)/2,DA(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 gx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Kle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=gx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const l4=1e3,Yle=10,__={nodeOrigin:[0,0],nodeExtent:Ff,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Wle={...__,checkEquality:!0};function k_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Gle(e,t,n){const r=k_(__,n);for(const s of e.values())if(s.parentId)S_(s,e,t,r);else{const i=yh(s,r.nodeOrigin),a=fl(s.extent)?s.extent:r.nodeExtent,l=dl(i,a,Ea(s));s.internals.positionAbsolute=l}}function qle(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 N_(e){return e==="manual"}function yx(e,t,n,r={}){var d,f;const s=k_(Wle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!N_(s.zIndexMode)?l4: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=yh(h,s.nodeOrigin),g=fl(h.extent)?h.extent:s.nodeExtent,w=dl(m,g,Ea(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:qle(h,p),z:c4(h,l,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&&S_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Xle(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 S_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=k_(__,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}Xle(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*Yle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!N_(c)?l4:0,{x:h,y:p,z:m}=Qle(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function c4(e,t,n){const r=ui(e.zIndex)?e.zIndex:0;return N_(n)?r:r+(e.selected?t:0)}function Qle(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=Ea(e),u=yh(e,n),d=fl(e.extent)?dl(u,e.extent,c):u;let f=dl({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=QP(f,c,t));const h=c4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function T_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??su(c),d=ZP(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Ea(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=T_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function Jle({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 UA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 u4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;UA("source",c,d,e,s,a),UA("target",c,u,e,i,l),t.set(r.id,r)}}function d4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:d4(n,t):!1}function $A(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 ece(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!d4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Cb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function tce({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=Eh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function nce({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:T=0}){h=ls(_);function S({x:U,y:W}){const{nodeLookup:M,nodeExtent:$,snapGrid:C,snapToGrid:j,nodeOrigin:L,onNodeDrag:P,onSelectionDrag:A,onError:z,updateNodePositions:G}=t();i={x:U,y:W};let B=!1;const re=l.size>1,Q=re&&$?mx(bh(l)):null,se=re&&j?tce({dragItems:l,snapGrid:C,x:U,y:W}):null;for(const[de,te]of l){if(!M.has(de))continue;let pe={x:U-te.distance.x,y:W-te.distance.y};j&&(pe=se?{x:Math.round(pe.x+se.x),y:Math.round(pe.y+se.y)}:Eh(pe,C));let ne=null;if(re&&$&&!te.extent&&Q){const{positionAbsolute:be}=te.internals,xe=be.x-Q.x+$[0][0],ke=be.x+te.measured.width-Q.x2+$[1][0],Ae=be.y-Q.y+$[0][1],He=be.y+te.measured.height-Q.y2+$[1][1];ne=[[xe,Ae],[ke,He]]}const{position:ye,positionAbsolute:ge}=XP({nodeId:de,nextPosition:pe,nodeLookup:M,nodeExtent:ne||$,nodeOrigin:L,onError:z});B=B||te.position.x!==ye.x||te.position.y!==ye.y,te.position=ye,te.internals.positionAbsolute=ge}if(m=m||B,!!B&&(G(l,!0),g&&(r||P||!N&&A))){const[de,te]=Cb({nodeId:N,dragItems:l,nodeLookup:M});r==null||r(g,l,de,te),P==null||P(g,de,te),N||A==null||A(g,te)}}async function R(){if(!d)return;const{transform:U,panBy:W,autoPanSpeed:M,autoPanOnNodeDrag:$}=t();if(!$){c=!1,cancelAnimationFrame(a);return}const[C,j]=E_(u,d,M);(C!==0||j!==0)&&(i.x=(i.x??0)-C/U[2],i.y=(i.y??0)-j/U[2],await W({x:C,y:j})&&S(i)),a=requestAnimationFrame(R)}function I(U){var re;const{nodeLookup:W,multiSelectionActive:M,nodesDraggable:$,transform:C,snapGrid:j,snapToGrid:L,selectNodesOnDrag:P,onNodeDragStart:A,onSelectionDragStart:z,unselectNodesAndEdges:G}=t();f=!0,(!P||!k)&&!M&&N&&((re=W.get(N))!=null&&re.selected||G()),k&&P&&N&&(e==null||e(N));const B=Qd(U.sourceEvent,{transform:C,snapGrid:j,snapToGrid:L,containerBounds:d});if(i=B,l=ece(W,$,B,N),l.size>0&&(n||A||!N&&z)){const[Q,se]=Cb({nodeId:N,dragItems:l,nodeLookup:W});n==null||n(U.sourceEvent,l,Q,se),A==null||A(U.sourceEvent,Q,se),N||z==null||z(U.sourceEvent,se)}}const D=CP().clickDistance(T).on("start",U=>{const{domNode:W,nodeDragThreshold:M,transform:$,snapGrid:C,snapToGrid:j}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,p=!1,m=!1,g=U.sourceEvent,M===0&&I(U),i=Qd(U.sourceEvent,{transform:$,snapGrid:C,snapToGrid:j,containerBounds:d}),u=di(U.sourceEvent,d)}).on("drag",U=>{const{autoPanOnNodeDrag:W,transform:M,snapGrid:$,snapToGrid:C,nodeDragThreshold:j,nodeLookup:L}=t(),P=Qd(U.sourceEvent,{transform:M,snapGrid:$,snapToGrid:C,containerBounds:d});if(g=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||N&&!L.has(N))&&(p=!0),!p){if(!c&&W&&f&&(c=!0,R()),!f){const A=di(U.sourceEvent,d),z=A.x-u.x,G=A.y-u.y;Math.sqrt(z*z+G*G)>j&&I(U)}(i.x!==P.xSnapped||i.y!==P.ySnapped)&&l&&f&&(u=di(U.sourceEvent,d),S(P))}}).on("end",U=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:W,updateNodePositions:M,onNodeDragStop:$,onSelectionDragStop:C}=t();if(m&&(M(l,!1),m=!1),s||$||!N&&C){const[j,L]=Cb({nodeId:N,dragItems:l,nodeLookup:W,dragging:!1});s==null||s(U.sourceEvent,l,j,L),$==null||$(U.sourceEvent,j,L),N||C==null||C(U.sourceEvent,L)}}}).filter(U=>{const W=U.target;return!U.button&&(!b||!$A(W,`.${b}`,_))&&(!x||$A(W,x,_))});h.call(D)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function rce(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())$f(s,su(i))>0&&r.push(i);return r}const sce=250;function ice(e,t,n,r){var l,c;let s=[],i=1/0;const a=rce(e,n,t+sce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=hl(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 f4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...hl(a,c,c.position,!0)}:c}function h4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ace(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const p4=()=>!0;function oce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=p4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:S}){const R=t4(e.target);let I=0,D;const{x:U,y:W}=di(e),M=h4(i,S),$=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!$||!M)return;const j=f4(s,M,r,c,t);if(!j)return;let L=di(e,$),P=!1,A=null,z=!1,G=null;function B(){if(!d||!$)return;const[ye,ge]=E_(L,$,N);h({x:ye,y:ge}),I=requestAnimationFrame(B)}const re={...j,nodeId:s,type:M,position:j.position},Q=c.get(s);let de={inProgress:!0,isValid:null,from:hl(Q,re,Fe.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:Q,to:L,toHandle:null,toPosition:CA[re.position],toNode:null,pointer:L};function te(){C=!0,x(de),m==null||m(e,{nodeId:s,handleId:r,handleType:M})}T===0&&te();function pe(ye){if(!C){const{x:He,y:Ce}=di(ye),gt=He-U,Ge=Ce-W;if(!(gt*gt+Ge*Ge>T*T))return;te()}if(!k()||!re){ne(ye);return}const ge=_();L=di(ye,$),D=ice(_u(L,ge,!1,[1,1]),n,c,re),P||(B(),P=!0);const be=m4(ye,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});G=be.handleDomNode,A=be.connection,z=ace(!!D,be.isValid);const xe=c.get(s),ke=xe?hl(xe,re,Fe.Left,!0):de.from,Ae={...de,from:ke,isValid:z,to:be.toHandle&&z?iu({x:be.toHandle.x,y:be.toHandle.y},ge):L,toHandle:be.toHandle,toPosition:z&&be.toHandle?be.toHandle.position:CA[re.position],toNode:be.toHandle?c.get(be.toHandle.nodeId):null,pointer:L};x(Ae),de=Ae}function ne(ye){if(!("touches"in ye&&ye.touches.length>0)){if(C){(D||G)&&A&&z&&(g==null||g(A));const{inProgress:ge,...be}=de,xe={...be,toPosition:de.toHandle?de.toPosition:null};w==null||w(ye,xe),i&&(b==null||b(ye,xe))}p(),cancelAnimationFrame(I),P=!1,z=!1,A=null,G=null,R.removeEventListener("mousemove",pe),R.removeEventListener("mouseup",ne),R.removeEventListener("touchmove",pe),R.removeEventListener("touchend",ne)}}R.addEventListener("mousemove",pe),R.addEventListener("mouseup",ne),R.addEventListener("touchmove",pe),R.addEventListener("touchend",ne)}function m4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=p4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=di(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=h4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const T={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=T;const R=k&&N&&(n===tu.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(T),y.toHandle=f4(x,b,_,d,n,!0)}return y}const bx={onPointerDown:oce,isValid:m4};function lce({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=ls(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Hf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=_[2]*Math.pow(2,N*k);t.scaleTo(T)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const T=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*T,y:_[1]-N[1]*T},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=VP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ii}}const D0=e=>({x:e.x,y:e.y,zoom:e.k}),Ib=({x:e,y:t,zoom:n})=>L0.translate(e,t).scale(n),cc=(e,t)=>e.target.closest(`.${t}`),g4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),cce=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Rb=(e,t=0,n=cce,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},y4=e=>{const t=e.ctrlKey&&Hf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function uce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(cc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ii(d),y=y4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===Jo.Vertical?0:d.deltaX*h,m=s===Jo.Horizontal?0:d.deltaY*h;!Hf()&&d.shiftKey&&s!==Jo.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=D0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function dce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=cc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function fce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=D0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function hce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&g4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,D0(i.transform)))}}function pce({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&g4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=D0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function mce({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(cc(f,`${u}-flow__node`)||cc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||cc(f,l)&&m||cc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function gce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=VP().scaleExtent([t,n]).translateExtent(r),h=ls(e).call(f);b({x:s.x,y:s.y,zoom:ru(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(y4);async function g(D,U){return h?new Promise(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).transform(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}function w({noWheelClassName:D,noPanClassName:U,onPaneContextMenu:W,userSelectionActive:M,panOnScroll:$,panOnDrag:C,panOnScrollMode:j,panOnScrollSpeed:L,preventScrolling:P,zoomOnPinch:A,zoomOnScroll:z,zoomOnDoubleClick:G,zoomActivationKeyPressed:B,lib:re,onTransformChange:Q,connectionInProgress:se,paneClickDistance:de,selectionOnDrag:te}){M&&!u.isZoomingOrPanning&&y();const pe=$&&!B&&!M;f.clickDistance(te?1/0:!ui(de)||de<0?0:de);const ne=pe?uce({zoomPanValues:u,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:j,panOnScrollSpeed:L,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):dce({noWheelClassName:D,preventScrolling:P,d3ZoomHandler:p});h.on("wheel.zoom",ne,{passive:!1});const ye=fce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",ye);const ge=hce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!W,onPanZoom:i,onTransformChange:Q});f.on("zoom",ge);const be=pce({zoomPanValues:u,panOnDrag:C,panOnScroll:$,onPaneContextMenu:W,onPanZoomEnd:l,onDraggingChange:c});f.on("end",be);const xe=mce({zoomActivationKeyPressed:B,panOnDrag:C,zoomOnScroll:z,panOnScroll:$,zoomOnDoubleClick:G,zoomOnPinch:A,userSelectionActive:M,noPanClassName:U,noWheelClassName:D,lib:re,connectionInProgress:se});f.filter(xe),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(D,U,W){const M=Ib(D),$=f==null?void 0:f.constrain()(M,U,W);return $&&await g($),$}async function x(D,U){const W=Ib(D);return await g(W,U),W}function _(D){if(h){const U=Ib(D),W=h.property("__zoom");(W.k!==D.zoom||W.x!==D.x||W.y!==D.y)&&(f==null||f.transform(h,U,null,{sync:!0}))}}function k(){const D=h?zP(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(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).scaleTo(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}async function T(D,U){return h?new Promise(W=>{f==null||f.interpolate((U==null?void 0:U.interpolate)==="linear"?Xd:pm).scaleBy(Rb(h,U==null?void 0:U.duration,U==null?void 0:U.ease,()=>W(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function R(D){f==null||f.translateExtent(D)}function I(D){const U=!ui(D)||D<0?0:D;f==null||f.clickDistance(U)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:T,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var au;(function(e){e.Line="line",e.Handle="handle"})(au||(au={}));function yce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function HA(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 Ra(e,t){return Math.max(0,t-e)}function Oa(e,t){return Math.max(0,e-t)}function Ip(e,t,n){return Math.max(0,t-e,e-n)}function zA(e,t){return e?!t:t}function bce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:T}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),D=N+(u?-R:R),U=-i[0]*k,W=-i[1]*N;let M=Ip(I,g,w),$=Ip(D,y,b);if(a){let L=0,P=0;c&&S<0?L=Ra(x+S+U,a[0][0]):!c&&S>0&&(L=Oa(x+I+U,a[1][0])),u&&R<0?P=Ra(_+R+W,a[0][1]):!u&&R>0&&(P=Oa(_+D+W,a[1][1])),M=Math.max(M,L),$=Math.max($,P)}if(l){let L=0,P=0;c&&S>0?L=Oa(x+S,l[0][0]):!c&&S<0&&(L=Ra(x+I,l[1][0])),u&&R>0?P=Oa(_+R,l[0][1]):!u&&R<0&&(P=Ra(_+D,l[1][1])),M=Math.max(M,L),$=Math.max($,P)}if(s){if(d){const L=Ip(I/T,y,b)*T;if(M=Math.max(M,L),a){let P=0;!c&&!u||c&&!u&&h?P=Oa(_+W+I/T,a[1][1])*T:P=Ra(_+W+(c?S:-S)/T,a[0][1])*T,M=Math.max(M,P)}if(l){let P=0;!c&&!u||c&&!u&&h?P=Ra(_+I/T,l[1][1])*T:P=Oa(_+(c?S:-S)/T,l[0][1])*T,M=Math.max(M,P)}}if(f){const L=Ip(D*T,g,w)/T;if($=Math.max($,L),a){let P=0;!c&&!u||u&&!c&&h?P=Oa(x+D*T+U,a[1][0])/T:P=Ra(x+(u?R:-R)*T+U,a[0][0])/T,$=Math.max($,P)}if(l){let P=0;!c&&!u||u&&!c&&h?P=Ra(x+D*T,l[1][0])/T:P=Oa(x+(u?R:-R)*T,l[0][0])/T,$=Math.max($,P)}}}R=R+(R<0?$:-$),S=S+(S<0?M:-M),s&&(h?I>D*T?R=(zA(c,u)?-S:S)/T:S=(zA(c,u)?-R:R)*T:d?(R=S/T,u=c):(S=R*T,c=u));const C=c?x+S:x,j=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+j}}const b4={width:0,height:0,x:0,y:0},Ece={...b4,pointerX:0,pointerY:0,aspectRatio:1};function xce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function wce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=ls(e);let a={controlDirection:HA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...b4},b={...Ece};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:HA(u)};let x,_=null,k=[],N,T,S,R=!1;const I=CP().on("start",D=>{const{nodeLookup:U,transform:W,snapGrid:M,snapToGrid:$,nodeOrigin:C,paneDomNode:j}=n();if(x=U.get(t),!x)return;_=(j==null?void 0:j.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:P}=Qd(D.sourceEvent,{transform:W,snapGrid:M,snapToGrid:$,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:L,pointerY:P,aspectRatio:y.width/y.height},N=void 0,T=fl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=U.get(x.parentId)),N&&x.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[A,z]of U)if(z.parentId===t&&(k.push({id:A,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const G=xce(z,x,z.origin??C);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,{...y})}).on("drag",D=>{const{transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$}=n(),C=Qd(D.sourceEvent,{transform:U,snapGrid:W,snapToGrid:M,containerBounds:_}),j=[];if(!x)return;const{x:L,y:P,width:A,height:z}=y,G={},B=x.origin??$,{width:re,height:Q,x:se,y:de}=bce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,B,T,S),te=re!==A,pe=Q!==z,ne=se!==L&&te,ye=de!==P&&pe;if(!ne&&!ye&&!te&&!pe)return;if((ne||ye||B[0]===1||B[1]===1)&&(G.x=ne?se:y.x,G.y=ye?de:y.y,y.x=G.x,y.y=G.y,k.length>0)){const ke=se-L,Ae=de-P;for(const He of k)He.position={x:He.position.x-ke+B[0]*(re-A),y:He.position.y-Ae+B[1]*(Q-z)},j.push(He)}if((te||pe)&&(G.width=te&&(!a.resizeDirection||a.resizeDirection==="horizontal")?re:y.width,G.height=pe&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:y.height,y.width=G.width,y.height=G.height),N&&x.expandParent){const ke=B[0]*(G.width??0);G.x&&G.x{R&&(g==null||g(D,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var E4={exports:{}},x4={},w4={exports:{}},v4={};/** - * @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 ou=E;function vce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _ce=typeof Object.is=="function"?Object.is:vce,kce=ou.useState,Nce=ou.useEffect,Sce=ou.useLayoutEffect,Tce=ou.useDebugValue;function Ace(e,t){var n=t(),r=kce({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Sce(function(){s.value=n,s.getSnapshot=t,Ob(s)&&i({inst:s})},[e,n,t]),Nce(function(){return Ob(s)&&i({inst:s}),e(function(){Ob(s)&&i({inst:s})})},[e]),Tce(n),n}function Ob(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_ce(e,n)}catch{return!0}}function Cce(e,t){return t()}var Ice=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cce:Ace;v4.useSyncExternalStore=ou.useSyncExternalStore!==void 0?ou.useSyncExternalStore:Ice;w4.exports=v4;var Rce=w4.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 P0=E,Oce=Rce;function Lce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mce=typeof Object.is=="function"?Object.is:Lce,jce=Oce.useSyncExternalStore,Dce=P0.useRef,Pce=P0.useEffect,Bce=P0.useMemo,Fce=P0.useDebugValue;x4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Dce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Bce(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,Mce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=jce(e,i[0],i[1]);return Pce(function(){a.hasValue=!0,a.value=l},[l]),Fce(l),l};E4.exports=x4;var Uce=E4.exports;const $ce=Wf(Uce),Hce={},VA=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:()=>{(Hce?"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},zce=e=>e?VA(e):VA,{useDebugValue:Vce}=kt,{useSyncExternalStoreWithSelector:Kce}=$ce,Yce=e=>e;function _4(e,t=Yce,n){const r=Kce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Vce(r),r}const KA=(e,t)=>{const n=zce(e),r=(s,i=t)=>_4(n,s,i);return Object.assign(r,n),r},Wce=(e,t)=>e?KA(e,t):KA;function xn(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 B0=E.createContext(null),Gce=B0.Provider,k4=bi.error001("react");function Ot(e,t){const n=E.useContext(B0);if(n===null)throw new Error(k4);return _4(n,e,t)}function wn(){const e=E.useContext(B0);if(e===null)throw new Error(k4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const YA={display:"none"},qce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},N4="react-flow__node-desc",S4="react-flow__edge-desc",Xce="react-flow__aria-live",Qce=e=>e.ariaLiveMessage,Zce=e=>e.ariaLabelConfig;function Jce({rfId:e}){const t=Ot(Qce);return o.jsx("div",{id:`${Xce}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:qce,children:t})}function eue({rfId:e,disableKeyboardA11y:t}){const n=Ot(Zce);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${N4}-${e}`,style:YA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${S4}-${e}`,style:YA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Jce,{rfId:e})]})}const F0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:Zn(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});F0.displayName="Panel";function tue({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(F0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const nue=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}},Rp=e=>e.id;function rue(e,t){return xn(e.selectedNodes.map(Rp),t.selectedNodes.map(Rp))&&xn(e.selectedEdges.map(Rp),t.selectedEdges.map(Rp))}function sue({onSelectionChange:e}){const t=wn(),{selectedNodes:n,selectedEdges:r}=Ot(nue,rue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const iue=e=>!!e.onSelectionChangeHandlers;function aue({onSelectionChange:e}){const t=Ot(iue);return e||t?o.jsx(sue,{onSelectionChange:e}):null}const T4=[0,0],oue={x:0,y:0,zoom:1},lue=["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"],WA=[...lue,"rfId"],cue=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}),GA={translateExtent:Ff,nodeOrigin:T4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function uue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Ot(cue,xn),u=wn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=GA,l()}),[]);const d=E.useRef(GA);return E.useEffect(()=>{for(const f of WA){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:Mle(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},WA.map(f=>e[f])),null}function qA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function due(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=qA(),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=qA())!=null&&r.matches?"dark":"light"}const XA=typeof document<"u"?document:null;function zf(e=null,t={target:XA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.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 E.useEffect(()=>{const c=(t==null?void 0:t.target)??XA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&n4(p))return!1;const g=ZA(p.code,l);if(i.current.add(p[g]),QA(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=ZA(p.code,l);QA(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 QA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function ZA(e,t){return t.includes(e)?"code":"key"}const fue=()=>{const e=wn();return E.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:l}=e.getState(),c=x_(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return _u(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=iu(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function A4(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 l={...i};for(const c of a)hue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function hue(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 C4(e,t){return A4(e,t)}function I4(e,t){return A4(e,t)}function Oo(e,t){return{id:e,type:"select",selected:t}}function uc(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(Oo(i.id,a)))}return r}function JA({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 eC(e){return{id:e.id,type:"remove"}}const pue=JP();function R4(e,t,n={}){return Ule(e,t,{...n,onError:n.onError??pue})}const tC=e=>Nle(e),mue=e=>qP(e);function O4(e){return E.forwardRef(e)}const gue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function nC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>yue(()=>n(s=>s+BigInt(1))));return gue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function yue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const L4=E.createContext(null);function bue({children:e}){const t=wn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=JA({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=nC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(JA({items:p,lookup:h}))},[]),i=nC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(L4.Provider,{value:a,children:e})}function Eue(){const e=E.useContext(L4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const xue=e=>!!e.panZoom;function U0(){const e=fue(),t=wn(),n=Eue(),r=Ot(xue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=tC(f)?f:h.get(f.id),g=m.parentId?e4(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return su(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&tC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&mue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Ile({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),T=N.length>0,S=k.length>0;if(T){const R=N.map(eC);w==null||w(N),b(R)}if(S){const R=k.map(eC);g==null||g(k),y(R)}return(S||T)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=RA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=su(w?y:b),_=$f(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=RA(f)?f:c(f);if(!g)return!1;const w=$f(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Sle(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??Lle();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const rC=e=>e.selected,wue=typeof window<"u"?window:void 0;function vue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=wn(),{deleteElements:r}=U0(),s=zf(e,{actInsideInputWithModifier:!1}),i=zf(t,{target:wue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(rC),edges:a.filter(rC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function _ue(e){const t=wn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=v_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",bi.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 $0={position:"absolute",width:"100%",height:"100%",top:0,left:0},kue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Nue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Jo.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=wn(),N=E.useRef(null),{userSelectionActive:T,lib:S,connectionInProgress:R}=Ot(kue,xn),I=zf(h),D=E.useRef();_ue(N);const U=E.useCallback(W=>{y==null||y({x:W[0],y:W[1],zoom:W[2]}),b||k.setState({transform:W})},[y,b]);return E.useEffect(()=>{if(N.current){D.current=gce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(j=>j.paneDragging===C?j:{paneDragging:C}),onPanZoomStart:(C,j)=>{const{onViewportChangeStart:L,onMoveStart:P}=k.getState();P==null||P(C,j),L==null||L(j)},onPanZoom:(C,j)=>{const{onViewportChange:L,onMove:P}=k.getState();P==null||P(C,j),L==null||L(j)},onPanZoomEnd:(C,j)=>{const{onViewportChangeEnd:L,onMoveEnd:P}=k.getState();P==null||P(C,j),L==null||L(j)}});const{x:W,y:M,zoom:$}=D.current.getViewport();return k.setState({panZoom:D.current,transform:[W,M,$],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=D.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var W;(W=D.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:T,noWheelClassName:g,lib:S,onTransformChange:U,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,T,g,S,U,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:$0,children:m})}const Sue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Tue(){const{userSelectionActive:e,userSelectionRect:t}=Ot(Sue,xn);return e&&t?o.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 Lb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Aue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Cue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Uf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=wn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:T}=Ot(Aue,xn),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),D=E.useRef(new Set),U=E.useRef(new Set),W=E.useRef(!1),M=E.useRef({x:0,y:0}),$=E.useRef(!1),C=te=>{if(W.current||k){W.current=!1;return}u==null||u(te),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},j=te=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){te.preventDefault();return}d==null||d(te)},L=f?te=>f(te):void 0,P=te=>{W.current&&(te.stopPropagation(),W.current=!1)},A=te=>{var He,Ce;const{domNode:pe,transform:ne}=y.getState();if(I.current=pe==null?void 0:pe.getBoundingClientRect(),!I.current)return;const ye=te.target===R.current;if(!ye&&!!te.target.closest(".nokey")||!e||!(a&&ye||t)||te.button!==0||!te.isPrimary)return;(Ce=(He=te.target)==null?void 0:He.setPointerCapture)==null||Ce.call(He,te.pointerId),W.current=!1;const{x:xe,y:ke}=di(te.nativeEvent,I.current),Ae=_u({x:xe,y:ke},ne);y.setState({userSelectionRect:{width:0,height:0,startX:Ae.x,startY:Ae.y,x:xe,y:ke}}),ye||(te.stopPropagation(),te.preventDefault())};function z(te,pe){const{userSelectionRect:ne}=y.getState();if(!ne)return;const{transform:ye,nodeLookup:ge,edgeLookup:be,connectionLookup:xe,triggerNodeChanges:ke,triggerEdgeChanges:Ae,defaultEdgeOptions:He}=y.getState(),Ce={x:ne.startX,y:ne.startY},{x:gt,y:Ge}=iu(Ce,ye),ze={startX:Ce.x,startY:Ce.y,x:teft.id)),U.current=new Set;const ut=(He==null?void 0:He.selectable)??!0;for(const ft of D.current){const X=xe.get(ft);if(X)for(const{edgeId:ee}of X.values()){const me=be.get(ee);me&&(me.selectable??ut)&&U.current.add(ee)}}if(!OA(le,D.current)){const ft=uc(ge,D.current,!0);ke(ft)}if(!OA(Ee,U.current)){const ft=uc(be,U.current);Ae(ft)}y.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!s||!I.current)return;const[te,pe]=E_(M.current,I.current,T);N({x:te,y:pe}).then(ne=>{if(!W.current||!ne){w.current=requestAnimationFrame(G);return}const{x:ye,y:ge}=M.current;z(ye,ge),w.current=requestAnimationFrame(G)})}const B=()=>{cancelAnimationFrame(w.current),w.current=0,$.current=!1};E.useEffect(()=>()=>B(),[]);const re=te=>{const{userSelectionRect:pe,transform:ne,resetSelectedElements:ye}=y.getState();if(!I.current||!pe)return;const{x:ge,y:be}=di(te.nativeEvent,I.current);M.current={x:ge,y:be};const xe=iu({x:pe.startX,y:pe.startY},ne);if(!W.current){const ke=t?0:i;if(Math.hypot(ge-xe.x,be-xe.y)<=ke)return;ye(),l==null||l(te)}W.current=!0,$.current||(G(),$.current=!0),z(ge,be)},Q=te=>{var pe,ne;te.button===0&&((ne=(pe=te.target)==null?void 0:pe.releasePointerCapture)==null||ne.call(pe,te.pointerId),!b&&te.target===R.current&&y.getState().userSelectionRect&&(C==null||C(te)),y.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(c==null||c(te),y.setState({nodesSelectionActive:D.current.size>0})),B())},se=te=>{var pe,ne;(ne=(pe=te.target)==null?void 0:pe.releasePointerCapture)==null||ne.call(pe,te.pointerId),B()},de=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:Zn(["react-flow__pane",{draggable:de,dragging:_,selection:e}]),onClick:S?void 0:Lb(C,R),onContextMenu:Lb(j,R),onWheel:Lb(L,R),onPointerEnter:S?void 0:h,onPointerMove:S?re:p,onPointerUp:S?Q:void 0,onPointerCancel:S?se:void 0,onPointerDownCapture:S?A:void 0,onClickCapture:S?P:void 0,onPointerLeave:m,ref:R,style:$0,children:[g,o.jsx(Tue,{})]})}function Ex({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",bi.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 M4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=wn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=nce({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Ex({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 Iue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function j4(){const e=wn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Iue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=Eh(b,i));const{position:x,positionAbsolute:_}=XP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const A_=E.createContext(null),Rue=A_.Provider;A_.Consumer;const D4=()=>E.useContext(A_),Oue=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Lue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===tu.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Mue({type:e="source",position:t=Fe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var $,C;const m=a||null,g=e==="target",w=wn(),y=D4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Ot(Oue,xn),{connectingFrom:k,connectingTo:N,clickConnecting:T,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:D}=Ot(Lue(y,m,e),xn);y||(C=($=w.getState()).onError)==null||C.call($,"010",bi.error010());const U=j=>{const{defaultEdgeOptions:L,onConnect:P,hasDefaultEdges:A}=w.getState(),z={...L,...j};if(A){const{edges:G,setEdges:B,onError:re}=w.getState();B(R4(z,G,{onError:re}))}P==null||P(z),l==null||l(z)},W=j=>{if(!y)return;const L=r4(j.nativeEvent);if(s&&(L&&j.button===0||!L)){const P=w.getState();bx.onPointerDown(j.nativeEvent,{handleDomNode:j.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:g,handleId:m,nodeId:y,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:(...A)=>{var z,G;return(G=(z=w.getState()).onConnectEnd)==null?void 0:G.call(z,...A)},updateConnection:P.updateConnection,onConnect:U,isValidConnection:n||((...A)=>{var z,G;return((G=(z=w.getState()).isValidConnection)==null?void 0:G.call(z,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}L?d==null||d(j):f==null||f(j)},M=j=>{const{onClickConnectStart:L,onClickConnectEnd:P,connectionClickStartHandle:A,connectionMode:z,isValidConnection:G,lib:B,rfId:re,nodeLookup:Q,connection:se}=w.getState();if(!y||!A&&!s)return;if(!A){L==null||L(j.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const de=t4(j.target),te=n||G,{connection:pe,isValid:ne}=bx.isValid(j.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:z,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:te,flowId:re,doc:de,lib:B,nodeLookup:Q});ne&&pe&&U(pe);const ye=structuredClone(se);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,P==null||P(j,ye),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:Zn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:k,connectingto:N,valid:D,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:W,onTouchStart:W,onClick:b?M:void 0,ref:p,...h,children:c})}const kr=E.memo(O4(Mue));function jue({data:e,isConnectable:t,sourcePosition:n=Fe.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(kr,{type:"source",position:n,isConnectable:t})]})}function Due({data:e,isConnectable:t,targetPosition:n=Fe.Top,sourcePosition:r=Fe.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(kr,{type:"source",position:r,isConnectable:t})]})}function Pue(){return null}function Bue({data:e,isConnectable:t,targetPosition:n=Fe.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(kr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ng={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},sC={input:jue,default:Due,output:Bue,group:Pue};function Fue(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 Uue=e=>{const{width:t,height:n,x:r,y:s}=bh(e.nodeLookup,{filter:i=>!!i.selected});return{width:ui(t)?t:null,height:ui(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 $ue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=wn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Ot(Uue,xn),c=j4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(M4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Ng,p.key)&&(p.preventDefault(),c({direction:Ng[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:Zn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 iC=typeof window<"u"?window:void 0,Hue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function P4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:D,minZoom:U,maxZoom:W,preventScrolling:M,onSelectionContextMenu:$,noWheelClassName:C,noPanClassName:j,disableKeyboardA11y:L,onViewportChange:P,isControlledViewport:A}){const{nodesSelectionActive:z,userSelectionActive:G}=Ot(Hue,xn),B=zf(u,{target:iC}),re=zf(g,{target:iC}),Q=re||S,se=re||_,de=d&&Q!==!0,te=B||G||de;return vue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(Nue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:se,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!B&&Q,defaultViewport:I,translateExtent:D,minZoom:U,maxZoom:W,zoomActivationKeyCode:w,preventScrolling:M,noWheelClassName:C,noPanClassName:j,onViewportChange:P,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:de,children:o.jsxs(Cue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:R,isSelecting:!!te,selectionMode:f,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:de,children:[e,z&&o.jsx($ue,{onSelectionContextMenu:$,noPanClassName:j,disableKeyboardA11y:L})]})})}P4.displayName="FlowRenderer";const zue=E.memo(P4),Vue=e=>t=>e?b_(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 Kue(e){return Ot(E.useCallback(Vue(e),[e]),xn)}const Yue=e=>e.updateNodeInternals;function Wue(){const e=Ot(Yue),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Gue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=wn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 que({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Ot(te=>{const pe=te.nodeLookup.get(e),ne=te.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:ne}},xn);let N=x.type||"default",T=(w==null?void 0:w[N])||sC[N];T===void 0&&(b==null||b("003",bi.error003(N)),N="default",T=(w==null?void 0:w.default)||sC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),D=!!(x.focusable||d&&typeof x.focusable>"u"),U=wn(),W=w_(x),M=Gue({node:x,nodeType:N,hasDimensions:W,resizeObserver:f}),$=M4({nodeRef:M,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=j4();if(x.hidden)return null;const j=Ea(x),L=Fue(x),P=R||S||t||n||r||s,A=n?te=>n(te,{..._.userNode}):void 0,z=r?te=>r(te,{..._.userNode}):void 0,G=s?te=>s(te,{..._.userNode}):void 0,B=i?te=>i(te,{..._.userNode}):void 0,re=a?te=>a(te,{..._.userNode}):void 0,Q=te=>{const{selectNodesOnDrag:pe,nodeDragThreshold:ne}=U.getState();R&&(!pe||!S||ne>0)&&Ex({id:e,store:U,nodeRef:M}),t&&t(te,{..._.userNode})},se=te=>{if(!(n4(te.nativeEvent)||m)){if(KP.includes(te.key)&&R){const pe=te.key==="Escape";Ex({id:e,store:U,unselect:pe,nodeRef:M})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(Ng,te.key)){te.preventDefault();const{ariaLabelConfig:pe}=U.getState();U.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Ng[te.key],factor:te.shiftKey?4:1})}}},de=()=>{var xe;if(m||!((xe=M.current)!=null&&xe.matches(":focus-visible")))return;const{transform:te,width:pe,height:ne,autoPanOnNodeFocus:ye,setCenter:ge}=U.getState();if(!ye)return;b_(new Map([[e,x]]),{x:0,y:0,width:pe,height:ne},te,!0).length>0||ge(x.position.x+j.width/2,x.position.y+j.height/2,{zoom:te[2]})};return o.jsx("div",{className:Zn(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:$}]),ref:M,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:W?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:z,onMouseLeave:G,onContextMenu:B,onClick:Q,onDoubleClick:re,onKeyDown:D?se:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:x.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${N4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(Rue,{value:e,children:o.jsx(T,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:$,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...j})})})}var Xue=E.memo(que);const Que=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function B4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Ot(Que,xn),a=Kue(e.onlyRenderVisibleElements),l=Wue();return o.jsx("div",{className:"react-flow__nodes",style:$0,children:a.map(c=>o.jsx(Xue,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}B4.displayName="NodeRenderer";const Zue=E.memo(B4);function Jue(e){return Ot(E.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&&Ple({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),xn)}const ede=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},tde=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},aC={[nu.Arrow]:ede,[nu.ArrowClosed]:tde};function nde(e){const t=wn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(aC,e)?aC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",bi.error009(e)),null)},[e])}const rde=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=nde(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},F4=({defaultColor:e,rfId:t})=>{const n=Ot(i=>i.edges),r=Ot(i=>i.defaultEdgeOptions),s=E.useMemo(()=>Kle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(rde,{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};F4.displayName="MarkerDefinitions";var sde=E.memo(F4);function U4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=Zn(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}U4.displayName="EdgeText";const ide=E.memo(U4);function xh({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:Zn(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ui(t)&&ui(n)?o.jsx(ide,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function oC({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 $4({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:s,targetPosition:i=Fe.Top}){const[a,l]=oC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=oC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=s4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function H4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=$4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(xh,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const ade=H4({isInternal:!1}),z4=H4({isInternal:!0});ade.displayName="SimpleBezierEdge";z4.displayName="SimpleBezierEdgeInternal";function V4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Fe.Bottom,targetPosition:m=Fe.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=kg({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(xh,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const K4=V4({isInternal:!1}),Y4=V4({isInternal:!0});K4.displayName="SmoothStepEdge";Y4.displayName="SmoothStepEdgeInternal";function W4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(K4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const ode=W4({isInternal:!1}),G4=W4({isInternal:!0});ode.displayName="StepEdge";G4.displayName="StepEdgeInternal";function q4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=o4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(xh,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const lde=q4({isInternal:!1}),X4=q4({isInternal:!0});lde.displayName="StraightEdge";X4.displayName="StraightEdgeInternal";function Q4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=Fe.Bottom,targetPosition:l=Fe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=i4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(xh,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const cde=Q4({isInternal:!1}),Z4=Q4({isInternal:!0});cde.displayName="BezierEdge";Z4.displayName="BezierEdgeInternal";const lC={default:Z4,straight:X4,step:G4,smoothstep:Y4,simplebezier:z4},cC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ude=(e,t,n)=>n===Fe.Left?e-t:n===Fe.Right?e+t:e,dde=(e,t,n)=>n===Fe.Top?e-t:n===Fe.Bottom?e+t:e,uC="react-flow__edgeupdater";function dC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Zn([uC,`${uC}-${l}`]),cx:ude(t,r,e),cy:dde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function fde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=wn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:D,cancelConnection:U,nodeLookup:W,rfId:M,panBy:$,updateConnection:C}=m.getState(),j=k.type==="target",L=(z,G)=>{h(!1),f==null||f(z,n,k.type,G)},P=z=>u==null?void 0:u(n,z),A=(z,G)=>{h(!0),d==null||d(_,n,k.type),D==null||D(z,G)};bx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:T,handleId:k.id,nodeId:k.nodeId,nodeLookup:W,isTarget:j,edgeUpdaterType:k.type,lib:I,flowId:M,cancelConnection:U,panBy:$,isValidConnection:(...z)=>{var G,B;return((B=(G=m.getState()).isValidConnection)==null?void 0:B.call(G,...z))??!0},onConnect:P,onConnectStart:A,onConnectEnd:(...z)=>{var G,B;return(B=(G=m.getState()).onConnectEnd)==null?void 0:B.call(G,...z)},onReconnectEnd:L,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(dC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(dC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function hde({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Ot(ge=>ge.edgeLookup.get(e));const _=Ot(ge=>ge.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||lC[k];N===void 0&&(y==null||y("011",bi.error011(k)),k="default",N=(g==null?void 0:g.default)||lC.default);const T=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[D,U]=E.useState(!1),[W,M]=E.useState(!1),$=wn(),{zIndex:C,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G}=Ot(E.useCallback(ge=>{const be=ge.nodeLookup.get(x.source),xe=ge.nodeLookup.get(x.target);if(!be||!xe)return{zIndex:x.zIndex,...cC};const ke=Vle({id:e,sourceNode:be,targetNode:xe,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:y});return{zIndex:Dle({selected:x.selected,zIndex:x.zIndex,sourceNode:be,targetNode:xe,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...ke||cC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),xn),B=E.useMemo(()=>x.markerStart?`url('#${gx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),re=E.useMemo(()=>x.markerEnd?`url('#${gx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||j===null||L===null||P===null||A===null)return null;const Q=ge=>{var Ae;const{addSelectedEdges:be,unselectNodesAndEdges:xe,multiSelectionActive:ke}=$.getState();R&&($.setState({nodesSelectionActive:!1}),x.selected&&ke?(xe({nodes:[],edges:[x]}),(Ae=I.current)==null||Ae.blur()):be([e])),s&&s(ge,x)},se=i?ge=>{i(ge,{...x})}:void 0,de=a?ge=>{a(ge,{...x})}:void 0,te=l?ge=>{l(ge,{...x})}:void 0,pe=c?ge=>{c(ge,{...x})}:void 0,ne=u?ge=>{u(ge,{...x})}:void 0,ye=ge=>{var be;if(!b&&KP.includes(ge.key)&&R){const{unselectNodesAndEdges:xe,addSelectedEdges:ke}=$.getState();ge.key==="Escape"?((be=I.current)==null||be.blur(),xe({edges:[x]})):ke([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:Zn(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:D,selectable:R}]),onClick:Q,onDoubleClick:se,onContextMenu:de,onMouseEnter:te,onMouseMove:pe,onMouseLeave:ne,onKeyDown:T?ye:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${S4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!W&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:B,markerEnd:re,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(fde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:j,sourceY:L,targetX:P,targetY:A,sourcePosition:z,targetPosition:G,setUpdateHover:U,setReconnecting:M})]})})}var pde=E.memo(hde);const mde=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function J4({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Ot(mde,xn),_=Jue(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(sde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(pde,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}J4.displayName="EdgeRenderer";const gde=E.memo(J4),yde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bde({children:e}){const t=Ot(yde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Ede(e){const t=U0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const xde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function wde(e){const t=Ot(xde),n=wn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function vde(e){return e.connection.inProgress?{...e.connection,to:_u(e.connection.to,e.transform)}:{...e.connection}}function _de(e){return vde}function kde(e){const t=_de();return Ot(t,xn)}const Nde=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Sde({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Ot(Nde,xn);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:Zn(["react-flow__connection",GP(l)]),children:o.jsx(e6,{style:t,type:n,CustomComponent:r,isValid:l})})})}const e6=({style:e,type:t=za.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=kde();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:GP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case za.Bezier:[m]=i4(g);break;case za.SimpleBezier:[m]=$4(g);break;case za.Step:[m]=kg({...g,borderRadius:0});break;case za.SmoothStep:[m]=kg(g);break;default:[m]=o4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};e6.displayName="ConnectionLine";const Tde={};function fC(e=Tde){E.useRef(e),wn(),E.useEffect(()=>{},[e])}function Ade(){wn(),E.useRef(!1),E.useEffect(()=>{},[])}function t6({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:D,translateExtent:U,minZoom:W,maxZoom:M,preventScrolling:$,defaultMarkerColor:C,zoomOnScroll:j,zoomOnPinch:L,panOnScroll:P,panOnScrollSpeed:A,panOnScrollMode:z,zoomOnDoubleClick:G,panOnDrag:B,autoPanOnSelection:re,onPaneClick:Q,onPaneMouseEnter:se,onPaneMouseMove:de,onPaneMouseLeave:te,onPaneScroll:pe,onPaneContextMenu:ne,paneClickDistance:ye,nodeClickDistance:ge,onEdgeContextMenu:be,onEdgeMouseEnter:xe,onEdgeMouseMove:ke,onEdgeMouseLeave:Ae,reconnectRadius:He,onReconnect:Ce,onReconnectStart:gt,onReconnectEnd:Ge,noDragClassName:ze,noWheelClassName:le,noPanClassName:Ee,disableKeyboardA11y:ut,nodeExtent:ft,rfId:X,viewport:ee,onViewportChange:me}){return fC(e),fC(t),Ade(),Ede(n),wde(ee),o.jsx(zue,{onPaneClick:Q,onPaneMouseEnter:se,onPaneMouseMove:de,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:pe,paneClickDistance:ye,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:j,zoomOnPinch:L,zoomOnDoubleClick:G,panOnScroll:P,panOnScrollSpeed:A,panOnScrollMode:z,panOnDrag:B,autoPanOnSelection:re,defaultViewport:D,translateExtent:U,minZoom:W,maxZoom:M,onSelectionContextMenu:f,preventScrolling:$,noDragClassName:ze,noWheelClassName:le,noPanClassName:Ee,disableKeyboardA11y:ut,onViewportChange:me,isControlledViewport:!!ee,children:o.jsxs(bde,{children:[o.jsx(gde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Ce,onReconnectStart:gt,onReconnectEnd:Ge,onlyRenderVisibleElements:R,onEdgeContextMenu:be,onEdgeMouseEnter:xe,onEdgeMouseMove:ke,onEdgeMouseLeave:Ae,reconnectRadius:He,defaultMarkerColor:C,noPanClassName:Ee,disableKeyboardA11y:ut,rfId:X}),o.jsx(Sde,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(Zue,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:Ee,noDragClassName:ze,disableKeyboardA11y:ut,nodeExtent:ft,rfId:X}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}t6.displayName="GraphView";const Cde=E.memo(t6),Ide=JP(),hC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Ff;u4(g,w,y);const{nodesInitialized:k}=yx(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const T=bh(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:R,zoom:I}=x_(T,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Ff,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:tu.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...WP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ide,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:YP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Rde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Wce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:T}=m();y&&(await Cle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:T},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...hC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:T}=m(),{nodesInitialized:S,hasSelectedNodes:R}=yx(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=T&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();u4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:T,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:D}=Zle(w,b,x,_,k,N,R);D&&(Gle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const D=_.get(R),U=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(I!=null&&I.position)),W={id:R,type:"position",position:U?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(D&&N.inProgress&&N.fromNode.id===D.id){const M=hl(D,N.fromHandle,Fe.Left,!0);T({...N,from:M})}U&&D.parentId&&b.push({id:R,parentId:D.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(W)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),D=T_(b,_,R,I);x.push(...D)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=C4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=I4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Oo(T,!0));_(N);return}_(uc(x,new Set([...w]),!0)),k(uc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Oo(T,!0));k(N);return}k(uc(b,new Set([...w]))),_(uc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),T=w||x,S=y||b,R=[];for(const D of T){if(!D.selected)continue;const U=_.get(D.id);U&&(U.selected=!1),R.push(Oo(D.id,!1))}const I=[];for(const D of S)D.selected&&I.push(Oo(D.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((T,S)=>S.selected?[...T,Oo(S.id,!1)]:T,[]),N=w.reduce((T,S)=>S.selected?[...T,Oo(S.id,!1)]:T,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:T}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(yx(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:T}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return Jle({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const T=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*T,y:_/2-y*T,zoom:T},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...WP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...hC()})}},Object.is);function C_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>Rde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Gce,{value:m,children:o.jsx(bue,{children:p})})}function Ode({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(B0)?o.jsx(o.Fragment,{children:e}):o.jsx(C_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Lde={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Mde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:D,onDelete:U,onSelectionChange:W,onSelectionDragStart:M,onSelectionDrag:$,onSelectionDragStop:C,onSelectionContextMenu:j,onSelectionStart:L,onSelectionEnd:P,onBeforeDelete:A,connectionMode:z,connectionLineType:G=za.Bezier,connectionLineStyle:B,connectionLineComponent:re,connectionLineContainerStyle:Q,deleteKeyCode:se="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:te=!1,selectionMode:pe=Uf.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ye=Hf()?"Meta":"Control",zoomActivationKeyCode:ge=Hf()?"Meta":"Control",snapToGrid:be,snapGrid:xe,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ae,nodesDraggable:He,autoPanOnNodeFocus:Ce,nodesConnectable:gt,nodesFocusable:Ge,nodeOrigin:ze=T4,edgesFocusable:le,edgesReconnectable:Ee,elementsSelectable:ut=!0,defaultViewport:ft=oue,minZoom:X=.5,maxZoom:ee=2,translateExtent:me=Ff,preventScrolling:Le=!0,nodeExtent:Ye,defaultMarkerColor:Ze="#b1b1b7",zoomOnScroll:Pt=!0,zoomOnPinch:bt=!0,panOnScroll:Bt=!1,panOnScrollSpeed:zt=.5,panOnScrollMode:Nt=Jo.Free,zoomOnDoubleClick:Ut=!0,panOnDrag:Be=!0,onPaneClick:pt,onPaneMouseEnter:Je,onPaneMouseMove:Re,onPaneMouseLeave:It,onPaneScroll:St,onPaneContextMenu:ce,paneClickDistance:Ve=1,nodeClickDistance:at=0,children:rn,onReconnect:sn,onReconnectStart:fn,onReconnectEnd:Wt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Vn,onEdgeMouseMove:Kn,onEdgeMouseLeave:vt,reconnectRadius:an=10,onNodesChange:ue,onEdgesChange:Se,noDragClassName:ve="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ot="nopan",fitView:et,fitViewOptions:lt,connectOnClick:Vt,attributionPosition:Kt,proOptions:J,defaultEdgeOptions:rt,elevateNodesOnSelect:Ue=!0,elevateEdgesOnSelect:qe=!1,disableKeyboardA11y:Xe=!1,autoPanOnConnect:Rt,autoPanOnNodeDrag:Yn,autoPanOnSelection:Wn=!0,autoPanSpeed:en,connectionRadius:vn,isValidConnection:Yt,onError:_n,style:kn,id:Mt,nodeDragThreshold:Nn,connectionDragThreshold:mr,viewport:Lt,onViewportChange:jn,width:lr,height:gr,colorMode:Ar="light",debug:Ks,onScroll:Hr,ariaLabelConfig:ns,zIndexMode:Ys="basic",...Es},Vi){const Cr=Mt||"1",Ki=due(Ar),xa=E.useCallback(vi=>{vi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Hr==null||Hr(vi)},[Hr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Es,onScroll:xa,style:{...kn,...Lde},ref:Vi,className:Zn(["react-flow",s,Ki]),id:Mt,role:"application",children:o.jsxs(Ode,{nodes:e,edges:t,width:lr,height:gr,fitView:et,fitViewOptions:lt,minZoom:X,maxZoom:ee,nodeOrigin:ze,nodeExtent:Ye,zIndexMode:Ys,children:[o.jsx(uue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:He,autoPanOnNodeFocus:Ce,nodesConnectable:gt,nodesFocusable:Ge,edgesFocusable:le,edgesReconnectable:Ee,elementsSelectable:ut,elevateNodesOnSelect:Ue,elevateEdgesOnSelect:qe,minZoom:X,maxZoom:ee,nodeExtent:Ye,onNodesChange:ue,onEdgesChange:Se,snapToGrid:be,snapGrid:xe,connectionMode:z,translateExtent:me,connectOnClick:Vt,defaultEdgeOptions:rt,fitView:et,fitViewOptions:lt,onNodesDelete:I,onEdgesDelete:D,onDelete:U,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:$,onSelectionDragStart:M,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ot,nodeOrigin:ze,rfId:Cr,autoPanOnConnect:Rt,autoPanOnNodeDrag:Yn,autoPanSpeed:en,onError:_n,connectionRadius:vn,isValidConnection:Yt,selectNodesOnDrag:Ae,nodeDragThreshold:Nn,connectionDragThreshold:mr,onBeforeDelete:A,debug:Ks,ariaLabelConfig:ns,zIndexMode:Ys}),o.jsx(Cde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:G,connectionLineStyle:B,connectionLineComponent:re,connectionLineContainerStyle:Q,selectionKeyCode:de,selectionOnDrag:te,selectionMode:pe,deleteKeyCode:se,multiSelectionKeyCode:ye,panActivationKeyCode:ne,zoomActivationKeyCode:ge,onlyRenderVisibleElements:ke,defaultViewport:ft,translateExtent:me,minZoom:X,maxZoom:ee,preventScrolling:Le,zoomOnScroll:Pt,zoomOnPinch:bt,zoomOnDoubleClick:Ut,panOnScroll:Bt,panOnScrollSpeed:zt,panOnScrollMode:Nt,panOnDrag:Be,autoPanOnSelection:Wn,onPaneClick:pt,onPaneMouseEnter:Je,onPaneMouseMove:Re,onPaneMouseLeave:It,onPaneScroll:St,onPaneContextMenu:ce,paneClickDistance:Ve,nodeClickDistance:at,onSelectionContextMenu:j,onSelectionStart:L,onSelectionEnd:P,onReconnect:sn,onReconnectStart:fn,onReconnectEnd:Wt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:Vn,onEdgeMouseMove:Kn,onEdgeMouseLeave:vt,reconnectRadius:an,defaultMarkerColor:Ze,noDragClassName:ve,noWheelClassName:Qe,noPanClassName:ot,rfId:Cr,disableKeyboardA11y:Xe,nodeExtent:Ye,viewport:Lt,onViewportChange:jn}),o.jsx(aue,{onSelectionChange:W}),rn,o.jsx(tue,{proOptions:J,position:Kt}),o.jsx(eue,{rfId:Cr,disableKeyboardA11y:Xe})]})})}var n6=O4(Mde);const jde=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Dde({children:e}){const t=Ot(jde);return t?ps.createPortal(e,t):null}function r6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>C4(s,i)),[]);return[t,n,r]}function s6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>I4(s,i)),[]);return[t,n,r]}const Pde=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||!w_(n.userNode))return!1;return!0};function Bde(e={includeHiddenNodes:!1}){return Ot(Pde(e))}function Fde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Zn(["react-flow__background-pattern",n,r])})}function Ude({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:Zn(["react-flow__background-pattern","dots",t])})}var so;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(so||(so={}));const $de={[so.Dots]:1,[so.Lines]:1,[so.Cross]:6},Hde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function i6({id:e,variant:t=so.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Ot(Hde,xn),m=r||$de[t],g=t===so.Dots,w=t===so.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:Zn(["react-flow__background",u]),style:{...c,...$0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Ude,{radius:x/2,className:d}):o.jsx(Fde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}i6.displayName="Background";const a6=E.memo(i6);function zde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Vde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Kde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Yde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Wde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Op({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:Zn(["react-flow__controls-button",t]),...n,children:e})}const Gde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function o6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=wn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Ot(Gde,xn),{zoomIn:x,zoomOut:_,fitView:k}=U0(),N=()=>{x(),i==null||i()},T=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs(F0,{className:Zn(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Op,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(zde,{})}),o.jsx(Op,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(Vde,{})})]}),n&&o.jsx(Op,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(Kde,{})}),r&&o.jsx(Op,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Wde,{}):o.jsx(Yde,{})}),d]})}o6.displayName="Controls";const l6=E.memo(o6);function qde({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:Zn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Xde=E.memo(qde),Qde=e=>e.nodes.map(t=>t.id),Mb=e=>e instanceof Function?e:()=>e;function Zde({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=Xde,onClick:a}){const l=Ot(Qde,xn),c=Mb(t),u=Mb(e),d=Mb(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(efe,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function Jde({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Ot(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=Ea(w);return{node:w,x:y,y:b,width:x,height:_}},xn);return!u||u.hidden||!w_(u)?null:o.jsx(l,{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 efe=E.memo(Jde);var tfe=E.memo(Zde);const nfe=200,rfe=150,sfe=e=>!e.hidden,ife=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?ZP(bh(e.nodeLookup,{filter:sfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},afe="react-flow__minimap-desc";function c6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=wn(),N=E.useRef(null),{boundingRect:T,viewBB:S,rfId:R,panZoom:I,translateExtent:D,flowWidth:U,flowHeight:W,ariaLabelConfig:M}=Ot(ife,xn),$=(e==null?void 0:e.width)??nfe,C=(e==null?void 0:e.height)??rfe,j=T.width/$,L=T.height/C,P=Math.max(j,L),A=P*$,z=P*C,G=_*P,B=T.x-(A-T.width)/2-G,re=T.y-(z-T.height)/2-G,Q=A+G*2,se=z+G*2,de=`${afe}-${R}`,te=E.useRef(0),pe=E.useRef();te.current=P,E.useEffect(()=>{if(N.current&&I)return pe.current=lce({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>te.current}),()=>{var be;(be=pe.current)==null||be.destroy()}},[I]),E.useEffect(()=>{var be;(be=pe.current)==null||be.update({translateExtent:D,width:U,height:W,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,D,U,W]);const ne=p?be=>{var Ae;const[xe,ke]=((Ae=pe.current)==null?void 0:Ae.pointer(be))||[0,0];p(be,{x:xe,y:ke})}:void 0,ye=m?E.useCallback((be,xe)=>{const ke=k.getState().nodeLookup.get(xe).internals.userNode;m(be,ke)},[]):void 0,ge=y??M["minimap.ariaLabel"];return o.jsx(F0,{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*P: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:Zn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:$,height:C,viewBox:`${B} ${re} ${Q} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:N,onClick:ne,children:[ge&&o.jsx("title",{id:de,children:ge}),o.jsx(tfe,{onClick:ye,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-G},${re-G}h${Q+G*2}v${se+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"})]})})}c6.displayName="MiniMap";const ofe=E.memo(c6),lfe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,cfe={[au.Line]:"right",[au.Handle]:"bottom-right"};function ufe({nodeId:e,position:t,variant:n=au.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=D4(),x=typeof e=="string"?e:b,_=wn(),k=E.useRef(null),N=n===au.Handle,T=Ot(E.useCallback(lfe(N&&p),[N,p]),xn),S=E.useRef(null),R=t??cfe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=wce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:D,transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$,domNode:C}=_.getState();return{nodeLookup:D,transform:U,snapGrid:W,snapToGrid:M,nodeOrigin:$,paneDomNode:C}},onChange:(D,U)=>{const{triggerNodeChanges:W,nodeLookup:M,parentLookup:$,nodeOrigin:C}=_.getState(),j=[],L={x:D.x,y:D.y},P=M.get(x);if(P&&P.expandParent&&P.parentId){const A=P.origin??C,z=D.width??P.measured.width??0,G=D.height??P.measured.height??0,B={id:P.id,parentId:P.parentId,rect:{width:z,height:G,...e4({x:D.x??P.position.x,y:D.y??P.position.y},{width:z,height:G},P.parentId,M,A)}},re=T_([B],M,$,C);j.push(...re),L.x=D.x?Math.max(A[0]*z,D.x):void 0,L.y=D.y?Math.max(A[1]*G,D.y):void 0}if(L.x!==void 0&&L.y!==void 0){const A={id:x,type:"position",position:{...L}};j.push(A)}if(D.width!==void 0&&D.height!==void 0){const z={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};j.push(z)}for(const A of U){const z={...A,type:"position"};j.push(z)}W(j)},onEnd:({width:D,height:U})=>{const W={id:x,type:"dimensions",resizing:!1,dimensions:{width:D,height:U}};_.getState().triggerNodeChanges([W])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:Zn(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(ufe);var u6=Object.defineProperty,dfe=(e,t,n)=>t in e?u6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ffe=(e,t)=>{for(var n in t)u6(e,n,{get:t[n],enumerable:!0})},hfe=(e,t,n)=>dfe(e,t+"",n),d6={};ffe(d6,{Graph:()=>Vs,alg:()=>I_,json:()=>h6,version:()=>gfe});var pfe=Object.defineProperty,f6=(e,t)=>{for(var n in t)pfe(e,n,{get:t[n],enumerable:!0})},Vs=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=vd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=mfe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,pC(this._preds[i],s),pC(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?jb(this._isDirected,e):vd(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?jb(this._isDirected,e):vd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?jb(this._isDirected,e):vd(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],mC(this._preds[a],i),mC(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 pC(e,t){e[t]?e[t]++:e[t]=1}function mC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function vd(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 mfe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function jb(e,t){return vd(e,t.v,t.w,t.name)}var gfe="4.0.1",h6={};f6(h6,{read:()=>xfe,write:()=>yfe});function yfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:bfe(e),edges:Efe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function bfe(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 Efe(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 xfe(e){let t=new Vs(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 I_={};f6(I_,{CycleException:()=>Tg,bellmanFord:()=>p6,components:()=>_fe,dijkstra:()=>Sg,dijkstraAll:()=>Sfe,findCycles:()=>Tfe,floydWarshall:()=>Cfe,isAcyclic:()=>Rfe,postorder:()=>Lfe,preorder:()=>Mfe,prim:()=>jfe,shortestPaths:()=>Dfe,tarjan:()=>g6,topsort:()=>y6});var wfe=()=>1;function p6(e,t,n,r){return vfe(e,String(t),n||wfe,r||function(s){return e.outEdges(s)})}function vfe(e,t,n,r){let s={},i,a=0,l=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 Sg(e,t,n,r){let s=function(i){return e.outEdges(i)};return Nfe(e,String(t),n||kfe,r||s)}function Nfe(e,t,n,r){let s={},i=new m6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Sfe(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Sg(e,s,t,n),r},{})}function g6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 Tfe(e){return g6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Afe=()=>1;function Cfe(e,t,n){return Ife(e,t||Afe,n||function(r){return e.outEdges(r)})}function Ife(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=b6(e,l,n==="post",a,i,r,s)}),s}function b6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=b6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function E6(e,t,n){return Ofe(e,t,n,function(r,s){return r.push(s),r},[])}function Lfe(e,t){return E6(e,t,"post")}function Mfe(e,t){return E6(e,t,"pre")}function jfe(e,t){let n=new Vs,r={},s=new m6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function Dfe(e,t,n,r){return Pfe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function Pfe(e,t,n,r){if(n===void 0)return Sg(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 x6(e){let t=new Vs({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 gC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function wh(e){let t=Vf(v6(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 Ffe(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=Oi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function Ufe(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Oi(Math.min,t),r=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function yC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),ku(e,"border",s,t)}function $fe(e,t=w6){let n=[];for(let r=0;rw6){let n=$fe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function v6(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Oi(Math.max,t)}function Hfe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function _6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function k6(e,t){return t()}var zfe=0;function R_(e){let t=++zfe;return e+(""+t)}function Vf(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 Vfe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var z0="\0",Kfe="3.0.0",Yfe=class{constructor(){hfe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return bC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&bC(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,Wfe)),n=n._prev;return"["+e.join(", ")+"]"}};function bC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Wfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Gfe=Yfe,qfe=()=>1;function Xfe(e,t){if(e.nodeCount()<=1)return[];let n=Zfe(e,t||qfe);return Qfe(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function Qfe(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)Db(e,t,n,l);for(;l=i.dequeue();)Db(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(Db(e,t,n,l,!0)||[]);break}}}return s}function Db(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,xx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,xx(t,n,d)}),e.removeNode(r.v),a}function Zfe(e,t){let n=new Vs,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=Jfe(s+r+3).map(()=>new Gfe),a=r+1;return n.nodes().forEach(l=>{xx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function xx(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 Jfe(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,R_("rev"))});function t(n){return r=>n.edge(r).weight}}function the(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 nhe(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 rhe(e){e.graph().dummyChains=[],e.edges().forEach(t=>she(e,t))}function she(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 O_(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):[],l=Oi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function lu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var N6=ahe;function ahe(e){let t=new Vs({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(;ohe(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!lu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function lhe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=lu(t,r)),st.node(r).rank+=n)}var{preorder:uhe,postorder:dhe}=I_,fhe=vl;vl.initLowLimValues=M_;vl.initCutValues=L_;vl.calcCutValue=S6;vl.leaveEdge=A6;vl.enterEdge=C6;vl.exchangeEdges=I6;function vl(e){e=Bfe(e),O_(e);let t=N6(e);M_(t),L_(t,e);let n,r;for(;n=A6(t);)r=C6(t,e,n),I6(t,e,n,r)}function L_(e,t){let n=dhe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>hhe(e,t,r))}function hhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=S6(e,t,n)}function S6(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 l=t.nodeEdges(n);return l&&l.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,mhe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function M_(e,t){arguments.length<2&&(t=e.nodes()[0]),T6(e,{},1,t)}function T6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=T6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function A6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function C6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===EC(e,e.node(u.v),l)&&c!==EC(e,e.node(u.w),l)).reduce((u,d)=>lu(t,d)!e.node(s).parent);if(!n)return;let r=uhe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function mhe(e,t,n){return e.hasEdge(t,n)}function EC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var ghe=yhe;function yhe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":xC(e);break;case"tight-tree":Ehe(e);break;case"longest-path":bhe(e);break;case"none":break;default:xC(e)}}var bhe=O_;function Ehe(e){O_(e),N6(e)}function xC(e){fhe(e)}var xhe=whe;function whe(e){let t=_he(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=vhe(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 _he(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(z0).forEach(r),t}function khe(e){let t=ku(e,"root",{},"_root"),n=Nhe(e),r=Object.values(n),s=Oi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=She(e)+1;e.children(z0).forEach(l=>R6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function R6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=yC(e,"_bt"),d=yC(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;R6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function Nhe(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(z0).forEach(r=>n(r,1)),t}function She(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function The(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Ahe=Che;function Che(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;ivC(e.node(t))),e.edges().forEach(t=>vC(e.edge(t)))}function vC(e){let t=e.width;e.width=e.height,e.height=t}function Ohe(e){e.nodes().forEach(t=>Pb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Pb),Object.hasOwn(r,"y")&&Pb(r)})}function Pb(e){e.y=-e.y}function Lhe(e){e.nodes().forEach(t=>Bb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Bb),Object.hasOwn(r,"x")&&Bb(r)})}function Bb(e){let t=e.x;e.x=e.y,e.y=t}function Mhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Oi(Math.max,r),i=Vf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function jhe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Phe(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function Bhe(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 Fhe(r)}function Fhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Uhe(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=>Ag(s,["vs","i","barycenter","weight"]))}function Uhe(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 $he(e,t){let n=Hfe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Hhe(!!t)),c=_C(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=_C(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function _C(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 Hhe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function L6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=Phe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=L6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&Vhe(h,p)}});let d=Bhe(u,n);zhe(d,c);let f=$he(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function zhe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function Vhe(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 Khe(e,t,n,r){r||(r=e.nodes());let s=Yhe(e),i=new Vs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function Yhe(e){let t;for(;e.hasNode(t=R_("_root")););return t}function Whe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function M6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,M6);return}let n=v6(e),r=kC(e,Vf(1,n+1),"inEdges"),s=kC(e,Vf(n-1,-1,-1),"outEdges"),i=Mhe(e);if(NC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Ghe(u%2?r:s,u%4>=2,c),i=wh(e);let f=jhe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return Khe(e,i,n,r.get(i)||[])})}function Ghe(e,t,n){let r=new Vs;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=L6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Whe(s,r,a.vs)})}function NC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function qhe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=Qhe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&j6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function Qhe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function j6(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 Zhe(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 Jhe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function tpe(e,t,n,r){let s=new Vs,i=e.graph(),a=ape(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 npe(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=ope(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=r-Oi(Math.min,u);a!=="l"&&(d=s-Oi(Math.max,u)),d&&(e[l]=H0(c,f=>f+d))})})}function spe(e,t=void 0){let n=e.ul;return n?H0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function ipe(e){let t=wh(e),n=Object.assign(qhe(e,t),Xhe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=Jhe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=epe(e,s,c.root,c.align,l==="r");l==="r"&&(u=H0(u,d=>-d)),r[a+l]=u})});let i=npe(e,r);return rpe(r,i),spe(r,e.graph().align)}function ape(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function ope(e,t){return e.node(t).width}function lpe(e){e=x6(e),cpe(e),Object.entries(ipe(e)).forEach(([t,n])=>e.node(t).x=n)}function cpe(e){let t=wh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function upe(e,t={}){let n=t.debugTiming?_6:k6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>xpe(e));return n(" runLayout",()=>dpe(r,n,t)),n(" updateInputGraph",()=>fpe(e,r)),r})}function dpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>wpe(e)),t(" removeSelfEdges",()=>Ipe(e)),t(" acyclic",()=>ehe(e)),t(" nestingGraph.run",()=>khe(e)),t(" rank",()=>ghe(x6(e))),t(" injectEdgeLabelProxies",()=>vpe(e)),t(" removeEmptyRanks",()=>Ufe(e)),t(" nestingGraph.cleanup",()=>The(e)),t(" normalizeRanks",()=>Ffe(e)),t(" assignRankMinMax",()=>_pe(e)),t(" removeEdgeLabelProxies",()=>kpe(e)),t(" normalize.run",()=>rhe(e)),t(" parentDummyChains",()=>xhe(e)),t(" addBorderSegments",()=>Ahe(e)),t(" order",()=>M6(e,n)),t(" insertSelfEdges",()=>Rpe(e)),t(" adjustCoordinateSystem",()=>Ihe(e)),t(" position",()=>lpe(e)),t(" positionSelfEdges",()=>Ope(e)),t(" removeBorderNodes",()=>Cpe(e)),t(" normalize.undo",()=>ihe(e)),t(" fixupEdgeLabelCoords",()=>Tpe(e)),t(" undoCoordinateSystem",()=>Rhe(e)),t(" translateGraph",()=>Npe(e)),t(" assignNodeIntersects",()=>Spe(e)),t(" reversePoints",()=>Ape(e)),t(" acyclic.undo",()=>nhe(e))}function fpe(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 hpe=["nodesep","edgesep","ranksep","marginx","marginy"],ppe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},mpe=["acyclicer","ranker","rankdir","align","rankalign"],gpe=["width","height","rank"],SC={width:0,height:0},ype=["minlen","weight","width","height","labeloffset"],bpe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Epe=["labelpos"];function xpe(e){let t=new Vs({multigraph:!0,compound:!0}),n=Ub(e.graph());return t.setGraph(Object.assign({},ppe,Fb(n,hpe),Ag(n,mpe))),e.nodes().forEach(r=>{let s=Ub(e.node(r)),i=Fb(s,gpe);Object.keys(SC).forEach(l=>{i[l]===void 0&&(i[l]=SC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Ub(e.edge(r));t.setEdge(r,Object.assign({},bpe,Fb(s,ype),Ag(s,Epe)))}),t}function wpe(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 vpe(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};ku(e,"edge-proxy",s,"_ep")}})}function _pe(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 kpe(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 Npe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function Spe(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(gC(r,i)),n.points.push(gC(s,a))})}function Tpe(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 Ape(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Cpe(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 Ipe(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 Rpe(e){wh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{ku(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 Ope(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function Fb(e,t){return H0(Ag(e,t),Number)}function Ub(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Lpe(e){let t=wh(e),n=new Vs({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Mpe={graphlib:d6,version:Kfe,layout:upe,debug:Lpe,util:{time:_6,notime:k6}},TC=Mpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const _d={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:il},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:IM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:vM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:wv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:d0}},wx=220,vx=88,AC=96,CC=34,Zd=64,$b=310,dc=24,D6=56,_x=40,IC=40,jpe=18,Dpe=58,Ppe=!1,Bpe=e=>e==="sequential"||e==="parallel"||e==="loop";function kx(e,t){const n=e.agentType??"llm";return Bpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Nx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!kx(e,t))return{width:wx,height:vx};if(r&&e.subAgents.length===0)return{width:$b,height:Zd};const i=e.subAgents.map((f,h)=>Nx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?D6:dc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?jpe+IC:s==="loop"?Dpe:0:IC;return u?{width:Math.max($b,i.reduce((f,h)=>f+h.width,0)+_x*Math.max(0,i.length-1)+c*2),height:Zd+dc+l+d+dc}:{width:Math.max($b,a+dc*2),height:Zd+c+i.reduce((f,h)=>f+h.height,0)+_x*Math.max(0,i.length-1)+d+c}}function id(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Fpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function RC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function ad(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:nu.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 OC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=id(f);return kx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||_d[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=id(f),y=Nx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":_d[g].label),pattern:g,description:d.description.trim()||_d[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((T,S)=>Nx(T,[...f,S],t,n)),x=b.length&&g!=="parallel"?D6:dc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((T,S)=>{const R=b[S],I=_?{x:k,y:Zd+dc}:{x:(y.width-R.width)/2,y:Zd+k};return k+=(_?R.width:R.height)+_x,i(T,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let T=0;T1&&s.push(ad(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=id(f);if(kx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||_d[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=id(y);s.push(ad(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=id([]),u=l(e,[]);return s.push(ad("terminal-input",c)),u.forEach(d=>s.push(ad(d,"terminal-output"))),Upe(r,s,t)}function Upe(e,t,n){const r=new TC.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?AC:i.data.layoutWidth??wx,height:a?CC:i.data.layoutHeight??vx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),TC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?AC:i.data.layoutWidth??wx,u=l?CC:i.data.layoutHeight??vx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const V0=E.createContext(null),K0=E.createContext("horizontal");function $pe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(V0),[h,p]=E.useState(!1),[m,g,w]=kg({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(xh,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Dde,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(dr,{})})]})})]})}function Hpe({data:e,selected:t}){const n=E.useContext(V0),r=E.useContext(K0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,l=e.pattern??"llm",c=_d[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(kr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Fi,{})}),o.jsx(kr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(kr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(kr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function zpe({data:e,selected:t}){const n=E.useContext(V0),r=E.useContext(K0),s=r==="vertical"?Fe.Top:Fe.Left,i=r==="vertical"?Fe.Bottom:Fe.Right,a=r==="vertical"?Fe.Right:Fe.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(kr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(dr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(dr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(dr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(dr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Fi,{})}),o.jsx(kr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(kr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(kr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Vpe({data:e}){const t=E.useContext(K0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(kr,{type:"target",position:t==="vertical"?Fe.Top:Fe.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(kr,{type:"source",position:t==="vertical"?Fe.Bottom:Fe.Right,className:"abc-handle"})]})}const Kpe={agent:Hpe,group:zpe,terminal:Vpe},Ype={insertStep:$pe};function Wpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>OC(e,c,a),[]),[d,f,h]=r6(u.nodes),[p,m,g]=s6(u.edges),w=Bde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${RC(e)}`),b=E.useRef(null),{fitView:x}=U0(),_=E.useMemo(()=>OC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(T))})},[T,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),D=U=>N(U.matches);return I.addEventListener("change",D),()=>I.removeEventListener("change",D)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${RC(e)}`,D=I!==y.current;y.current=I,m(_.edges),f(U=>{const W=new Map(U.map(M=>[M.id,M.position]));return _.nodes.map(M=>({...M,position:!D&&W.get(M.id)?W.get(M.id):M.position,selected:M.data.kind==="agent"&&!!M.data.path&&Fpe(M.data.path,t)}))}),D&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(K0.Provider,{value:c,children:o.jsx(V0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(n6,{nodes:d,edges:p,nodeTypes:Kpe,edgeTypes:Ype,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,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||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(a6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(l6,{showInteractive:!1}),Ppe]})})})})})}function Cg(e){return o.jsx(C_,{children:o.jsx(Wpe,{...e})})}const Gpe="doubao-seed-2-1-pro-260628",qpe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Xpe=`你是一个专业、可靠的智能助手。 - -你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 - -约束: -- 信息不足时主动提问澄清,不要臆造事实。 -- 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Pr(){return{name:"",description:qpe,instruction:Xpe,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:Gpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Wc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}function Qpe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function Zpe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}const Jpe=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],eme=[{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"}]}],tme=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function P6(e){const t=e.tools??[],n=ol.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Pr(),name:e.name,description:e.description,instruction:e.instruction||Pr().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(P6)}}function nme(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?P6(e.graph):{...Pr(),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 B6(e){return e?1+e.children.reduce((t,n)=>t+B6(n),0):1}function F6(e){return 1+e.subAgents.reduce((t,n)=>t+F6(n),0)}function Sx(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function rme(e){const t=Sx(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function sme(e,t){return e.find(n=>n.kind===t)}function ime(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Ig=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],ame=Ig.findIndex(e=>e.phase==="build");function U6(e){if(e.status==="success")return Ig.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Ig.findIndex(r=>r.phase===t);return n<0?0:n}function ome(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function lme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&U6(e)===ame,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` -`),f=s?u:d.slice(-36).join(` -`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=ome(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(zs,{"aria-hidden":!0}):o.jsx(c0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function cme({task:e}){const t=U6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx(Ft,{className:"spin"}):e.status==="success"?o.jsx(SM,{}):e.status==="error"?o.jsx(l0,{}):o.jsx(NE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Ig.map((s,i)=>{const a=e.status==="success"||inew Set),[ze,le]=E.useState(()=>new Set),[Ee,ut]=E.useState(!1),[ft,X]=E.useState(""),[ee,me]=E.useState(null),[Le,Ye]=E.useState([]),[Ze,Pt]=E.useState([]),[bt,Bt]=E.useState(!1),[zt,Nt]=E.useState(""),[Ut,Be]=E.useState(0),[pt,Je]=E.useState(!1),[Re,It]=E.useState(()=>new Set),[St,ce]=E.useState(!1),[Ve,at]=E.useState(""),[rn,sn]=E.useState(""),[fn,Wt]=E.useState(()=>new Set),Jt=E.useRef(!1),Mn=E.useRef(null),Vn=E.useRef(""),Kn=E.useRef(null),[vt,an]=E.useState(eme),[ue,Se]=E.useState("");E.useEffect(()=>{e.length!==0&&an(V=>V.map((O,q)=>q===0&&O.agentIds.length===0?{...O,agentIds:e.slice(0,2).map(oe=>oe.id)}:O))},[e]);const ve=E.useMemo(()=>{const V=new Map;for(const O of e)O.runtimeId&&V.set(O.runtimeId,O);return V},[e]),Qe=E.useMemo(()=>{var O;const V=new Map;for(const q of t){const oe=(O=q.deploymentTarget)==null?void 0:O.runtimeId;if(!oe||!ve.has(oe))continue;const Pe=V.get(oe);(!Pe||q.updatedAt>Pe.updatedAt)&&V.set(oe,q)}return V},[ve,t]),ot=E.useMemo(()=>{const V=new Map;for(const O of d){if(!O.runtimeId)continue;const q=V.get(O.runtimeId);(!q||O.startedAt>q.startedAt)&&V.set(O.runtimeId,O)}return V},[d]),et=E.useMemo(()=>{const V=Q.trim().toLowerCase();return V?e.filter(O=>{const q=O.runtimeId?Qe.get(O.runtimeId):void 0,oe=O.runtimeId?ot.get(O.runtimeId):void 0;return[O.label,O.app,O.host??"",(q==null?void 0:q.draft.name)??"",(q==null?void 0:q.draft.description)??"",(oe==null?void 0:oe.runtimeName)??""].join(" ").toLowerCase().includes(V)}):e},[e,ot,Q,Qe]),lt=E.useMemo(()=>{const V=Q.trim().toLowerCase();return t.filter(O=>{var oe;const q=(oe=O.deploymentTarget)==null?void 0:oe.runtimeId;return q&&ve.has(q)?!1:V?`${O.draft.name} ${O.draft.description}`.toLowerCase().includes(V):!0})},[ve,t,Q]),Vt=E.useMemo(()=>t.filter(V=>{var q;const O=(q=V.deploymentTarget)==null?void 0:q.runtimeId;return!O||!ve.has(O)}).length,[ve,t]),Kt=E.useMemo(()=>{const V=Q.trim().toLowerCase();return V?vt.filter(O=>O.name.toLowerCase().includes(V)):vt},[vt,Q]),J=e.find(V=>V.id===$),rt=t.find(V=>V.id===j),Ue=f?d.find(V=>V.id===f):void 0,qe=J!=null&&J.runtimeId?Qe.get(J.runtimeId):void 0,Xe=g?z:$&&s===$?r:null,Rt=E.useMemo(()=>{const V=new Map(e.map((q,oe)=>[q.id,oe])),O=new Map(n.map((q,oe)=>[q,oe]));return[...et].sort((q,oe)=>{const Pe=q.runtimeId?ot.get(q.runtimeId):void 0,nt=oe.runtimeId?ot.get(oe.runtimeId):void 0,it=(Pe==null?void 0:Pe.status)==="running"?Pe.startedAt:0,tn=(nt==null?void 0:nt.status)==="running"?nt.startedAt:0;if(it!==tn)return tn-it;const We=O.get(q.id),Gt=O.get(oe.id);return We!=null&&Gt!=null?We-Gt:We!=null?-1:Gt!=null?1:(V.get(q.id)??0)-(V.get(oe.id)??0)})},[n,e,et,ot]),Yn=(J==null?void 0:J.label)||(Xe==null?void 0:Xe.name)||(rt==null?void 0:rt.draft.name)||(Ue==null?void 0:Ue.runtimeName)||"未选择智能体",Wn=vt.find(V=>V.id===ue),en=Rt.filter(V=>V.canDelete===!0),vn=Rt.filter(V=>gt.has(V.id)&&V.canDelete===!0),Yt=lt.filter(V=>ze.has(V.id)),_n=en.length+lt.length,kn=vn.length+Yt.length,Mt=E.useMemo(()=>(Ue==null?void 0:Ue.agentDraft)??(rt==null?void 0:rt.draft)??(qe==null?void 0:qe.draft)??nme(Xe,(J==null?void 0:J.label)??"agent"),[Xe,J==null?void 0:J.label,qe==null?void 0:qe.draft,rt==null?void 0:rt.draft,Ue==null?void 0:Ue.agentDraft]),Nn=E.useMemo(()=>{if(Xe)return Xe.tools;const V=(Mt.builtinTools??[]).map(O=>{var q;return((q=ol.find(oe=>oe.id===O))==null?void 0:q.label)??O});return Array.from(new Set([...Mt.tools,...V,...(Mt.customTools??[]).map(O=>O.name),...(Mt.mcpTools??[]).map(O=>O.name)].filter(Boolean)))},[Mt,Xe]),mr=E.useMemo(()=>Xe?Xe.skillsPreviewSupported?Xe.skills.map(V=>V.name):null:Array.from(new Set([...(Mt.selectedSkills??[]).map(V=>V.name),...Mt.skills].filter(Boolean))),[Mt,Xe]),Lt=E.useMemo(()=>{if(Ue)return Ue;if(rt)return d.filter(V=>{var O,q;return((O=V.agentDraft)==null?void 0:O.name)===rt.draft.name||V.runtimeName===rt.draft.name||!!((q=rt.deploymentTarget)!=null&&q.runtimeId)&&V.runtimeId===rt.deploymentTarget.runtimeId}).sort((V,O)=>O.startedAt-V.startedAt)[0];if(J)return d.filter(V=>!!J.runtimeId&&V.runtimeId===J.runtimeId||V.runtimeName===J.label).sort((V,O)=>O.startedAt-V.startedAt)[0]},[d,J,rt,Ue]),jn=!!(f&&Lt&&Lt.id===f),lr=!!(Lt&&(Lt.status!=="success"||jn)),gr=E.useMemo(()=>ime(Mt),[Mt]),Ar=(J==null?void 0:J.currentVersion)??(P==null?void 0:P.currentVersion)??null,Ks=Ar??(Ue==null?void 0:Ue.startedAt)??"unknown",Hr=Xe?`runtime:${(J==null?void 0:J.runtimeId)??Xe.name}:v${Ks}:${gr}`:`draft:${(Ue==null?void 0:Ue.id)??(rt==null?void 0:rt.id)??(J==null?void 0:J.id)??Yn}:${gr}`,ns=!!(g&&(J!=null&&J.runtimeId)&&!B);E.useEffect(()=>{if(!f)return;const V=d.find(q=>q.id===f),O=V!=null&&V.runtimeId?ve.get(V.runtimeId):void 0;if(O){L(""),C(O.id),M("basic");return}C(""),L(""),M("basic")},[ve,d,f]),E.useEffect(()=>{if(!h){Vn.current="";return}const V=`${h}:${p}:${m}`;Vn.current!==V&&e.some(O=>O.id===h)&&(Vn.current=V,L(""),C(h),M(p),p==="evaluations"&&(te(m),ne("")))},[e,h,p,m]),E.useEffect(()=>{let V=!1;if(G(null),re(!g||!(J!=null&&J.runtimeId)||!J.region),!(!g||!(J!=null&&J.runtimeId)||!J.region))return Ov(J.runtimeId,J.region,J.runtimeApp).then(O=>{V||G(O)}).catch(()=>{V||G(null)}).finally(()=>{V||re(!0)}),()=>{V=!0}},[g,J==null?void 0:J.currentVersion,J==null?void 0:J.region,J==null?void 0:J.runtimeApp,J==null?void 0:J.runtimeId]),E.useEffect(()=>{let V=!1;if(A(null),!(!(J!=null&&J.runtimeId)||!J.region))return Lv(J.runtimeId,J.region).then(O=>{V||A(O)}).catch(()=>{V||A(null)}),()=>{V=!0}},[J==null?void 0:J.currentVersion,J==null?void 0:J.region,J==null?void 0:J.runtimeId]),E.useEffect(()=>{let V=!1;if(Ye([]),Pt([]),Nt(""),W!=="evaluations"||!(J!=null&&J.runtimeId)||!J.region){Bt(!1);return}return Bt(!0),VM({runtimeId:J.runtimeId,region:J.region,appName:J.app,pageSize:100}).then(O=>{V||(Pt(O.sets),Ye(O.items.map(q=>({...q,tag:q.kind==="good"?"Good case":"Bad case"})).sort((q,oe)=>Sx(oe.createdAt)-Sx(q.createdAt))))}).catch(O=>{V||Nt(O instanceof Error?O.message:String(O))}).finally(()=>{V||Bt(!1)}),()=>{V=!0}},[Ut,W,J==null?void 0:J.app,J==null?void 0:J.region,J==null?void 0:J.runtimeId]),E.useEffect(()=>{const V=new Set(Le.map(O=>O.id));It(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q}),Wt(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q}),rn&&!V.has(rn)&&sn("")},[Le,rn]),E.useEffect(()=>{Je(!1),It(new Set),Wt(new Set),at(""),sn("")},[J==null?void 0:J.runtimeId]),E.useEffect(()=>{const V=new Set(Rt.filter(O=>O.canDelete===!0).map(O=>O.id));Ge(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q})},[Rt]),E.useEffect(()=>{const V=new Set(lt.map(O=>O.id));le(O=>{const q=new Set([...O].filter(oe=>V.has(oe)));return q.size===O.size?O:q})},[lt]),E.useEffect(()=>{var q;if(!ee)return;const V=document.body.style.overflow;document.body.style.overflow="hidden",(q=Mn.current)==null||q.focus();const O=oe=>{oe.key==="Escape"&&!Ee&&me(null)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=V,window.removeEventListener("keydown",O)}},[ee,Ee]);const Ys=J!=null&&J.runtimeId?Le:Jpe,Es=Ys.filter(V=>{if(V.kind!==de)return!1;const O=pe.trim().toLowerCase();return O?[V.input,V.output,V.referenceOutput,V.comment,V.tag??"",V.sessionId,V.messageId,V.userId,V.evaluationSetName].join(" ").toLowerCase().includes(O):!0}),Vi=Es.filter(V=>Re.has(V.id)),Cr=!!(J!=null&&J.runtimeId),Ki=V=>{te(V),ne(""),at("");const O=Ys.find(q=>q.kind===V);sn((O==null?void 0:O.id)??""),window.setTimeout(()=>{var q;(q=Kn.current)==null||q.scrollIntoView({behavior:"smooth",block:"start"})},0)},xa=V=>{at(""),It(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q})},vi=()=>{at(""),It(new Set(Es.map(V=>V.id)))},Iu=()=>{at(""),It(new Set),Je(!1)},Ws=V=>{Wt(O=>{const q=new Set(O);return q.has(V)?q.delete(V):q.add(V),q})},Ru=V=>{sn(V.id),at(""),!(!V.sessionId||!V.messageId)&&(N==null||N(V))},xs=async V=>{if(!(J!=null&&J.runtimeId)||!J.region||St||V.length===0)return;const O=V.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${V.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(O))return;const q=V.map(Pe=>Pe.id),oe=new Set(q);ce(!0),at("");try{await KM({runtimeId:J.runtimeId,region:J.region,appName:J.app,itemIds:q});const Pe=new Map;for(const nt of V)Pe.set(nt.kind,(Pe.get(nt.kind)??0)+1);Ye(nt=>nt.filter(it=>!oe.has(it.id))),Pt(nt=>nt.map(it=>({...it,itemCount:Math.max(0,it.itemCount-(Pe.get(it.kind)??0))}))),It(nt=>new Set([...nt].filter(it=>!oe.has(it)))),Wt(nt=>new Set([...nt].filter(it=>!oe.has(it)))),rn&&oe.has(rn)&&sn(""),V.length>1&&Je(!1),T==null||T(V)}catch(Pe){at(Pe instanceof Error?Pe.message:String(Pe))}finally{ce(!1)}},ws=V=>{an(O=>O.map(q=>q.id===V.id?V:q))},wa=()=>{const V=new Set(e.map(oe=>oe.id)),O=n.filter(oe=>V.has(oe)),q=new Set(O);return[...O,...e.filter(oe=>!q.has(oe.id)).map(oe=>oe.id)]},nr=(V,O,q)=>{if(!y||V===O)return;const oe=wa().filter(it=>it!==V),Pe=oe.indexOf(O),nt=Pe<0?oe.length:q==="after"?Pe+1:Pe;oe.splice(nt,0,V),y(oe)},va=(V,O)=>{if(!ye||ye===O)return;const q=V.currentTarget.getBoundingClientRect();xe(O),Ae(V.clientY>q.top+q.height/2?"after":"before")},Yi=(V,O)=>{if(!y)return;const q=wa(),oe=q.indexOf(V),Pe=Math.max(0,Math.min(q.length-1,oe+O));oe<0||oe===Pe||(q.splice(oe,1),q.splice(Pe,0,V),y(q))},Nl=V=>{V.canDelete===!0&&(X(""),Ge(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q}))},Sl=V=>{X(""),le(O=>{const q=new Set(O);return q.has(V.id)?q.delete(V.id):q.add(V.id),q})},_a=()=>{X(""),Ge(new Set(en.map(V=>V.id))),le(new Set(lt.map(V=>V.id)))},ka=()=>{X(""),Ge(new Set),le(new Set),Ce(!1)},Na=()=>{if(kn===0||Ee)return;const V=vn.length,O=Yt.length;X(""),me({kind:"selection",title:V===1&&O===0?"删除 Agent?":V===0&&O===1?"删除草稿?":"删除所选项目?",description:V===1&&O===0?`"${vn[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:V===0&&O===1?`"${Yt[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${kn} 个项目。${V>0?`${V} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:V===0&&O===1?"删除草稿":"删除所选",agents:vn,drafts:Yt})},Tl=async()=>{if(!(!ee||Ee)){ut(!0),X("");try{if(ee.kind==="selection"){const{agents:V,drafts:O}=ee;if(V.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(V)}O.length>0&&(x==null||x(O)),Ge(new Set),le(new Set),Ce(!1),V.some(q=>q.id===$)&&C(""),O.some(q=>q.id===j)&&L("")}else if(ee.kind==="agent"){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b([ee.agent]),$===ee.agent.id&&C("")}else{if(!x)throw new Error("当前页面不支持删除草稿。");x([ee.draft]),j===ee.draft.id&&L("")}me(null)}catch(V){X(V instanceof Error?V.message:String(V))}finally{ut(!1)}}},bo=V=>{!b||V.canDelete!==!0||Ee||(X(""),me({kind:"agent",title:"删除 Agent?",description:`"${V.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:V}))},Gs=V=>{if(!x||Ee)return;const O=V.draft.name||"未命名 Agent";X(""),me({kind:"draft",title:"删除草稿?",description:`"${O}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:V})},_t=()=>{const V=`eval-${Date.now()}`,O={id:V,name:`新评测组 ${vt.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};an(q=>[O,...q]),Se(V)},Eo=V=>{ws({...V,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+V.history.length%7,status:"completed"},...V.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:D==="library"?"is-active":"","aria-pressed":D==="library",onClick:()=>{U("library"),se("")},children:"智能体库"}),o.jsx("button",{type:"button",className:D==="evaluation"?"is-active":"","aria-pressed":D==="evaluation",onClick:()=>{U("evaluation"),se("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":D==="evaluation"||void 0,ref:V=>V==null?void 0:V.toggleAttribute("inert",D==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":D==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(Sf,{"aria-hidden":!0}),o.jsx("input",{value:Q,onChange:V=>se(V.currentTarget.value),placeholder:D==="library"?"搜索智能体":"搜索评测组","aria-label":D==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:D==="library"?S:_t,disabled:D==="library"&&!a,children:[o.jsx(dr,{"aria-hidden":!0}),o.jsx("span",{children:D==="library"?"新建 Agent":"新建评测组"})]}),D==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${He?" is-active":""}`,children:He?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",kn," 个"]}),o.jsx("button",{type:"button",onClick:_a,disabled:_n===0||Ee,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Na(),disabled:kn===0||Ee,children:Ee?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:ka,disabled:Ee,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{X(""),Ce(!0)},disabled:_n===0,children:"选择"})}),D==="library"&&ft&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ft}),o.jsx("div",{className:"aw-agent-list",children:D==="evaluation"?Kt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Kt.map(V=>o.jsxs("button",{type:"button",className:`aw-agent-item${V.id===ue?" is-active":""}`,onClick:()=>Se(V.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:V.name}),o.jsxs("small",{children:[V.agentIds.length," 个智能体 · ",V.history.length," 次运行"]})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)):c&&Rt.length===0&<.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&Rt.length===0&<.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):Rt.length===0&<.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[lt.map(V=>{const O=d.filter(oe=>{var Pe,nt;return((Pe=oe.agentDraft)==null?void 0:Pe.name)===V.draft.name||oe.runtimeName===V.draft.name||!!((nt=V.deploymentTarget)!=null&&nt.runtimeId)&&oe.runtimeId===V.deploymentTarget.runtimeId}).sort((oe,Pe)=>Pe.startedAt-oe.startedAt)[0],q=ze.has(V.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",He?"is-selecting":"",q?"is-selected-for-delete":"",V.id===j?"is-active":""].filter(Boolean).join(" "),"aria-pressed":He?q:void 0,onClick:()=>{if(He){Sl(V);return}C(""),L(V.id),M("basic")},children:[He&&o.jsx("span",{className:`aw-select-marker${q?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:V.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(O==null?void 0:O.status)==="running"?" is-deploying":""}`,children:(O==null?void 0:O.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:V.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)}),Rt.map(V=>{const O=V.runtimeId?ot.get(V.runtimeId):void 0,q=V.runtimeId?Qe.get(V.runtimeId):void 0,oe=gt.has(V.id),Pe=V.canDelete===!0,nt=(O==null?void 0:O.status)==="running"?{label:"部署中",className:" is-deploying"}:(O==null?void 0:O.status)==="error"?{label:"失败",className:" is-error"}:(O==null?void 0:O.status)==="cancelled"?{label:"已取消",className:" is-muted"}:q?{label:"待更新",className:""}:null,it=(O==null?void 0:O.status)==="running"?"正在更新部署":q?"待更新":V.remote?V.host||"远程智能体":"本地智能体",tn=["aw-agent-item","aw-agent-item--sortable",V.id===$?"is-active":"",He?"is-selecting":"",oe?"is-selected-for-delete":"",He&&!Pe?"is-selection-disabled":"",V.id===ye?"is-dragging":"",V.id===be&&V.id!==ye?`is-drop-target is-drop-${ke}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!He,className:tn,"aria-pressed":He?oe:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:We=>{y&&(Jt.current=!0,ge(V.id),We.dataTransfer.effectAllowed="move",We.dataTransfer.setData("text/plain",V.id))},onDragEnter:We=>{va(We,V.id)},onDragOver:We=>{!ye||ye===V.id||(We.preventDefault(),We.dataTransfer.dropEffect="move",va(We,V.id))},onDragLeave:We=>{const Gt=We.relatedTarget;Gt instanceof Node&&We.currentTarget.contains(Gt)||be===V.id&&xe("")},onDrop:We=>{We.preventDefault();const Gt=We.dataTransfer.getData("text/plain")||ye;nr(Gt,V.id,ke),ge(""),xe(""),Ae("before")},onDragEnd:()=>{ge(""),xe(""),Ae("before"),window.setTimeout(()=>{Jt.current=!1},0)},onKeyDown:We=>{We.altKey&&(We.key==="ArrowUp"?(We.preventDefault(),Yi(V.id,-1)):We.key==="ArrowDown"&&(We.preventDefault(),Yi(V.id,1)))},onClick:We=>{if(He){We.preventDefault(),Nl(V);return}if(Jt.current){We.preventDefault(),Jt.current=!1;return}L(""),C(V.id),M("basic"),_(V.id)},children:[He&&o.jsx("span",{className:`aw-select-marker${oe?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:V.label}),V.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",V.currentVersion]}),nt&&o.jsx("span",{className:`aw-draft-badge${nt.className}`,children:nt.label})]}),o.jsx("small",{children:it})]}),o.jsx(Fd,{"aria-hidden":!0})]},V.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",D==="library"?e.length+Vt:vt.length," 个"]})]}),D==="evaluation"&&Wn?o.jsx(fme,{group:Wn,agents:e,cases:Ys,onChange:ws,onRun:Eo}):D==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!J&&!rt&&!Ue?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[J&&!Xe&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Yn}),Ar!=null&&o.jsxs("span",{children:["v",Ar]}),rt&&o.jsx("span",{children:"草稿"}),qe&&o.jsx("span",{children:"待更新"}),!J&&!rt&&Ue&&o.jsx("span",{children:Ue.label})]}),o.jsx("p",{children:Mt.description||(i||g&&!B?"正在读取智能体信息…":"暂无描述")})]}),(rt||qe||(J==null?void 0:J.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(rt||qe)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const V=rt??qe;V&&Gs(V)},disabled:Ee,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(Fi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(J==null?void 0:J.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void bo(J),disabled:Ee,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(Fi,{"aria-hidden":!0}),o.jsx("span",{children:Ee?"删除中…":"删除 Agent"})]})]})]}),Lt&&lr&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(cme,{task:Lt})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:tme.map(V=>o.jsx("button",{type:"button",className:W===V.id?"is-active":"","aria-pressed":W===V.id,onClick:()=>M(V.id),children:V.label},V.id))}),o.jsxs("div",{className:"aw-content",children:[W==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(P==null?void 0:P.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(P==null?void 0:P.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(P==null?void 0:P.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(P==null?void 0:P.region)||(J==null?void 0:J.region)||(Lt==null?void 0:Lt.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:P!=null&&P.networkTypes.length?P.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:ns?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Cg,{draft:Mt,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Hr)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(Xe==null?void 0:Xe.model)||Mt.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:Xe!=null&&Xe.graph?B6(Xe.graph):F6(Mt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:Nn.length?Nn.map(V=>o.jsx("span",{children:V},V)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:mr===null?"暂不支持预览":mr.length?mr.map(V=>o.jsx("span",{children:V},V)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:Ar!=null?`v${Ar}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:rt?"草稿":(Lt==null?void 0:Lt.status)==="error"?"部署失败":(Lt==null?void 0:Lt.status)==="cancelled"?"已取消":qe?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([V,O])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:V}),o.jsx("small",{children:O})]})]},V))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),W==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[J!=null&&J.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(V=>{const O=sme(Ze,V),q=(O==null?void 0:O.itemCount)??Le.filter(oe=>oe.kind===V).length;return o.jsxs("button",{type:"button",onClick:()=>Ki(V),children:[o.jsx("strong",{children:q}),o.jsx("span",{children:V==="good"?"Good cases":"Bad cases"})]},V)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(V=>o.jsx("button",{type:"button",className:de===V?"is-active":"","aria-pressed":de===V,onClick:()=>te(V),children:V==="good"?"Good case":"Bad case"},V))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(Sf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:pe,onChange:V=>ne(V.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),Cr&&o.jsx("div",{className:`aw-case-toolbar${pt?" is-active":""}`,children:pt?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Vi.length," 条"]}),o.jsx("button",{type:"button",onClick:vi,disabled:Es.length===0||St,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void xs(Vi),disabled:Vi.length===0||St,children:St?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Iu,disabled:St,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{at(""),Je(!0)},disabled:Es.length===0||St,children:"选择案例"})}),Ve&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Ve}),o.jsx("div",{ref:Kn,children:o.jsx(dme,{cases:Es,loading:bt,error:zt,runtimeBacked:!!(J!=null&&J.runtimeId),selectionMode:pt,selectedCaseIds:Re,focusedCaseId:rn,expandedCaseIds:fn,deleting:St,canDelete:Cr,onOpenCase:Ru,onToggleCase:xa,onToggleExpanded:Ws,onDeleteCase:V=>void xs([V]),onRetry:()=>Be(V=>V+1)})})]})]}),W==="basic"&&(J||rt)&&o.jsxs("div",{className:"aw-basic-actions",children:[J&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(J.id),children:[o.jsx(iV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:rt||qe?!a:!(J!=null&&J.runtimeId)||!l||!i&&!Xe,onClick:()=>rt?I==null?void 0:I(rt):qe?I==null?void 0:I(qe):R(Mt),children:rt||qe?"继续编辑":"更新"})]})]})]}),D==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),ee&&ps.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:V=>{V.target===V.currentTarget&&!Ee&&me(null)},children:o.jsxs("section",{className:"studio-confirm-dialog studio-confirm-dialog--danger",role:"alertdialog","aria-modal":"true","aria-labelledby":"aw-delete-confirm-title","aria-describedby":"aw-delete-confirm-description","aria-busy":Ee||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(Qpe,{})}),o.jsx("h2",{id:"aw-delete-confirm-title",children:ee.title})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:()=>me(null),disabled:Ee,"aria-label":"关闭删除确认",children:o.jsx(Zpe,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:"aw-delete-confirm-description",children:ee.description})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:Mn,type:"button",onClick:()=>me(null),disabled:Ee,children:"取消"}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:()=>void Tl(),disabled:Ee,children:Ee?"删除中...":ee.confirmLabel})]})]})}),document.body)]})}function dme({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(Fi,{"aria-hidden":!0})})]}),o.jsx("small",{children:rme(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function fme({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Gz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(zs,{}),"已完成"]}),o.jsx(Fd,{"aria-hidden":!0})]},f.id))})]})})]})}const LC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],hme=100,pme=3e4,fc=new Map,Ac=new Map,mme=new Set;function MC(e){if(!e){fc.clear(),Ac.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,r]of Ac)r.page.runtimes.some(s=>t.has(s.runtimeId))&&Ac.delete(n);fc.clear()}}function gme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function yme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function bme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Eme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function jC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:xme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function wme(e,t,n){const r=`${e}:${t}`,s=Ac.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(jC)),s.page.nextToken;s&&Ac.delete(r);let i=fc.get(r);i||(i=kc({scope:"mine",region:e,pageSize:hme,nextToken:t}),fc.set(r,i),i.then(()=>fc.delete(r),()=>fc.delete(r)));const a=await i;return Ac.set(r,{page:a,expiresAt:Date.now()+pme}),n(a.runtimes.map(jC)),a.nextToken}function vme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function _me({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s="",hiddenRuntimeIds:i=mme}){const a=E.useRef(null),l=E.useRef(null),c=E.useRef(0),[u,d]=E.useState("general"),[f,h]=E.useState("cn-beijing"),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState([]),[x,_]=E.useState(""),[k,N]=E.useState(!0),[T,S]=E.useState(""),[R,I]=E.useState(""),D=E.useCallback((z,G)=>{const B=++c.current;return N(!0),S(""),wme(f,z,re=>{c.current===B&&b(Q=>G?re:[...Q,...re])}).then(re=>{c.current===B&&_(re)}).catch(re=>{c.current===B&&S(re instanceof Error?re.message:String(re))}).finally(()=>{c.current===B&&N(!1)})},[f]);E.useEffect(()=>(b([]),_(""),D("",!0),()=>{c.current+=1}),[D]),E.useEffect(()=>{const z=l.current,G=a.current;if(!z||!G||u!=="general"||!x||k)return;const B=new IntersectionObserver(([re])=>{re.isIntersecting&&D(x,!1)},{root:G,rootMargin:"180px 0px",threshold:.01});return B.observe(z),()=>B.disconnect()},[u,D,k,x]);const U=E.useCallback(async z=>{if(!R){I(z.id);try{await new Promise(G=>requestAnimationFrame(()=>G())),await n(z)}finally{I("")}}},[R,n]),W=E.useMemo(()=>{if(u!=="general")return[];const z=g.trim().toLocaleLowerCase(),G=z?y.filter(Q=>Q.name.toLocaleLowerCase().includes(z)):y,B=i.size>0?G.filter(Q=>!Q.runtime||!i.has(Q.runtime.runtimeId)):G,re=B.findIndex(Q=>{var se;return((se=Q.runtime)==null?void 0:se.runtimeId)===s});return re<=0?B:[B[re],...B.slice(0,re),...B.slice(re+1)]},[u,s,i,g,y]),M=LC.find(z=>z.id===u),$=(M==null?void 0:M.label)??"智能体",C=(M==null?void 0:M.createLabel)??"添加智能体",j=u==="general"&&k&&y.length===0,L=!j&&W.length===0,P=u==="openclaw"||u==="hermes"?"暂未开放":g.trim()?"没有匹配的智能体":`${$}暂无内容`,A=u==="general"?()=>e(f):u==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:z=>{z.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(z=>!z),children:[o.jsx("span",{children:f==="cn-beijing"?"北京":"上海"}),o.jsx(bme,{className:`my-agents-region-chevron${p?" is-open":""}`})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(z=>{const G=z.value===f;return o.jsxs("button",{type:"button",role:"option","aria-selected":G,className:`my-agents-region-option${G?" is-selected":""}`,onClick:()=>{h(z.value),m(!1)},children:[o.jsx("span",{children:z.label}),G&&o.jsx(Eme,{})]},z.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(gme,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:g,onChange:z=>w(z.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:LC.map(z=>o.jsx("button",{type:"button",className:`my-agent-type-pill${u===z.id?" is-active":""}`,"aria-pressed":u===z.id,onClick:()=>d(z.id),children:z.label},z.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!A,onClick:()=>A==null?void 0:A(),children:[o.jsx(yme,{}),C]})]}),o.jsxs("section",{className:"my-agent-results",ref:a,"aria-label":`${$}列表`,children:[j?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):T&&u==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T}),o.jsx("button",{type:"button",onClick:()=>void D("",!0),children:"重新加载"})]}):L?o.jsxs("div",{className:"my-agent-empty",children:[!g.trim()&&u==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(f),children:"点此创建"})]}):o.jsx("p",{children:P}),g.trim()&&u!=="openclaw"&&u!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:W.map(z=>{var G;return o.jsx(vme,{agent:z,onUse:U,onViewDetails:r,connecting:z.id===R,connected:((G=z.runtime)==null?void 0:G.runtimeId)===s},z.id)})}),u==="general"&&W.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:l,"aria-live":"polite",children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):x?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const kme={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 Nme(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 Sme(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Tme(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function j_(e,t){if(Sme(e))return Nme(t,e.path);if(Tme(e)){const n=kme[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=j_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Ame(e,t){const n=j_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const $6=new Map;function _l(e,t){$6.set(e,t)}function Cme(e){return $6.get(e)}function Ime(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;ij_(r,e.dataModel),resolveString:r=>Ame(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Cme(s.component)??Rme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Lme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 D_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(al,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(pr,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(kM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(pr,{})}):null]}):null]})}function P_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function z6(e){var n,r,s,i;const t=P_(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 V6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function K6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?QM(t,e.uri):""}function Mme({kind:e}){return e==="image"?o.jsx(xv,{}):e==="video"?o.jsx(TM,{}):e==="pdf"?o.jsx(Yz,{}):o.jsx(bv,{})}function B_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=P_(a.mimeType),c=K6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(hV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Mme,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:z6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(Ft,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":V6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(_c,{className:"media-card-open"}):null]});return o.jsxs(Zt.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(xM,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(pr,{})}):null]},a.id)})}),o.jsx(oi,{children:s?o.jsx(jme,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function jme({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>K6(t,e),[e,t]),s=P_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(Zt.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:o.jsxs(Zt.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[z6(t),t.sizeBytes?` · ${V6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(u0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(pr,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(Ft,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(ph,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Dme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 Pme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 Y6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Bme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function Fme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Ume(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function $me(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Hme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function W6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function zme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(ma,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(W6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Vme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Dme},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Hme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Pme},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:Y6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:Bme},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Fme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Ume},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:$me}};function Kme(e){return Vme[e]}const G6="send_a2ui_json_to_client",Yme=28;function Wme(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Gme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function q6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function qme({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 Xme(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 Qme(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 X6({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=q6(c,!t||n,r),{ref:d,onScroll:f}=Lme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(qme,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(ma,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx(Ds,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function Q6(){return o.jsx(X6,{text:"",done:!1})}const Zme=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=q6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:s})}):null});function Jme({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===G6?"渲染 UI":e,l=Kme(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 o.jsxs(Zt.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(zme,{definition:l,label:Qme(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(Xme,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(ma,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(W6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function ege({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx(Ft,{className:"spin"}):o.jsx(yv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx(Ft,{className:"spin"}):o.jsx(u0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(pr,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function tge({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(Zt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(uT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(Zt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(uT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(Ft,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function F_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(X6,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(Zme,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx(B_,{appName:t,items:c.files},u);case"artifact":return o.jsx(ege,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(D_,{value:c.value},u);case"tool":return c.name===G6&&c.done?null:o.jsx(Jme,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(tge,{block:c,onAuth:i},u);case"a2ui":return H6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(Zt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Ome,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function Z6(e){return e.isComposing||e.keyCode===229}const nge="/assets/arkclaw-DG3MhHYM.png",rge="/assets/codex-Csw-JJxq.png",sge="/assets/hermes-C6L-CfGS.png",ei=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],ige=[{label:"ArkClaw",logo:nge},{label:"Hermes 智能体",logo:sge}];function DC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Kc,{className:"new-chat-mode__agent-icon"})}function age(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function oge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>ei.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=ei.find(k=>k.value===e)??ei[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var T;(T=f.current)!=null&&T.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+ei.length)%ei.length;while(w(ei[N]));d(N),c(ei[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(ei.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(ei[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(DC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(ei[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:ei.map((k,N)=>{const T=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(DC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),T?o.jsx(age,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:rge,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),ige.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const J6={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},lge={ppt:[],image:[],video:["video_task_query"]},U_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function PC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function cge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function uge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function dge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const fge=[{icon:cge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:uge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:dge,text:"帮我整理并润色一段内容,让表达更清晰"}],BC=[{value:"ppt",label:"PPT",icon:cV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:xv,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:Y6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function hge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:T,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:D=!1,builtinTools:U=[]}){const W=E.useRef(null),M=E.useRef(null),$=E.useRef(null),C=E.useRef(null),[j,L]=E.useState(!1),[P,A]=E.useState(null),[z,G]=E.useState(0),[B,re]=E.useState(!1);async function Q(){if(e)try{await navigator.clipboard.writeText(e),re(!0),setTimeout(()=>re(!1),1500)}catch{re(!1)}}E.useLayoutEffect(()=>{const le=W.current;le&&(le.style.height="auto",le.style.height=`${Math.min(le.scrollHeight,200)}px`)},[s]);const se=x==="skill-create";E.useEffect(()=>{se&&(L(!1),A(null))},[se]);const de=!se&&d.some(le=>le.status!=="ready"),te=!l&&!c&&!de&&(s.trim().length>0||!se&&d.length>0),pe=(P==null?void 0:P.query.toLocaleLowerCase())??"",ne=(P==null?void 0:P.kind)==="skill"?f.filter(le=>!p.skills.some(Ee=>Ee.name===le.name)).filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(pe)).map(le=>({kind:"skill",value:le})):(P==null?void 0:P.kind)==="agent"?h.filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(pe)).map(le=>({kind:"agent",value:le})):[];function ye(le){var Ee;L(!1),A(null),(Ee=le.current)==null||Ee.click()}function ge(le){i(le),L(!1),A(null),requestAnimationFrame(()=>{var Ee,ut;(Ee=W.current)==null||Ee.focus(),(ut=W.current)==null||ut.setSelectionRange(le.length,le.length)})}function be(le){S==null||S(le.value),L(!1),A(null),requestAnimationFrame(()=>{var Ee,ut;(Ee=W.current)==null||Ee.focus(),(ut=W.current)==null||ut.setSelectionRange(s.length,s.length)})}function xe(le){i(le),L(!1),A(null),requestAnimationFrame(()=>{var ft,X,ee;(ft=W.current)==null||ft.focus();const Ee=le.indexOf("【"),ut=le.indexOf("】",Ee+1);Ee>=0&&ut>Ee?(X=W.current)==null||X.setSelectionRange(Ee+1,ut):(ee=W.current)==null||ee.setSelectionRange(le.length,le.length)})}function ke(){S==null||S(null),i(""),L(!1),A(null),requestAnimationFrame(()=>{var le,Ee;(le=W.current)==null||le.focus(),(Ee=W.current)==null||Ee.setSelectionRange(0,0)})}const Ae=BC.find(le=>le.value===_),He=BC.filter(le=>J6[le.value].every(Ee=>U.includes(Ee)));function Ce(le,Ee){const ut=le.slice(0,Ee),ft=/(^|\s)([/@])([^\s/@]*)$/.exec(ut);if(!ft){A(null);return}const X=ft[2].length+ft[3].length,ee={kind:ft[2]==="/"?"skill":"agent",query:ft[3],start:Ee-X,end:Ee},me=!P||P.kind!==ee.kind||P.query!==ee.query||P.start!==ee.start||P.end!==ee.end;A(ee),me&&G(0),L(!1)}function gt(le){if(!P)return;const Ee=s.slice(0,P.start)+s.slice(P.end);i(Ee),le.kind==="skill"?w({...p,skills:[...p.skills,le.value]}):w({skills:[],targetAgent:le.value});const ut=P.start;A(null),requestAnimationFrame(()=>{var ft,X;(ft=W.current)==null||ft.focus(),(X=W.current)==null||X.setSelectionRange(ut,ut)})}function Ge(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function ze(le){const Ee=le.target.files?Array.from(le.target.files):[];Ee.length&&y(Ee),le.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${se?" composer--skill-mode":""}${Ae?` composer--has-task composer--task-${Ae.value}`:""}`,children:[se?null:o.jsx(D_,{value:p,onRemoveSkill:le=>w({...p,skills:p.skills.filter(Ee=>Ee.name!==le)}),onRemoveAgent:()=>w({skills:[]})}),!se&&d.length>0&&o.jsx(B_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[P?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":P.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[P.kind==="skill"?o.jsx(al,{}):o.jsx(kM,{}),o.jsx("span",{children:P.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:P.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(Ft,{className:"spin"})," 正在读取 Agent 能力…"]}):ne.length===0?o.jsx("div",{className:"composer-command-empty",children:P.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:ne.map((le,Ee)=>o.jsxs("button",{type:"button",role:"option","aria-selected":Ee===z,className:`composer-command-item${Ee===z?" is-active":""}`,onMouseDown:ut=>{ut.preventDefault(),gt(le)},onMouseEnter:()=>G(Ee),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${le.kind}`,children:le.kind==="skill"?o.jsx(al,{}):o.jsx(il,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[le.kind==="skill"?"/":"@",le.value.name]}),o.jsx("span",{children:le.value.description||(le.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:Ee===z?"↵":le.kind==="skill"?"技能":"Agent"})]},`${le.kind}-${le.value.name}`))})]}):null,se?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{A(null),L(le=>!le)},children:o.jsx(dr,{className:"icon"})}),j&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye(M),children:[o.jsx(xv,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye($),children:[o.jsx(bv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>ye(C),children:[o.jsx(TM,{className:"icon"}),"上传视频"]})]})]})]}),N&&T?o.jsx(oge,{value:x,onChange:T,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Ae&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Ae.value}`,"aria-label":`取消${Ae.label}任务`,disabled:c,onClick:ke,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Ae.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(pr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Ae.label})]}):null,k&&se&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(PC,{className:"new-chat-task-chip__task-icon"}),o.jsx(pr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:W,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:se?`描述你想创建的 Skill,将使用 ${U_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!P,onChange:le=>{i(le.target.value),se||Ce(le.target.value,le.target.selectionStart)},onSelect:le=>{se||Ce(le.currentTarget.value,le.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:le=>{if(!Z6(le.nativeEvent)){if(P){if(le.key==="ArrowDown"&&ne.length>0){le.preventDefault(),G(Ee=>(Ee+1)%ne.length);return}if(le.key==="ArrowUp"&&ne.length>0){le.preventDefault(),G(Ee=>(Ee-1+ne.length)%ne.length);return}if((le.key==="Enter"||le.key==="Tab")&&ne[z]){le.preventDefault(),gt(ne[z]);return}if(le.key==="Escape"){le.preventDefault(),A(null);return}}if(le.key==="Backspace"&&!s&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){Ge();return}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),te&&a())}}})}),o.jsx(Zt.button,{type:"button",className:"comp-send",disabled:!te,onClick:a,"aria-label":"发送",whileTap:te?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx(Ft,{className:"icon spin"}):o.jsx(_M,{className:"icon"})})]}),k&&x==="agent"&&D&&!Ae?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[He.map(le=>{const Ee=le.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>be(le),children:[o.jsx(Ee,{}),o.jsx("span",{children:le.label})]},le.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(PC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Ae?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Ae.label}企业提示词`,children:Ae.prompts.map(le=>{const Ee=Ae.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>xe(le),children:[o.jsx(Ee,{}),o.jsx("span",{children:le})]},le)})}):null,k&&x==="agent"&&!D&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:fge.map(le=>{const Ee=le.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ge(le.text),children:[o.jsx(Ee,{}),o.jsx("span",{children:le.text})]},le.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:B?"已复制":"复制会话 ID","aria-label":B?"已复制会话 ID":"复制会话 ID",onClick:()=>void Q(),children:B?o.jsx(zs,{}):o.jsx(c0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:M,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:$,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ze})]})}function e5({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(Zt.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx(Ds,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const $_=Symbol.for("yaml.alias"),Tx=Symbol.for("yaml.document"),io=Symbol.for("yaml.map"),t5=Symbol.for("yaml.pair"),Ui=Symbol.for("yaml.scalar"),Nu=Symbol.for("yaml.seq"),$s=Symbol.for("yaml.node.type"),Su=e=>!!e&&typeof e=="object"&&e[$s]===$_,vh=e=>!!e&&typeof e=="object"&&e[$s]===Tx,_h=e=>!!e&&typeof e=="object"&&e[$s]===io,zn=e=>!!e&&typeof e=="object"&&e[$s]===t5,un=e=>!!e&&typeof e=="object"&&e[$s]===Ui,kh=e=>!!e&&typeof e=="object"&&e[$s]===Nu;function $n(e){if(e&&typeof e=="object")switch(e[$s]){case io:case Nu:return!0}return!1}function Hn(e){if(e&&typeof e=="object")switch(e[$s]){case $_:case io:case Ui:case Nu:return!0}return!1}const n5=e=>(un(e)||$n(e))&&!!e.anchor,Lo=Symbol("break visit"),pge=Symbol("skip children"),Jd=Symbol("remove node");function Tu(e,t){const n=mge(t);vh(e)?hc(null,e.contents,n,Object.freeze([e]))===Jd&&(e.contents=null):hc(null,e,n,Object.freeze([]))}Tu.BREAK=Lo;Tu.SKIP=pge;Tu.REMOVE=Jd;function hc(e,t,n,r){const s=gge(e,t,n,r);if(Hn(s)||zn(s))return yge(e,r,s),hc(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=>bge[t]);class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){const t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.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+Ege(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&Hn(t.contents)){const i={};Tu(t.contents,(a,l)=>{Hn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` -`)}}jr.defaultYaml={explicit:!1,version:"1.2"};jr.defaultTags={"!!":"tag:yaml.org,2002:"};function r5(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 s5(e){const t=new Set;return Tu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function i5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function xge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=s5(e));const a=i5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(un(a.node)||$n(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function pc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sBs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!n5(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 H_{constructor(t){Object.defineProperty(this,$s,{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(!vh(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},l=Bs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?pc(i,{"":l},"",l):l}}class z_ extends H_{constructor(t){super($_),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=[],Tu(t,{Node:(i,a)=>{(Su(a)||n5(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 l=r.get(a);if(l||(Bs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=bm(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(r5(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 bm(e,t,n){if(Su(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=bm(e,s,n);i>r&&(r=i)}return r}else if(zn(t)){const r=bm(e,t.key,n),s=bm(e,t.value,n);return Math.max(r,s)}return 1}const a5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends H_{constructor(t){super(Ui),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Bs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const wge="tag:yaml.org,2002:";function vge(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 Kf(e,t,n){var f,h,p;if(vh(e)&&(e=e.contents),Hn(e))return e;if(zn(e)){const m=(h=(f=n.schema[io]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new z_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=wge+t.slice(2));let u=vge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[io]:Symbol.iterator in Object(e)?a[Nu]:a[io]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Rg(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 Kf(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 kd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class o5 extends H_{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Hn(r)||zn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(kd(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,Rg(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&&un(i)?i.value:i:$n(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!zn(n))return!1;const r=n.value;return r==null||t&&un(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,Rg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const _ge=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ia(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Vo=(e,t,n)=>e.endsWith(` -`)?ia(n,t):n.includes(` -`)?` -`+ia(n,t):(e.endsWith(" ")?"":" ")+n,l5="flow",Ax="block",Em="quoted";function Y0(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,g=-1,w=-1,y=-1;n===Ax&&(g=FC(e,g,t.length),g!==-1&&(f=g+c));for(let x;x=e[g+=1];){if(n===Em&&x==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(x===` -`)n===Ax&&(g=FC(e,g,t.length)),f=g+t.length+c,h=void 0;else{if(x===" "&&p&&p!==" "&&p!==` -`&&p!==" "){const _=e[g+1];_&&_!==" "&&_!==` -`&&_!==" "&&(h=g)}if(g>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===Em){for(;p===" "||p===" ";)p=x,x=e[g+=1],m=!0;const _=g>y+1?g-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=x}if(m&&l&&l(),u.length===0)return e;a&&a();let b=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),G0=e=>/^(%|---|\.\.\.)/m.test(e);function kge(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 ef(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(G0(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,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,l=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(Ix,`$&${u}`));let g=!1,w,y=-1;for(w=0;w{N=!0});const S=Y0(`${b}${k}${p}`,u,Ax,T);if(!N)return`>${_} -${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} -${u}${b}${n}${p}`}function Nge(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` -`)||d&&/[[\]{},]/.test(i))return mc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` -`)?mc(i,t):xm(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` -`))return xm(e,t,n,r);if(G0(i)){if(c==="")return t.forceBlockIndent=!0,xm(e,t,n,r);if(l&&c===u)return mc(i,t)}const f=i.replace(/\n+/g,`$& -${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return mc(i,t)}return l?f:Y0(f,c,l5,W0(t,!1))}function V_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?mc(a.value,t):xm(a,t,n,r);case yt.QUOTE_DOUBLE:return ef(a.value,t);case yt.QUOTE_SINGLE:return Cx(a.value,t);case yt.PLAIN:return Nge(a,t,n,r);default:return null}};let u=c(l);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 c5(e,t){const n=Object.assign({blockQuote:!0,commentString:_ge,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 Sge(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(un(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 Tge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(un(e)||$n(e))&&e.anchor;i&&r5(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 cu(e,t,n,r){var c;if(zn(e))return e.toString(t,n,r);if(Su(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=Hn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Sge(t.doc.schema.tags,i));const a=Tge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):un(i)?V_(i,t,n,r):i.toString(t,n,r);return a?un(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function Age({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Hn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if($n(e)||!Hn(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||$n(e)||(un(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=cu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Vo(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Vo(w,n.indent,u(h))),w=`? ${w} -${l}:`):(w=`${w}:`,h&&(w+=Vo(w,n.indent,u(h))));let y,b,x;Hn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&un(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&kh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=cu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` -`:"",b){const T=u(b);N+=` -${ia(T,n.indent)}`}k===""&&!n.inFlow?N===` -`&&x&&(N=` - -`):N+=` -${n.indent}`}else if(!p&&$n(t)){const T=k[0],S=k.indexOf(` -`),R=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let D=!1;if(R&&(T==="&"||T==="!")){let U=k.indexOf(" ");T==="&"&&U!==-1&&Ue===Lp||typeof e=="symbol"&&e.description===Lp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(Lp)),{addToJSMap:d5}),stringify:()=>Lp},Cge=(e,t)=>(ca.identify(t)||un(t)&&(!t.type||t.type===yt.PLAIN)&&ca.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ca.tag&&n.default));function d5(e,t,n){const r=f5(e,n);if(kh(r))for(const s of r.items)Hb(e,t,s);else if(Array.isArray(r))for(const s of r)Hb(e,t,s);else Hb(e,t,r)}function Hb(e,t,n){const r=f5(e,n);if(!_h(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 f5(e,t){return e&&Su(t)?t.resolve(e.doc,e):t}function h5(e,t,{key:n,value:r}){if(Hn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Cge(e,n))d5(e,t,r);else{const s=Bs(n,"",e);if(t instanceof Map)t.set(s,Bs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Ige(n,s,e),a=Bs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Ige(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Hn(e)&&(n!=null&&n.doc)){const r=c5(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)+'..."'),u5(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 K_(e,t,n){const r=Kf(e,void 0,n),s=Kf(t,void 0,n);return new Fr(r,s)}class Fr{constructor(t,n=null){Object.defineProperty(this,$s,{value:t5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Hn(n)&&(n=n.clone(t)),Hn(r)&&(r=r.clone(t)),new Fr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return h5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Age(this,t,n,r):JSON.stringify(this)}}function p5(e,t,n){return(t.inFlow??e.flow?Oge:Rge)(e,t,n)}function Rge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Vo(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||y.includes(` -`)),m0&&(u||(u=f.reduce((b,x)=>b+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),w&&(y+=Vo(y,r,l(w))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const g of f)m+=g?` -${i}${s}${g}`:` -`;return`${m} -${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Og({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=ia(t(r),e);n.push(i.trimStart())}}function Ko(e,t){const n=un(t)?t.value:t;for(const r of e)if(zn(r)&&(r.key===t||r.key===n||un(r.key)&&r.key.value===n))return r}class Ms extends o5{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(io,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),l=(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(K_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;zn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Fr(t,t==null?void 0:t.value):r=new Fr(t.key,t.value);const s=Ko(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`);un(s.value)&&a5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Ko(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Ko(this.items,t),s=r==null?void 0:r.value;return(!n&&un(s)?s.value:s)??void 0}has(t){return!!Ko(this.items,t)}set(t,n){this.add(new Fr(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)h5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!zn(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})),p5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Au={collection:"map",default:!0,nodeClass:Ms,tag:"tag:yaml.org,2002:map",resolve(e,t){return _h(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ms.from(e,t,n)};class pl extends o5{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=Mp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Mp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&un(s)?s.value:s}has(t){const n=Mp(t);return typeof n=="number"&&n=0?t:null}const Cu={collection:"seq",default:!0,nodeClass:pl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>pl.from(e,t,n)},q0={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),V_(e,t,n,r)}},X0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&X0.test.test(e)?e:t.options.nullStr},Y_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Y_.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 wi({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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const m5={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:wi},g5={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():wi(e)}},y5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:wi},Q0=e=>typeof e=="bigint"||Number.isInteger(e),W_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function b5(e,t,n){const{value:r}=e;return Q0(r)&&r>=0?n+r.toString(t):wi(e)}const E5={identify:e=>Q0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>W_(e,2,8,n),stringify:e=>b5(e,8,"0o")},x5={identify:Q0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>W_(e,0,10,n),stringify:wi},w5={identify:e=>Q0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>W_(e,2,16,n),stringify:e=>b5(e,16,"0x")},Lge=[Au,Cu,q0,X0,Y_,E5,x5,w5,m5,g5,y5];function UC(e){return typeof e=="bigint"||Number.isInteger(e)}const jp=({value:e})=>JSON.stringify(e),Mge=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:jp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:jp},{identify:UC,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})=>UC(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:jp}],jge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Dge=[Au,Cu].concat(Mge,jge),G_={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 Fr(new yt(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]=zn(r)?r:new Fr(r)}}else t("Expected a sequence for this tag");return e}function _5(e,t,n){const{replacer:r}=n,s=new pl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(K_(l,c,n))}return s}const q_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:v5,createNode:_5};class Cc extends pl{constructor(){super(),this.add=Ms.prototype.add.bind(this),this.delete=Ms.prototype.delete.bind(this),this.get=Ms.prototype.get.bind(this),this.has=Ms.prototype.has.bind(this),this.set=Ms.prototype.set.bind(this),this.tag=Cc.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(zn(s)?(i=Bs(s.key,"",n),a=Bs(s.value,i,n)):i=Bs(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=_5(t,n,r),i=new this;return i.items=s.items,i}}Cc.tag="tag:yaml.org,2002:omap";const X_={collection:"seq",identify:e=>e instanceof Map,nodeClass:Cc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=v5(e,t),r=[];for(const{key:s}of n.items)un(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Cc,n)},createNode:(e,t,n)=>Cc.from(e,t,n)};function k5({value:e,source:t},n){return t&&(e?N5:S5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const N5={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 yt(!0),stringify:k5},S5={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 yt(!1),stringify:k5},Pge={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:wi},Bge={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():wi(e)}},Fge={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 yt(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:wi},Nh=e=>typeof e=="bigint"||Number.isInteger(e);function Z0(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 Q_(e,t,n){const{value:r}=e;if(Nh(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return wi(e)}const Uge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Z0(e,2,2,n),stringify:e=>Q_(e,2,"0b")},$ge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Z0(e,1,8,n),stringify:e=>Q_(e,8,"0")},Hge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Z0(e,0,10,n),stringify:wi},zge={identify:Nh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Z0(e,2,16,n),stringify:e=>Q_(e,16,"0x")};class Ic extends Ms{constructor(t){super(t),this.tag=Ic.tag}add(t){let n;zn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Fr(t.key,null):n=new Fr(t,null),Ko(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ko(this.items,t);return!n&&zn(r)?un(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=Ko(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Fr(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(K_(a,null,r));return i}}Ic.tag="tag:yaml.org,2002:set";const Z_={collection:"map",identify:e=>e instanceof Set,nodeClass:Ic,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Ic.from(e,t,n),resolve(e,t){if(_h(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ic,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function J_(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function T5(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return wi(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 A5={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})=>J_(e,n),stringify:T5},C5={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=>J_(e,!1),stringify:T5},J0={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(J0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=J_(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$/,""))??""},$C=[Au,Cu,q0,X0,N5,S5,Uge,$ge,Hge,zge,Pge,Bge,Fge,G_,ca,X_,q_,Z_,A5,C5,J0],HC=new Map([["core",Lge],["failsafe",[Au,Cu,q0]],["json",Dge],["yaml11",$C],["yaml-1.1",$C]]),zC={binary:G_,bool:Y_,float:y5,floatExp:g5,floatNaN:m5,floatTime:C5,int:x5,intHex:w5,intOct:E5,intTime:A5,map:Au,merge:ca,null:X0,omap:X_,pairs:q_,seq:Cu,set:Z_,timestamp:J0},Vge={"tag:yaml.org,2002:binary":G_,"tag:yaml.org,2002:merge":ca,"tag:yaml.org,2002:omap":X_,"tag:yaml.org,2002:pairs":q_,"tag:yaml.org,2002:set":Z_,"tag:yaml.org,2002:timestamp":J0};function zb(e,t,n){const r=HC.get(t);if(r&&!e)return n&&!r.includes(ca)?r.concat(ca):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(HC.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(ca)),s.reduce((i,a)=>{const l=typeof a=="string"?zC[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(zC).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const Kge=(e,t)=>e.keyt.key?1:0;class ek{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?zb(t,"compat"):t?zb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Vge:{},this.tags=zb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,io,{value:Au}),Object.defineProperty(this,Ui,{value:q0}),Object.defineProperty(this,Nu,{value:Cu}),this.sortMapEntries=typeof a=="function"?a:a===!0?Kge:null}clone(){const t=Object.create(ek.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Yge(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=c5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ia(u,""))}let a=!1,l=null;if(e.contents){if(Hn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ia(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=cu(e.contents,s,()=>l=null,u);l&&(d+=Vo(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(cu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` -`)?(n.push("..."),n.push(ia(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(ia(i(u),"")))}return n.join(` -`)+` -`}class Sh{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,$s,{value:Tx});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 jr({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(Sh.prototype,{[$s]:{value:Tx}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Hn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Dl(this.contents)&&this.contents.add(t)}addIn(t,n){Dl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=s5(this);t.anchor=!n||r.has(n)?i5(n||"a",r):n}return new z_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=xge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=Kf(t,d,m);return l&&$n(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Fr(s,i)}delete(t){return Dl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return kd(t)?this.contents==null?!1:(this.contents=null,!0):Dl(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 kd(t)?!n&&un(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 kd(t)?this.contents!==void 0:$n(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Rg(this.schema,[t],n):Dl(this.contents)&&this.contents.set(t,n)}setIn(t,n){kd(t)?this.contents=n:this.contents==null?this.contents=Rg(this.schema,Array.from(t),n):Dl(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 jr({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 jr({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 ek(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Bs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?pc(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 Yge(this,t)}}function Dl(e){if($n(e))return!0;throw new Error("Expected a YAML collection as document contents")}class I5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Nd extends I5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Wge extends I5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const VC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… -`),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(l=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`: - -${a} -${u} -`}};function uu(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",p=!1,m=!1,g=null,w=null,y=null,b=null,x=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),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(w||y)&&(b=S),d=!0;break;case"anchor":w&&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),w=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{y&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),y=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(w||y)&&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){x&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=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],T=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"),g&&(u&&g.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:_,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:y,newlineAfterProp:b,end:T,start:k??T}}function Yf(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(Yf(t.key)||Yf(t.value))return!0}return!1;default:return!0}}function Rx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Yf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function R5(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||un(i)&&un(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const KC="All mapping items must start at the same column";function Gge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Ms,l=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:g}=f,w=uu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",KC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` -`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||Yf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",KC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Rx(r.indent,p,s),n.atKey=!1,R5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=uu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Rx(r.indent,g,s),c=k.range[2];const N=new Fr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` -`+_.comment:x.comment=_.comment);const k=new Fr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function Xge({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Ms:pl),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 y=0;y0){const y=Th(m,g,n.options.strict,s);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Yb(e,t,n,r,s,i){const a=n.type==="block-map"?Gge(e,t,n,r,i):n.type==="block-seq"?qge(e,t,n,r,i):Xge(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function Qge(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Yb(e,t,n,s,a)}const u=Yb(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=Hn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function Zge(e,t,n){const r=t.offset,s=Jge(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?e0e(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` -`.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let g=0;gc&&(c=w.length);else{w.length=l;--g)a[g][0].length>c&&(l=g+1);let f="",h="",p=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` -`:!p&&h===` -`&&(h=` - -`),f+=h+w.slice(c)+y,h=` -`,p=!0):y===""?h===` -`?f+=` -`:h=` -`:(f+=h+y,h=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let g=l;gn(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=n0e(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=r0e(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=s0e(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=Th(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function n0e(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}`),O5(e)}function r0e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),O5(e.slice(1,-1)).replace(/''/g,"'")}function O5(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 i0e(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 a0e={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function o0e(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 l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function L5(e,t,n,r){const{value:s,type:i,comment:a,range:l}=t.type==="block-scalar"?Zge(e,t,r):t0e(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[Ui]:c?u=l0e(e.schema,s,c,n,r):t.type==="scalar"?u=c0e(e,s,t,r):u=e.schema[Ui];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=un(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function l0e(e,t,n,r,s){var l;if(n==="!")return e[Ui];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((l=c.test)!=null&&l.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[Ui])}function c0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[Ui];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[Ui];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function u0e(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 d0e={composeNode:M5,composeEmptyNode:tk};function M5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=f0e(e,t,r),(l||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=L5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Qge(d0e,e,t,n,r),l&&(u.anchor=l.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=tk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!un(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 tk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:u0e(t,n,r),indent:-1,source:""},f=L5(e,d,l,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 f0e({options:e},{offset:t,source:n,end:r},s){const i=new z_(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,l=Th(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function h0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new Sh(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=uu(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?M5(u,s,d,a):tk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Th(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function od(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 YC(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=od(n);i?this.warnings.push(new Wge(a,r,s)):this.errors.push(new Nd(a,r,s))},this.directives=new jr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=YC(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];zn(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${r} -${l}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} -${a}`:r}}if(n){for(let i=0;i{const i=od(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=h0e(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 Nd(od(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 Nd(od(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Th(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 Nd(od(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 Sh(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 j5="\uFEFF",D5="",P5="",Ox="";function m0e(e){switch(e){case j5:return"byte-order-mark";case D5:return"doc-mode";case P5:return"flow-error-end";case Ox: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 ti(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const WC=new Set("0123456789ABCDEFabcdef"),g0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Dp=new Set(",[]{}"),y0e=new Set(` ,[]{} -\r `),Wb=e=>!e||y0e.has(e);class b0e{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==="...")&&ti(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ti(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===":")&&ti(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(Wb),"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=>ti(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 l=i;for(;a===" ";)a=this.buffer[--i];if(a===` -`&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield Ox,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(ti(i)||t&&Dp.has(i))break;n=r}else if(ti(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` -`?(r+=1,s=` -`,i=this.buffer[r+1]):n=r),i==="#"||t&&Dp.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Dp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ox,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(Wb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ti(r)||n&&Dp.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(;!ti(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(g0e.has(n))n=this.buffer[++t];else if(n==="%"&&WC.has(this.buffer[t+1])&&WC.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 E0e{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 Lg(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"&&qC(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&&GC(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 l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(Ua(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(B5(n.key)&&!Ua(n.sep,"newline")){const l=Pl(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:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ua(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Pl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ua(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ua(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(l);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)){Lg(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||Ua(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=Pp(r),i=Pl(s);qC(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={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]=l}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=Pp(t),r=Pl(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=Pp(t),r=Pl(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 w0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new E0e||null,prettyErrors:t}}function v0e(e,t={}){const{lineCounter:n,prettyErrors:r}=w0e(t),s=new x0e(n==null?void 0:n.addNewLine),i=new p0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Nd(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(VC(e,n)),a.warnings.forEach(VC(e,n))),a}function _0e(e,t,n){let r;const s=v0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>u5(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 k0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return vh(e)&&!r?e.toString(n):new Sh(e,r,n).toString(n)}const F5=new Set(["local","sqlite","mysql","postgresql"]),U5=new Set(["local","opensearch","redis","viking","mem0"]),$5=new Set(["opensearch","viking","context_search"]),H5=new Set(["apmplus","cozeloop","tls"]),z5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),N0e=new Set(["llm","sequential","parallel","loop","a2a"]);function wt(e,t=""){return typeof e=="string"?e:t}function Ls(e){return e===!0}function tf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function V5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:wt(t.name),description:wt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Rc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function K5(e){return typeof e=="string"&&N0e.has(e)?e:"llm"}function Y5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function W5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Ls(t.enabled),registrySpaceId:wt(t.registrySpaceId),registryTopK:wt(t.registryTopK),registryRegion:wt(t.registryRegion),registryEndpoint:wt(t.registryEndpoint)}}function G5(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=W5(n.a2aRegistry),i=K5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Pr(),name:wt(n.name),description:wt(n.description),instruction:wt(n.instruction),agentType:a,maxIterations:Y5(n.maxIterations),a2aUrl:wt(n.a2aUrl),modelName:wt(n.modelName),modelProvider:wt(n.modelProvider),modelApiBase:wt(n.modelApiBase),builtinTools:tf(n.builtinTools).filter(l=>z5.has(l)),customTools:V5(n.customTools),memory:{shortTerm:Ls(r.shortTerm),longTerm:Ls(r.longTerm)},shortTermBackend:Rc(n.shortTermBackend,F5,"local"),longTermBackend:Rc(n.longTermBackend,U5,"local"),autoSaveSession:Ls(n.autoSaveSession),knowledgebase:Ls(n.knowledgebase),knowledgebaseBackend:Rc(n.knowledgebaseBackend,$5,Wc),knowledgebaseIndex:wt(n.knowledgebaseIndex),tracing:Ls(n.tracing),tracingExporters:tf(n.tracingExporters).filter(l=>H5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:G5(n.subAgents),selectedSkills:q5(n)}}):[]}function q5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=wt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=wt(r.name)||wt(r.slug)||wt(r.skillName)||wt(r.skillId)||"skill",l=wt(r.folder)||a,c=wt(r.description);if(i==="skillhub"){const f=wt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:wt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=wt(m.path),w=wt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=wt(r.skillSpaceId),d=wt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:wt(r.skillSpaceName),skillId:d,version:wt(r.version)})}return t}function nk(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=W5(t.a2aRegistry),i=K5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:wt(u.name),transport:d,url:wt(u.url),authToken:wt(u.authToken),command:wt(u.command),args:tf(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Pr(),name:wt(t.name)||"my_agent",description:wt(t.description),instruction:wt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:Y5(t.maxIterations),a2aUrl:wt(t.a2aUrl),modelName:wt(t.modelName),modelProvider:wt(t.modelProvider),modelApiBase:wt(t.modelApiBase),builtinTools:tf(t.builtinTools).filter(c=>z5.has(c)),customTools:V5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Ls(n.shortTerm),longTerm:Ls(n.longTerm)},shortTermBackend:Rc(t.shortTermBackend,F5,"local"),longTermBackend:Rc(t.longTermBackend,U5,"local"),autoSaveSession:Ls(t.autoSaveSession),knowledgebase:Ls(t.knowledgebase),knowledgebaseBackend:Rc(t.knowledgebaseBackend,$5,Wc),knowledgebaseIndex:wt(t.knowledgebaseIndex),tracing:Ls(t.tracing),tracingExporters:tf(t.tracingExporters).filter(c=>H5.has(c)),deployment:{feishuEnabled:Ls(r.feishuEnabled)},subAgents:G5(t.subAgents),selectedSkills:q5(t)}}function X5(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||mi.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||mi.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||mi.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),(l=e.modelName)!=null&&l.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,T,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(T=_.authToken)!=null&&T.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(X5)),t}function S0e(e){return`# VeADK Agent 结构配置 -# 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+k0e(X5(e))}function T0e(e){const t=_0e(e);return nk(t)}const A0e=[{kind:"custom",icon:vV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:aV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:tV,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:_V,title:"工作流",desc:"敬请期待",disabled:!0}];function C0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=A0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(T0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(e5,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(xV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const I0e="modulepreload",R0e=function(e){return"/"+e},XC={},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]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=R0e(c),c in XC)return;XC[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":I0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function Q5(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 O0e(e,t){return Q5([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function Z5(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 QC(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const L0e="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",M0e=(()=>{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 j0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Sn(e,t){e.push(t&255,t>>>8&255)}function is(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const ZC=2048,Gb=20,JC=0;function D0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=j0e(g),y=g.length,b=[];is(b,67324752),Sn(b,Gb),Sn(b,ZC),Sn(b,JC),Sn(b,0),Sn(b,0),is(b,w),is(b,y),is(b,y),Sn(b,m.length),Sn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];is(m,33639248),Sn(m,Gb),Sn(m,Gb),Sn(m,ZC),Sn(m,JC),Sn(m,0),Sn(m,0),is(m,p.crc),is(m,p.size),is(m,p.size),Sn(m,p.nameBytes.length),Sn(m,0),Sn(m,0),Sn(m,0),Sn(m,0),is(m,0),is(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];is(c,101010256),Sn(c,0),Sn(c,0),Sn(c,r.length),Sn(c,r.length),is(c,l),is(c,i),Sn(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 P0e=E.lazy(()=>Oc(()=>import("./CodeEditor-CTF8aHas.js"),[]));function B0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function F0e(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 J5({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>B0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return F0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(cT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx(Ds,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(AM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return ps.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(mv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(pr,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(cT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(P0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function U0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(mv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(J5,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Mg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx(Ft,{className:"spin"}):o.jsx(mV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(lV,{}):o.jsx(_c,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(zs,{}):o.jsx(c0,{})})]})]})}const $0e=5e4;function H0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` -`),r=t.split(` -`),s=Math.min(n.length,r.length,260);for(let i=s;i>0;i-=1){const a=n.slice(-i).join(` -`),l=r.slice(0,i).join(` -`);if(a===l){const c=r.slice(i).join(` -`);return c?`${e} -${c}`:e}}return`${e} -${t}`}function z0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` -`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function eI(e,t,n=$0e){const r=H0e((e==null?void 0:e.text)??"",t.text??""),s=z0e(r,n),i=s.text?s.text.split(` -`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}es.registerLanguage("python",aD);es.registerLanguage("typescript",bD);es.registerLanguage("javascript",eD);es.registerLanguage("json",tD);es.registerLanguage("yaml",ED);es.registerLanguage("markdown",iD);es.registerLanguage("bash",G3);es.registerLanguage("ini",q3);es.registerLanguage("dockerfile",hJ);es.registerLanguage("makefile",sD);const V0e=E.lazy(()=>Oc(()=>import("./CodeEditor-CTF8aHas.js"),[])),La=()=>{};function K0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?ps.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(EV,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(pr,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const Y0e={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"},tI={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function nI(e){return e.replace(/&/g,"&").replace(//g,">")}function W0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(tI[n])return tI[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 Y0e[s]??null}function G0e(e,t){try{const n=W0e(t);return n&&es.getLanguage(n)?es.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?es.highlightAuto(e).value:nI(e)}catch{return nI(e)}}const q0e=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],X0e=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function Q0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function Z0e(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 J0e(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function eye({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[ps.createPortal(e,n.left),ps.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function ey({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:T,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:D,deployDisabled:U=!1}){var Kn,vt,an;const W=typeof l=="function",M=f.includes("更新"),$=D?X0e:q0e,[C,j]=E.useState(((vt=(Kn=e==null?void 0:e.files)==null?void 0:Kn[0])==null?void 0:vt.path)??null),[L,P]=E.useState(new Set),[A,z]=E.useState(!1),[G,B]=E.useState(""),[re,Q]=E.useState(!1),[se,de]=E.useState(!1),[te,pe]=E.useState(!1),[ne,ye]=E.useState(!1),[ge,be]=E.useState(null),[xe,ke]=E.useState(null),[Ae,He]=E.useState({}),[Ce,gt]=E.useState(null),[Ge,ze]=E.useState(!1),[le,Ee]=E.useState([]),[ut,ft]=E.useState(!1),[X,ee]=E.useState(!1),me=E.useRef(!0),Le=ue=>o.jsxs("div",{className:"pp-network-region",onKeyDown:Se=>{Se.key==="Escape"&&ee(!1)},children:[ue&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":X,disabled:re||M||!T,onClick:()=>ee(Se=>!Se),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(pv,{className:`pp-region-chevron${X?" is-open":""}`})]}),X&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>ee(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(Se=>{const ve=Se.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":ve,className:`pp-region-option${ve?" is-selected":""}`,onClick:()=>{T==null||T(Se.value),ee(!1)},children:[o.jsx("span",{children:Se.label}),ve&&o.jsx(zs,{"aria-hidden":"true"})]},Se.value)})})]})]});E.useEffect(()=>(me.current=!0,()=>{me.current=!1}),[]),E.useEffect(()=>{if(!te)return;const ue=document.body.style.overflow;document.body.style.overflow="hidden";const Se=ve=>{ve.key==="Escape"&&pe(!1)};return window.addEventListener("keydown",Se),()=>{document.body.style.overflow=ue,window.removeEventListener("keydown",Se)}},[te]);const Ye=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:Q0e(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const Ze=e.files.find(ue=>ue.path===C)??null,Pt=(_==null?void 0:_.mode)??"public",bt=O0e(g?[...y,...Qu]:y,b),Bt=bt.length+le.length;function zt(ue){P(Se=>{const ve=new Set(Se);return ve.has(ue)?ve.delete(ue):ve.add(ue),ve})}function Nt(ue,Se){l&&(l({...e,files:ue}),Se!==void 0&&j(Se))}function Ut(ue){Ze&&Nt(e.files.map(Se=>Se.path===Ze.path?{...Se,content:ue}:Se))}function Be(){const ue=G.trim();if(z(!1),B(""),!!ue){if(e.files.some(Se=>Se.path===ue)){j(ue);return}Nt([...e.files,{path:ue,content:""}],ue)}}function pt(){if(!Ze)return;const ue=window.prompt("重命名文件",Ze.path),Se=ue==null?void 0:ue.trim();!Se||Se===Ze.path||e.files.some(ve=>ve.path===Se)||Nt(e.files.map(ve=>ve.path===Ze.path?{...ve,path:Se}:ve),Se)}function Je(){var Se;if(!Ze)return;const ue=e.files.filter(ve=>ve.path!==Ze.path);Nt(ue,((Se=ue[0])==null?void 0:Se.path)??null)}function Re(ue,Se){Ee(ve=>ve.map(Qe=>Qe.id===ue?{...Qe,...Se}:Qe))}function It(ue){Ee(Se=>Se.filter(ve=>ve.id!==ue))}function St(){Ee(ue=>[...ue,J0e()])}function ce(ue){k&&k(ue==="public"?void 0:{..._??{mode:ue},mode:ue})}function Ve(ue){k==null||k({..._??{mode:"private"},...ue})}function at(){const ue=new Map(le.map(ve=>({key:ve.key.trim(),value:ve.value})).filter(ve=>ve.key.length>0).map(ve=>[ve.key,ve.value])),Se=g?[...y,...Qu]:y;for(const ve of Z5(Se,b))ue.set(ve.key,ve.value);return[...ue].map(([ve,Qe])=>({key:ve,value:Qe}))}async function rn(){if(!(!w||re||ne)){be(null),ye(!0);try{await w(!g)}catch(ue){me.current&&be(`更新飞书配置失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{me.current&&ye(!1)}}}async function sn(){var Se;if(!c||re||U)return;if(Pt!=="public"&&!((Se=_==null?void 0:_.vpcId)!=null&&Se.trim())){be("使用 VPC 网络时,请填写 VPC ID。");return}const ue=QC(y,b);if(ue){const ve=y.find(Qe=>Qe.key===ue.key);be(`请返回配置页填写 ${(ve==null?void 0:ve.comment)||(ve==null?void 0:ve.key)}(${ve==null?void 0:ve.key})。`);return}if(g){const ve=QC(Qu,b);if(ve){const Qe=Qu.find(ot=>ot.key===ve.key);be(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}de(!0)}async function fn(){if(!c||re)return;de(!1);const ue=at();me.current&&(be(null),ke(null),He({}),gt(null),Q(!0));const Se=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ve=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ot={id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ot),p==null||p(ot);let et,lt=ot.phase??"prepare";const Vt=Ue=>et?{...et,status:Ue,updatedAt:Date.now()}:void 0,Kt=Ue=>{const qe=Vt(Ue);return qe?{buildLog:qe}:{}},J=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),rt=Ue=>{if(lt!=="build")return;const qe=["","----- 构建失败 -----",Ue].join(` -`);return et=eI(et,{source:"code-pipeline",status:"error",text:qe,lineCount:qe.split(` -`).length,truncated:!1,updatedAt:Date.now()}),et};try{const Ue=await c(e,qe=>{var Xe;qe.runtimeName&&(ve=qe.runtimeName),lt=qe.phase,qe.buildLog?et=eI(et,qe.buildLog):qe.phase==="build"&&!et&&(et=J()),me.current&&(He(Rt=>({...Rt,[qe.phase]:qe})),gt(qe.phase)),m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:qe.phase,label:((Xe=$.find(Rt=>Rt.phase===qe.phase))==null?void 0:Xe.label)??qe.phase,message:qe.message,pct:qe.pct,...et?{buildLog:et}:{}})},g?{taskId:Se,im:{feishu:{enabled:!0}},envs:ue}:{taskId:Se,envs:ue});me.current&&(ke(Ue),gt(null)),m==null||m({id:Se,runtimeName:Ue.agentName||ve,runtimeId:Ue.runtimeId||h,region:Ue.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...Kt("complete")});try{await(d==null?void 0:d(Ue))}catch(qe){if(!(qe instanceof Ya))throw qe;m==null||m({id:Se,runtimeName:Ue.agentName||ve,runtimeId:Ue.runtimeId||h,region:Ue.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:qe.message,...Kt("complete")})}}catch(Ue){const qe=Ue instanceof Error?Ue.message:String(Ue);if(Ue instanceof DOMException&&Ue.name==="AbortError"){me.current&&(be(null),gt(null)),m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...Kt("complete")});return}me.current&&be(qe);const Xe=rt(qe),Rt=!!Xe;m==null||m({id:Se,runtimeName:ve,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:lt,label:"部署失败",message:Rt?"构建镜像失败,详见构建日志。":qe,...Xe?{buildLog:Xe}:Kt("complete"),retry:sn})}finally{me.current&&Q(!1)}}function Wt(){de(!1)}async function Jt(){if(!(!xe||Ge)){ze(!0),be(null);try{const{addConnection:ue,addRuntimeConnection:Se,remoteAppId:ve,loadConnections:Qe}=await Oc(async()=>{const{addConnection:lt,addRuntimeConnection:Vt,remoteAppId:Kt,loadConnections:J}=await Promise.resolve().then(()=>vT);return{addConnection:lt,addRuntimeConnection:Vt,remoteAppId:Kt,loadConnections:J}},void 0),{probeRuntimeApps:ot}=await Oc(async()=>{const{probeRuntimeApps:lt}=await Promise.resolve().then(()=>eK);return{probeRuntimeApps:lt}},void 0);let et;if(xe.runtimeId){const lt=xe.region??N,Vt=await ot(xe.runtimeId,lt)??[];et=Se(xe.runtimeId,xe.agentName,lt,Vt,Vt.length>0?{[Vt[0]]:xe.agentName}:void 0,xe.version)}else et=await ue(xe.agentName,xe.url,xe.apikey,"");if(et.apps.length===0)be("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const lt={[et.apps[0]]:xe.agentName},Vt={...et,appLabels:{...et.appLabels??{},...lt}},J=Qe().map(Ue=>Ue.id===et.id?Vt:Ue);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(J));const{registerConnections:rt}=await Oc(async()=>{const{registerConnections:Ue}=await Promise.resolve().then(()=>vT);return{registerConnections:Ue}},void 0);if(rt(J),u){const Ue=ve(et.id,et.apps[0]);u(Ue,xe.agentName)}else alert(`🎉 Agent "${xe.agentName}" 已添加到左上角下拉列表!`)}}catch(ue){be(`添加 Agent 失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ze(!1)}}}function Mn(){const ue=D0e(e.files),Se=URL.createObjectURL(ue),ve=document.createElement("a");ve.href=Se,ve.download=`${e.name||"project"}.zip`,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(Se)}function Vn(ue,Se,ve){return Z0e(ue).map(Qe=>{const ot=ve?`${ve}/${Qe.name}`:Qe.name,et=Qe.path!==void 0,lt={paddingLeft:8+Se*14};if(et){const Kt=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${Kt?" pp-active":""}`,style:lt,onClick:()=>j(Qe.path),title:Qe.path,children:[o.jsx(Wz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ot)}const Vt=L.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:lt,onClick:()=>zt(ot),children:[o.jsx(Ds,{className:`pp-ic pp-chevron${Vt?"":" pp-open"}`}),o.jsx(AM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Vt&&Vn(Qe,Se+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${D?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(eye,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(hv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!D&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Cg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>pe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(_c,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx(Vz,{className:"pp-ic"}),"导出配置文件"]}),W&&l&&o.jsx(U0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:Mn,children:[o.jsx(u0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),W&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{z(!0),B("")},children:o.jsx(Kz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[A&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:G,onChange:ue=>B(ue.target.value),onBlur:Be,onKeyDown:ue=>{ue.key==="Enter"&&Be(),ue.key==="Escape"&&(z(!1),B(""))}}),e.files.length===0&&!A?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):Vn(Ye,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:Ze==null?void 0:Ze.path,children:(Ze==null?void 0:Ze.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:W&&Ze&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:pt,children:o.jsx(fV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Je,children:o.jsx(Fi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:Ze==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):W?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(V0e,{value:Ze.content,path:Ze.path,onChange:Ut})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:G0e(Ze.content,Ze.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[D,!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),Le(!1)]}),!D&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void rn(),disabled:g||re||ne||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:L0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:ne?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void rn(),disabled:!g||re||ne||!w,children:ne?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:Qu.map(ue=>o.jsxs("label",{children:[o.jsxs("span",{children:[ue.comment||ue.key,ue.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:ue.key.includes("SECRET")?"password":"text",value:b[ue.key]??"",placeholder:ue.placeholder,tabIndex:g?0:-1,disabled:!g||re||!x,autoComplete:"off",onChange:Se=>x==null?void 0:x(ue.key,Se.currentTarget.value)})]},ue.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),D&&Le(!0),M&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ue=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:ue,checked:Pt===ue,onChange:()=>ce(ue),disabled:re||M||!k}),o.jsx("span",{children:ue==="public"?"公网":ue==="private"?"VPC":"公网 + VPC"})]},ue))}),Pt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:re||M,onChange:ue=>Ve({vpcId:ue.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:re||M,onChange:ue=>Ve({subnetIds:ue.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:re||M,onChange:ue=>Ve({enableSharedInternetAccess:ue.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Bt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:ut?"隐藏值":"显示值",onClick:()=>ft(ue=>!ue),children:ut?o.jsx(Hz,{className:"pp-ic"}):o.jsx(yv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:St,disabled:re,children:[o.jsx(dr,{className:"pp-ic"}),"添加变量"]}),(bt.length>0||le.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[bt.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[bt.length," 项"]})]}),bt.map(ue=>{const Se=ue.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:ue.key,readOnly:!0,disabled:re,"aria-label":`${ue.key} 环境变量名`}),o.jsx("input",{type:Se||ut?"text":"password",value:ue.value,placeholder:ue.required?"必填,尚未填写":"可选,尚未填写",readOnly:Se,disabled:re||!Se&&!x,autoComplete:"off","aria-label":`${ue.key} 环境变量值`,onChange:ve=>x==null?void 0:x(ue.key,ve.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:Se?"自动":"同步"})]},ue.key)})]}),le.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[le.length," 项"]})]}),le.map(ue=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:ue.key,placeholder:"名称",disabled:re,autoComplete:"off",onChange:Se=>Re(ue.id,{key:Se.currentTarget.value})}),o.jsx("input",{type:ut?"text":"password",value:ue.value,placeholder:"值",disabled:re,autoComplete:"off",onChange:Se=>Re(ue.id,{value:Se.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:re,onClick:()=>It(ue.id),children:o.jsx(pr,{className:"pp-ic"})})]},ue.id))]})]}),(re||xe||Object.keys(Ae).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:$.map((ue,Se)=>{const ve=Ce?$.findIndex(lt=>lt.phase===Ce):-1,Qe=!!ge&&(ve===-1?Se===0:Se===ve);let ot;xe?ot="done":Qe?ot="failed":ve===-1?ot=re?"active":"pending":Seue.phase===Ce))==null?void 0:an.label)??Ce}阶段):`:""}${ge}`,onRetry:sn,retryLabel:M?"重试更新":"重试部署"}),xe&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:M?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[xe.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:xe.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:xe.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:xe.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:Jt,disabled:Ge,children:[Ge?o.jsx(Ft,{className:"pp-ic spin"}):o.jsx(RM,{className:"pp-ic"}),Ge?"连接中…":"立即对话"]}),xe.consoleUrl&&o.jsxs("a",{href:xe.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(gv,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:sn,disabled:re||ne||U||!!n,title:n,children:re?`${f}中…`:ge?`重试${f}`:f})})]})]}),te&&r&&ps.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:ue=>{ue.target===ue.currentTarget&&pe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>pe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(pr,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Cg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:La,onAdd:La,onInsert:La,onDelete:La,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(K0e,{open:se,isUpdate:M,onCancel:Wt,onConfirm:()=>void fn()})]})}const rI="dogfooding",qb="dogfooding",Xb="dogfooding_b";let tye=0;const Qb=()=>++tye;function sI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function nye(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function iI(e){const t=[],n=nye(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 Mv(nk(a))}catch{}return null}function rye({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Qb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[T,S]=E.useState(!1),[R,I]=E.useState({}),D=E.useRef(null),U=E.useRef(null),W=E.useRef(null),M=E.useRef(null),$=E.useRef(null);E.useEffect(()=>{const Q=M.current;Q&&Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const Q=$.current;Q&&(Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,160)+"px")},[l]);const C=Q=>a(se=>[...se,{id:Qb(),role:"assistant",text:Q}]);async function j(){if(D.current)return D.current;const Q=await ng(rI,e);return D.current=Q,Q}async function L(Q,se){if(se.current)return se.current;const de=await ng(Q,e);return se.current=de,de}async function P(Q,se){if(!R[Q])try{const de=await Rv(se);I(te=>({...te,[Q]:de.model||se}))}catch{I(de=>({...de,[Q]:se}))}}async function A(Q,se,de){const te=await L(Q,se);let pe=ci();for await(const ye of Tf({appName:Q,userId:e,sessionId:te,text:de}))pe=Vc(pe,ye);const ne=sI(pe).trim();return{project:await iI(ne),finalText:ne}}const z=async(Q,se,de)=>m0(Q.name,Q.files,{region:"cn-beijing",projectName:"default"},{...de,onStage:se}),G=async()=>{const Q=l.trim();if(!(!Q||u)){if(a(se=>[...se,{id:Qb(),role:"user",text:Q}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),P("a",qb),P("b",Xb);const se=A(qb,U,Q).then(({project:te})=>(b(te),te)).catch(te=>{const pe=te instanceof Error?te.message:String(te);return h(pe),null}).finally(()=>N(!1)),de=A(Xb,W,Q).then(({project:te})=>(_(te),te)).catch(te=>{const pe=te instanceof Error?te.message:String(te);return h(pe),null}).finally(()=>S(!1));try{const[te,pe]=await Promise.all([se,de]),ne=[te?`方案 A:${te.name}`:null,pe?`方案 B:${pe.name}`:null].filter(Boolean);ne.length?C(`已生成两个方案(${ne.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const se=await j();let de=ci();for await(const ne of Tf({appName:rI,userId:e,sessionId:se,text:Q}))de=Vc(de,ne);const te=sI(de).trim(),pe=await iI(te);pe?(m(pe),C(`已生成项目:${pe.name}(${pe.files.length} 个文件),可在右侧预览和编辑。`)):C(te||"(助手没有返回内容,请再描述一下你的需求。)")}catch(se){const de=se instanceof Error?se.message:String(se);h(de),C(`抱歉,调用智能构建助手失败:${de}`)}finally{d(!1)}}},B=Q=>{const se=Q==="a"?y:x;if(!se)return;m(se),w(!1),b(null),_(null),N(!1),S(!1);const de=Q==="a"?"A":"B",te=Q==="a"?R.a:R.b;C(`已采用方案 ${de}(${te??(Q==="a"?qb:Xb)}),可继续编辑。`)},re=Q=>{Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),G())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:M,children:[o.jsx(oi,{initial:!1,children:i.map(Q=>o.jsxs(Zt.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"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:Q.role==="assistant"?o.jsx(ph,{text:Q.text}):Q.text})]},Q.id))}),u&&o.jsxs(Zt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(il,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(l0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:$,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:Q=>c(Q.target.value),onKeyDown:re,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(gV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:Q=>w(Q.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(aI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>B("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(aI,{side:"b",project:x,loading:T,model:R.b,onAdopt:()=>B("b")})]}):p?o.jsx(ey,{project:p,onChange:m,onDeploy:z,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(qz,{className:"ic-preview-empty-glyph"}),o.jsx(al,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function aI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx(Ft,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(ey,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const sye=/^[A-Za-z_][A-Za-z0-9_]*$/;function Lc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":sye.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function eB(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 iye({className:e,...t}){return o.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:[o.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"}),o.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 ld={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:iye},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:Xz},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:bV},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:wv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:d0}},aye=[ld.llm,ld.sequential,ld.parallel,ld.loop,ld.a2a],tB=e=>e==="sequential"||e==="parallel"||e==="loop",ty=e=>e==="a2a";function Hs(e){return e.trimEnd().replace(/[。.]+$/,"")}function jg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function To(e,t){return e[t]|e[t+1]<<8}function Bl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function oye(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 nB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(Bl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=To(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=Bl(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=To(e,w+26),x=To(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await oye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const lye="/skillhub/v1/skills";async function cye(e,t="public"){const n=e.trim(),r=`${lye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:pi(void 0,gu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function uye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await cye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(Sf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx(Ft,{className:"cw-i cw-spin"}):o.jsx(Sf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const Lx=/(^|\/)skill\.md$/i;function dye(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 hye(...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 pye(e,t){return t.trim()||e}function rB(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 mye(e){const t=new Map,n=new Set;for(const r of e)if(Lx.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=Lx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function gye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>Lx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=dye(s.text),a=hye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:pye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function yye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await nB(t)).map(s=>({path:s.name,text:s.text}));return sB(rB(r),e.name)}async function bye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function xye(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 iB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await Eye(e),path:n}];if(!e.isDirectory)return[];const r=await xye(e);return(await Promise.all(r.map(s=>iB(s,n)))).flat()}function wye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const T=[...x.errors];if(k.length>0&&T.push(`已跳过重复技能:${k.join("、")}`),r(T),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>iB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await yye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(k.map(({file:S,path:R})=>[S,R]));g(await bye(k.map(({file:S})=>S),T))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(Ev,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function vye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Tj();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Aj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=XK(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(Ft,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${Hs(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:QK(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(gv,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx(Ft,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(zs,{className:"cw-i cw-i-sm"}):o.jsx(dr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Hs(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Bz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function _ye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 kye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await _ye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Nye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:pi(void 0,gu)});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 Sye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Nye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const oI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function Zb(e){let t=0;for(let n=0;n>>0;return oI[t%oI.length]}function Tye(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)),l=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:l,total:c-l||1}}function Aye(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 lI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const Cye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function cI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:Cye(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function aB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=mj(t,n);else if(e)_=ZM(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,T)=>N.start_time<=T.start_time?N:T).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>Tye(i??[]),[i]),w=E.useMemo(()=>Aye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(pr,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,T=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx(Ds,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:Zb(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:lI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${T}%`,background:Zb(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:Zb(y.name)}}),lI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:cI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),cI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const Iye=E.lazy(()=>Oc(()=>import("./MarkdownPromptEditor-CD1RMBf6.js"),__vite__mapDeps([0,1]))),Mx="veadk.generatedAgentTestRuns";function rk(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Mx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function oB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Mx,JSON.stringify(t)):window.sessionStorage.removeItem(Mx)}catch{}}function Rye(e){oB([...rk(),e])}function cd(e){oB(rk().filter(t=>t!==e))}function Oye(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 uI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:yV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:mo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Uz},{id:"tools",label:"工具",hint:"可调用的能力",icon:MM},{id:"skills",label:"技能",hint:"声明式技能",icon:al},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:rm},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:CM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:NM},{id:"review",label:"完成",hint:"预览并创建",icon:pV}];function Lye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function lB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function cB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Mye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},dI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},fI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},uB="REGISTRY_SPACE_ID",jye=Cj.filter(e=>e.key!==uB);function dB(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())||mi.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||mi.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||mi.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function hI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(zs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:Hs(s.desc)})]})]},s.id)})})}function Jb({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Hs(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:Hs(r.desc)})]},r.id)})})}function Dye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function Fl({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:Dye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function e1(e){return e.name.trim()||"未命名智能体中心"}function t1(e){return e.name.trim()||e.id||"未命名知识库"}function Pye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||mi.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),kye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?e1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>jg(g,[e1(R),R.id,R.projectName])),[g,i]),T=!!(e&&!b&&jg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=D=>{const U=D.target;U instanceof Node&&y.current&&!y.current.contains(U)&&m(!1)},I=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(lB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=e1(R),D=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":D,className:`cw-a2a-space-option ${D?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!T&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(cB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Bye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),Sye().then(T=>{N||r(T)}).catch(T=>{N||(r([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?t1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>jg(h,[t1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&jg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},T=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(lB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const T=t1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${T} (${N.id})`,onClick:()=>k(N.id),children:T},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(cB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(Ft,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Fye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(oi,{initial:!1,children:e.map((i,a)=>o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(Fi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(dr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function fB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Uye({s:e,onRemove:t}){let n=al,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Ev,r="本地"):e.source==="skillspace"&&(n=fB,r="AgentKit Skills 中心"),o.jsxs(Zt.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Hs(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(pr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const n1=[{id:"local",label:"本地文件",icon:Ev},{id:"skillspace",label:"AgentKit Skills 中心",icon:fB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:d0}];function $ye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=n1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>r1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(dr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(oi,{initial:!1,children:e.map(c=>o.jsx(Uye,{s:c,onRemove:()=>l(r1(c))},r1(c)))})})]}),o.jsx(oi,{children:s&&o.jsx(Zt.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:o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(pr,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${n1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),n1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(uye,{selected:e,onChange:t}),n==="local"&&o.jsx(wye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(vye,{selected:e,onChange:t})]})]})]})})})]})}function r1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function ud({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:Hs(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(Zt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Hye(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 Bp(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Ah(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Ah(i[r],s,n),{...e,subAgents:i}}function zye(e,t){return Ah(e,t,n=>({...n,subAgents:[...n.subAgents,Pr()]}))}function Vye(e,t,n){return Ah(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Pr()),{...r,subAgents:s}})}function Kye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Ah(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const jx=e=>!ty(e.agentType),pI=3;function Yye(e,t,n=!1){var s;if(ty(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?"缺少描述":tB(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function hB(e,t,n=[]){const r=[],s=ty(e.agentType),i=Yye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),jx(e)&&e.subAgents.forEach((a,l)=>r.push(...hB(a,t,[...n,l]))),r}function pB(e){return 1+e.subAgents.reduce((t,n)=>t+pB(n),0)}function mB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=ol.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Cj}),Object.assign(n,dB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=PE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=BE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=FE.find(d=>d.id===(i.knowledgebaseBackend??Wc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=UE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=Q5(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function gB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Wye(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 yB(e){var r,s;const t=mB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...gB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(Z5(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Gye(e){return JSON.stringify(yB(e))}function Dg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function gc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function qye({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===Dg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),T=gc(b),S=!!(_&&k&&N&&n.findIndex(L=>gc(L)===T)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==Dg(r,b)),D=b.phase==="starting",U=b.phase==="ready"&&!I,W=D||b.phase==="sending",M=U&&b.phase!=="sending"&&b.messages.some(L=>L.role==="assistant"),$=W||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",j=D?"正在启动":I?"应用配置并重启":U||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||W,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||W,onClick:()=>d(b.id),children:o.jsx(Fi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Mg,{message:b.error,className:"cw-debug-error-detail"}):D?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(Ft,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:U?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((L,P)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${L.role}`,children:o.jsx("div",{className:"cw-debug-content",children:L.role==="user"?L.content:L.error?o.jsx(Mg,{message:L.error,className:"cw-debug-msg-error"}):L.blocks&&L.blocks.length>0?o.jsx(F_,{blocks:L.blocks,onAction:()=>{}}):L.content?L.content:P===b.messages.length-1&&b.phase==="sending"?o.jsx(Q6,{}):null})},P))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!M,title:M?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:$,title:C||void 0,onClick:()=>l(b.id),children:[U||I||b.phase==="error"?o.jsx(LM,{className:"cw-i"}):o.jsx(Lye,{className:"cw-i cw-debug-run-icon"}),j]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:W||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:L=>p(b.id,"modelName",L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:L=>p(b.id,"description",L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:L=>p(b.id,"instruction",L.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:bB.map(L=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(L.id),disabled:!0}),o.jsx("span",{children:L.label})]},L.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(dr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{Z6(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx(Ft,{className:"cw-i cw-spin"}):o.jsx(_M,{className:"cw-i"})})]})})]})}const mI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],bB=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Xye({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=mI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:mI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function Qye({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var wa,nr,va,Yi,Nl,Sl,_a,ka,Na,Tl,bo,Gs,_t,Eo,V;const[h,p]=E.useState(()=>r??Pr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),T=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var O;S!==T.current&&(T.current=S,(O=I.current)==null||O.call(I,h,R))},[h,R,S]);const[D,U]=E.useState("build"),[W,M]=E.useState(!1),[$,C]=E.useState(!1),[j,L]=E.useState(0),[P,A]=E.useState(null),[z,G]=E.useState(!1),[B,re]=E.useState((a==null?void 0:a.region)??l),Q=(s==null?void 0:s.generatedAgentTestRun)===!0,se=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[de,te]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Pr()).modelName??"",description:(r??Pr()).description,instruction:(r??Pr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[pe,ne]=E.useState("baseline"),ye=E.useRef(1),ge=E.useRef(new Map),[be,xe]=E.useState(0),[ke,Ae]=E.useState(""),[He,Ce]=E.useState(null),[gt,Ge]=E.useState("basic"),[ze,le]=E.useState(""),[Ee,ut]=E.useState(!1),[ft,X]=E.useState(!1),[ee,me]=E.useState(!1),[Le,Ye]=E.useState(!1),[Ze,Pt]=E.useState([]),bt=E.useRef(null),Bt=E.useRef({});async function zt(){const O=new Set([...ge.current.values()].map(({run:oe})=>oe.runId)),q=rk().filter(oe=>!O.has(oe));q.length&&await Promise.all(q.map(async oe=>{try{await $l(oe),cd(oe)}catch(Pe){console.warn("清理遗留调试运行失败",Pe)}}))}E.useEffect(()=>(zt(),()=>{for(const{run:O}of ge.current.values())$l(O.runId).then(()=>cd(O.runId)).catch(q=>console.warn("清理调试运行失败",q));ge.current.clear()}),[]);const Nt=E.useRef(null);Nt.current||(Nt.current=({meta:O,children:q})=>o.jsxs("section",{ref:oe=>{Bt.current[O.id]=oe},id:`cw-sec-${O.id}`,"data-step-id":O.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[O.label,O.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),q]}));const Ut=Hye(h,Ze)?Ze:[],Be=Bp(h,Ut),pt=Ut.length===0,Je=`cw-model-advanced-${Ut.join("-")||"root"}`,Re=`cw-a2a-registry-advanced-${Ut.join("-")||"root"}`,It=`cw-more-tool-types-${Ut.join("-")||"root"}`,St=`cw-advanced-config-${Ut.join("-")||"root"}`,ce=O=>p(q=>Ah(q,Ut,oe=>({...oe,...O}))),Ve=(O,q)=>p(oe=>{var Pe;return{...oe,deployment:{...oe.deployment??{feishuEnabled:!1},envValues:{...((Pe=oe.deployment)==null?void 0:Pe.envValues)??{},[O]:q}}}}),at=O=>ce({a2aRegistry:{...Be.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...O}}),rn=(O,q)=>{if(!(O in fI))return;const oe=fI[O];at({[oe]:q}),Ve(O,q)},sn=O=>{if(!(pt&&O==="a2a")){if(O==="a2a"){ce({agentType:O,a2aRegistry:{...Be.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}ce({agentType:O,a2aRegistry:Be.a2aRegistry?{...Be.a2aRegistry,enabled:!1}:void 0})}},fn=(O,q)=>{p(O),q&&Pt(q)},Wt=async()=>{const O=m.trim();if(!(!O||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),le("");try{const q=await fj(O);p(nk(q.draft)),Pt([]),A(null),C(!1),le(""),x(!0)}catch(q){k(q instanceof Error?q.message:"生成 Agent 配置失败")}finally{y(!1)}}},Jt=O=>{const q=Bp(h,O);if(!jx(q)||O.length>=pI)return;const oe=zye(h,O),Pe=Bp(oe,O).subAgents.length-1;fn(oe,[...O,Pe])},Mn=(O,q)=>{const oe=Bp(h,O);if(!jx(oe)||O.length>=pI)return;const Pe=Math.max(0,Math.min(q,oe.subAgents.length)),nt=Vye(h,O,Pe);fn(nt,[...O,Pe])},Vn=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Pr()),Pt([]),C(!1),Ye(!1))},Kn=O=>{if(O.length===0){Vn();return}fn(Kye(h,O),O.slice(0,-1))},vt=Be.builtinTools??[],an=Be.mcpTools??[],ue=Be.tracingExporters??[],Se=Be.selectedSkills??[],ve=[Be.memory.shortTerm,Be.memory.longTerm,Be.tracing].filter(Boolean).length,Qe=O=>ce({builtinTools:vt.includes(O)?vt.filter(q=>q!==O):[...vt,O]}),ot=O=>{const q=ue.includes(O)?ue.filter(oe=>oe!==O):[...ue,O];ce({tracingExporters:q,tracing:q.length>0?!0:Be.tracing})},et=tB(Be.agentType),lt=ty(Be.agentType),Vt=E.useMemo(()=>eB(h),[h]),Kt=lt?null:Lc(Be.name)??(Vt.has(Be.name)?"Agent 名称在当前结构中必须唯一":null),J=Kt!==null,rt=!lt&&Be.description.trim().length===0,Ue=Be.instruction.trim().length===0,qe=lt&&!((wa=Be.a2aRegistry)!=null&&wa.registrySpaceId.trim()),Xe=O=>$&&O?`is-error cw-error-shake-${j%2}`:"",Rt=E.useMemo(()=>hB(h,Vt),[h,Vt]),Yn=Rt.length===0,Wn=E.useMemo(()=>Gye(h),[h]),en=de.find(O=>O.id===pe)??de[0],vn=E.useMemo(()=>mB(h),[h]),Yt=E.useMemo(()=>{var O,q,oe,Pe;return{type:!0,basic:lt?!qe:!J&&(et||!Ue),model:!!((O=Be.modelName)!=null&&O.trim()||(q=Be.modelProvider)!=null&&q.trim()||(oe=Be.modelApiBase)!=null&&oe.trim()),tools:vt.length>0||an.length>0,skills:Se.length>0,knowledge:Be.knowledgebase,advanced:Be.memory.shortTerm||Be.memory.longTerm||Be.tracing,subagents:(((Pe=Be.subAgents)==null?void 0:Pe.length)??0)>0,review:Yn}},[Be,J,Ue,et,lt,Yn,vt,an,Se]),kn=et||lt?["type","basic"]:["type","basic","model","tools","skills","knowledge",...pt?["advanced"]:[]],Mt=uI.filter(O=>kn.includes(O.id)),Nn=kn.join("|"),mr=Ut.join("."),Lt=Mt.findIndex(O=>O.id===gt),jn=O=>{var q;(q=Bt.current[O])==null||q.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(P)return;const O=bt.current;if(!O)return;const q=Nn.split("|");let oe=0;const Pe=()=>{oe=0;const it=q[q.length-1];let tn=q[0];if(O.scrollTop+O.clientHeight>=O.scrollHeight-2)tn=it;else{const We=O.getBoundingClientRect().top+24;for(const Gt of q){const Et=Bt.current[Gt];if(!Et||Et.getBoundingClientRect().top>We)break;tn=Gt}}tn&&Ge(We=>We===tn?We:tn)},nt=()=>{oe||(oe=window.requestAnimationFrame(Pe))};return Pe(),O.addEventListener("scroll",nt,{passive:!0}),window.addEventListener("resize",nt),()=>{O.removeEventListener("scroll",nt),window.removeEventListener("resize",nt),oe&&window.cancelAnimationFrame(oe)}},[P,Nn,mr]);const lr=()=>Yn?!0:(C(!0),L(O=>O+1),Rt[0]&&(Pt(Rt[0].path),window.requestAnimationFrame(()=>jn("basic"))),!1),gr=async()=>{Ce(null);const O=[...ge.current.values()];ge.current.clear(),xe(0),te(q=>q.map(oe=>({...oe,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(O.map(async({run:q})=>{try{await $l(q.runId),cd(q.runId)}catch(oe){console.warn("清理调试运行失败",oe)}}))},Ar=async O=>{const q=ge.current.get(O);if(q){ge.current.delete(O),xe(ge.current.size);try{await $l(q.run.runId),cd(q.run.runId)}catch(oe){console.warn("清理调试运行失败",oe)}}},Ks=O=>{const q=ge.current.get(O),oe=de.find(Pe=>Pe.id===O);!q||!oe||Ce({runId:q.run.runId,sessionId:q.sessionId,variantName:oe.name})},Hr=async()=>D!=="validate"||be===0?!0:window.confirm("离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。")?(await gr(),!0):!1,ns=async O=>{if(await Hr()){if(le(""),!lr()){U("build");return}G(!0);try{const q=O?de.find(nt=>nt.id===O):en;q&&ne(q.id);const oe=q?{...h,modelName:q.modelName||h.modelName,description:q.description,instruction:q.instruction}:h,Pe=await Mv(gB(oe));oe!==h&&p(oe),A(Pe),U("publish")}catch(q){le(q instanceof Error?q.message:String(q))}finally{G(!1)}}},Ys=async O=>{if(!Q||z||!lr())return;const q=de.find(Dn=>Dn.id===O);if(!q||q.phase==="starting"||q.phase==="sending")return;const oe=q.modelName.trim(),Pe=q.description.trim(),nt=q.instruction.trim(),it=gc(q),tn=de.findIndex(Dn=>Dn.id===O),We=de.findIndex(Dn=>gc(Dn)===it);if(!oe||!Pe||!nt||We!==tn)return;const Gt=Dg(Wn,q);te(Dn=>Dn.map($t=>$t.id===O?{...$t,configOpen:!1,phase:"starting",messages:[],error:null}:$t)),Ae("");let Et=null;try{await Ar(O),await zt();const Dn={...h,modelName:q.modelName||h.modelName,description:q.description,instruction:q.instruction};Et=await hj(yB(Dn)),Rye(Et.runId);const $t=await pj(Et.runId,"test_user");ge.current.set(O,{run:Et,sessionId:$t}),xe(ge.current.size),te(vs=>vs.map(qs=>qs.id===O?{...qs,phase:"ready",runtimeSnapshot:Gt}:qs))}catch(Dn){if(Et)try{await $l(Et.runId),cd(Et.runId)}catch($t){console.warn("清理调试运行失败",$t)}te($t=>$t.map(vs=>vs.id===O?{...vs,phase:"error",runtimeSnapshot:"",error:Dn instanceof Error?Dn.message:String(Dn)}:vs))}},Es=async()=>{const O=ke.trim(),q=de.filter(Pe=>Pe.phase==="ready"&&Pe.runtimeSnapshot===Dg(Wn,Pe)&&ge.current.has(Pe.id));if(!O||q.length===0)return;Ae("");const oe=new Set(q.map(Pe=>Pe.id));te(Pe=>Pe.map(nt=>oe.has(nt.id)?{...nt,phase:"sending",messages:[...nt.messages,{role:"user",content:O},{role:"assistant",content:"",blocks:[]}]}:nt)),await Promise.all(q.map(async Pe=>{const nt=ge.current.get(Pe.id);if(nt)try{let it=ci();for await(const tn of gj({runId:nt.run.runId,userId:"test_user",sessionId:nt.sessionId,text:O})){const We=tn.error||tn.errorMessage||tn.error_message;if(te(Gt=>Gt.map(Et=>{if(Et.id!==Pe.id)return Et;const Dn=[...Et.messages],$t={...Dn[Dn.length-1]};return We?$t.error=String(We):(it=Vc(it,tn),$t.content=it.blocks.filter(vs=>vs.kind==="text").map(vs=>vs.text).join(""),$t.blocks=it.blocks),Dn[Dn.length-1]=$t,{...Et,messages:Dn}})),We)break}}catch(it){te(tn=>tn.map(We=>{if(We.id!==Pe.id)return We;const Gt=[...We.messages],Et={...Gt[Gt.length-1]};return Et.error=it instanceof Error?it.message:String(it),Gt[Gt.length-1]=Et,{...We,messages:Gt}}))}finally{te(it=>it.map(tn=>tn.id===Pe.id?{...tn,phase:"ready"}:tn))}}))},Vi=()=>{te(O=>{if(O.length>=3)return O;const q=ye.current++,oe=`variant-${q}`;return[...O,{id:oe,name:`对照组 ${q}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},Cr=async O=>{await Ar(O),te(q=>q.filter(oe=>oe.id!==O)),pe===O&&ne("baseline")},Ki=(O,q)=>te(oe=>oe.map(Pe=>Pe.id===O?{...Pe,...q}:Pe)),xa=(O,q,oe)=>{Ki(O,{[q]:oe}),!(pe!==O||O==="baseline")&&ne("baseline")},vi=O=>{const q=de.find(Gt=>Gt.id===O);if(!q)return;const oe=q.modelName.trim(),Pe=q.description.trim(),nt=q.instruction.trim(),it=gc(q),tn=de.findIndex(Gt=>Gt.id===O),We=de.findIndex(Gt=>gc(Gt)===it);if(!(!oe||!Pe||!nt||We!==tn)){if(O==="baseline"){Ki(O,{configOpen:!1});return}Ys(O)}},Iu=async(O,q,oe)=>{var it;const Pe=(it=h.deployment)==null?void 0:it.network,nt=Pe&&Pe.mode&&Pe.mode!=="public"?{mode:Pe.mode,vpc_id:Pe.vpcId,subnet_ids:Pe.subnetIds,enable_shared_internet_access:Pe.enableSharedInternetAccess}:void 0;return m0(O.name,O.files,{region:(a==null?void 0:a.region)??B,projectName:"default",network:nt},{...oe,onStage:q,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},Ws=()=>{lr()&&(te(O=>O.map(q=>q.id==="baseline"&&!ge.current.has(q.id)?{...q,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:q)),U("validate"))},Ru=async O=>{if(O==="publish"){P?U("publish"):ns();return}if(O==="validate"){Ws();return}await Hr()&&U(O)},xs=Nt.current,ws=O=>uI.find(q=>q.id===O);return o.jsxs("div",{className:"cw-root",children:[o.jsx(Xye,{mode:D,agentName:Wye(h),busy:z,onChange:Ru,onDiscard:f?()=>{R?M(!0):f()}:void 0}),ze&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:ze}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[D==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(oi,{initial:!1,mode:"wait",children:b?o.jsxs(Zt.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(Zt.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:O=>{O.preventDefault(),Wt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:O=>g(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),Wt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Cg,{draft:h,direction:"vertical",selectedPath:Ut,onSelect:Pt,onAdd:Jt,onInsert:Mn,onDelete:Kn}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:bt,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsx(xs,{meta:ws("type"),children:o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:aye.map(O=>{const q=(Be.agentType??"llm")===O.id,oe=pt&&O.id==="a2a",Pe=oe?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":O.id,className:`cw-agent-type-option ${q?"is-on":""} ${oe?"is-disabled":""}`,title:oe?void 0:dI[O.id],tabIndex:oe?0:void 0,"aria-describedby":Pe,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:q,disabled:oe,onChange:()=>sn(O.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Mye[O.id]}),o.jsx("small",{children:dI[O.id]})]}),oe&&o.jsx("span",{id:Pe,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},O.id)})})}),o.jsx(xs,{meta:ws("basic"),children:o.jsxs("div",{className:"cw-form",children:[!lt&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pt?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Xe(J)}`,value:Be.name,placeholder:"customer_service",onChange:O=>ce({name:O.target.value})}),$&&Kt?o.jsx("span",{className:"cw-error-text",children:Kt}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pt?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Xe(rt)}`,value:Be.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:O=>ce({description:O.target.value})}),$&&rt?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:pt?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),et?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Be.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:Be.maxIterations??3,onChange:O=>ce({maxIterations:Math.max(1,Number(O.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):lt?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(Pye,{value:((nr=Be.a2aRegistry)==null?void 0:nr.registrySpaceId)??"",region:((va=Be.a2aRegistry)==null?void 0:va.registryRegion)||mi.region,invalid:$&&qe,onChange:O=>rn(uB,O)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ft,"aria-controls":Re,onClick:()=>X(O=>!O),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${ft?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ft&&o.jsx(Zt.div,{id:Re,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:o.jsx(Fl,{env:jye,values:dB(Be.a2aRegistry,{includeDefaults:!1}),onChange:rn})})}),$&&qe&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(Iye,{value:Be.instruction,invalid:Ue,onChange:O=>ce({instruction:O})})}),$&&Ue?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!et&&!lt&&o.jsxs(o.Fragment,{children:[o.jsx(xs,{meta:ws("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:Be.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:O=>ce({modelName:O.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Ee,"aria-controls":Je,onClick:()=>ut(O=>!O),children:[o.jsx("span",{children:"更多选项"}),o.jsx(Ds,{className:`cw-more-options-chevron ${Ee?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:Ee&&o.jsxs(Zt.div,{id:Je,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:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:Be.modelProvider??"",placeholder:"openai",onChange:O=>ce({modelProvider:O.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:Be.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:O=>ce({modelApiBase:O.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(xs,{meta:ws("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(hI,{items:ol,selected:vt,onToggle:Qe,scrollRows:6})}),o.jsx(oi,{initial:!1,children:vt.includes("run_code")&&o.jsxs(Zt.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(Fl,{env:((Yi=ol.find(O=>O.id==="run_code"))==null?void 0:Yi.env)??[],values:((Nl=h.deployment)==null?void 0:Nl.envValues)??{},onChange:Ve})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ee,"aria-controls":It,onClick:()=>me(O=>!O),children:[o.jsx("span",{children:"更多类型工具"}),an.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",an.length]}),o.jsx(Ds,{className:`cw-more-options-chevron ${ee?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(oi,{initial:!1,children:ee&&o.jsx(Zt.div,{id:It,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(Fye,{tools:an,onChange:O=>ce({mcpTools:O})})]})})})]})}),o.jsx(xs,{meta:ws("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx($ye,{selected:Se,onChange:O=>ce({selectedSkills:O})})})}),o.jsx(xs,{meta:ws("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.knowledgebase,onChange:O=>ce({knowledgebase:O}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:rm}),Be.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(Jb,{options:FE,value:Be.knowledgebaseBackend,onChange:O=>ce({knowledgebaseBackend:O,knowledgebaseIndex:O==="viking"?Be.knowledgebaseIndex:""})}),(Be.knowledgebaseBackend??Wc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(Bye,{value:Be.knowledgebaseIndex??"",onChange:O=>ce({knowledgebaseIndex:O})})]}),o.jsx(Fl,{env:((Sl=FE.find(O=>O.id===(Be.knowledgebaseBackend??Wc)))==null?void 0:Sl.env)??[],values:((_a=h.deployment)==null?void 0:_a.envValues)??{},onChange:Ve})]})]})}),pt&&o.jsxs("section",{ref:O=>{Bt.current.advanced=O},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Le,"aria-controls":St,onClick:()=>Ye(O=>!O),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx(Ds,{className:`cw-advanced-disclosure-chevron ${Le?"is-open":""}`,"aria-hidden":!0}),ve>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",ve]})]}),o.jsx(oi,{initial:!1,children:Le&&o.jsxs(Zt.div,{id:St,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.memory.shortTerm,onChange:O=>ce({memory:{...Be.memory,shortTerm:O}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:CM}),Be.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(Jb,{options:PE,value:Be.shortTermBackend,onChange:O=>ce({shortTermBackend:O})}),o.jsx(Fl,{env:((ka=PE.find(O=>O.id===(Be.shortTermBackend??"local")))==null?void 0:ka.env)??[],values:((Na=h.deployment)==null?void 0:Na.envValues)??{},onChange:Ve})]}),o.jsx(ud,{checked:Be.memory.longTerm,onChange:O=>ce({memory:{...Be.memory,longTerm:O}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:rm}),Be.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(Jb,{options:BE,value:Be.longTermBackend,onChange:O=>ce({longTermBackend:O})}),o.jsx(Fl,{env:((Tl=BE.find(O=>O.id===(Be.longTermBackend??"local")))==null?void 0:Tl.env)??[],values:((bo=h.deployment)==null?void 0:bo.envValues)??{},onChange:Ve}),o.jsx(ud,{checked:!!Be.autoSaveSession,onChange:O=>ce({autoSaveSession:O}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:rm})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(ud,{checked:Be.tracing,onChange:O=>ce({tracing:O}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:yv}),Be.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(hI,{items:UE,selected:ue,onToggle:ot}),o.jsx(Fl,{env:UE.filter(O=>ue.includes(O.id)).flatMap(O=>O.env),values:((Gs=h.deployment)==null?void 0:Gs.envValues)??{},onChange:Ve})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(Zt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Lt,0)/Math.max(Mt.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),Mt.map(O=>{const q=O.id===gt,oe=Yt[O.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${q?"is-active":""} ${oe?"is-done":""}`,onClick:()=>jn(O.id),"aria-current":q?"step":void 0,"aria-label":O.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:q?o.jsx("span",{className:"cw-dot"}):oe?o.jsx(zs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:O.label})]})},O.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Ws,children:o.jsx("span",{children:"开始调试"})})]})]})]}),D==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(qye,{enabled:Q,disabledReason:se,variants:de,draftSnapshot:Wn,input:ke,onInput:Ae,onSend:Es,onStartVariant:Ys,onDeployVariant:O=>void ns(O),onAddVariant:Vi,onRemoveVariant:Cr,onToggleConfig:O=>{const q=de.find(oe=>oe.id===O);q&&Ki(O,{configOpen:!q.configOpen})},onCompleteConfig:vi,onConfigChange:xa,onOpenTrace:Ks})})}),D==="publish"&&o.jsx("div",{className:"cw-preview-body",children:P?o.jsx(ey,{embedded:!0,project:P,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:pB(h),releaseConfiguration:en?{modelName:en.modelName||h.modelName||"默认模型",description:en.description,instruction:en.instruction,optimizations:en.optimizations.flatMap(O=>{const q=bB.find(oe=>oe.id===O);return q?[q.label]:[]})}:void 0,onChange:A,onDeploy:Iu,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((_t=h.deployment)!=null&&_t.feishuEnabled),onFeishuEnabledChange:O=>{const q={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:O}};p(q)},deploymentEnv:vn.specs,deploymentEnvValues:{...(Eo=h.deployment)==null?void 0:Eo.envValues,...vn.fixedValues},onDeploymentEnvChange:Ve,network:(V=h.deployment)==null?void 0:V.network,onNetworkChange:O=>p(q=>({...q,deployment:{...q.deployment??{feishuEnabled:!1},network:O}})),deployRegion:B,onDeployRegionChange:re,onExportYaml:()=>Oye(`${h.name||"agent"}.yaml`,S0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(Ft,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),He&&o.jsx(aB,{testRunId:He.runId,sessionId:He.sessionId,title:`调用链路 · ${He.variantName}`,onClose:()=>Ce(null)}),W&&o.jsx("div",{className:"confirm-scrim",onClick:()=>M(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:O=>O.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>M(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{M(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:O=>O.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function Xi(e){return{...Pr(),...e}}const Zye=[{id:"support",icon:Jz,draft:Xi({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Dz,draft:Xi({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:eV,draft:Xi({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:mv,draft:Xi({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:oV,draft:Xi({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:wV,draft:Xi({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Xi({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Xi({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Xi({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Jye(e){const t=[];return e.tools.length&&t.push({icon:MM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:jz,label:"记忆"}),e.knowledgebase&&t.push({icon:Mz,label:"知识库"}),e.tracing&&t.push({icon:Oz,label:"观测"}),e.subAgents.length&&t.push({icon:OM,label:`子Agent ${e.subAgents.length}`}),t}function ebe({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(nbe,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(tbe,{onPick:r})})}function tbe({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:Zye.map((t,n)=>o.jsxs(Zt.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:Hs(t.draft.description)})]},t.id))})]})}function nbe({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=Jye(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(hv,{className:"icon"})," 返回模板列表"]}),o.jsxs(Zt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:Hs(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:rbe(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:Hs(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx(Ds,{className:"icon"})]})]})]})}function rbe(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const sbe=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:IM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:vM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:wv}];let Dx=0;function s1(){return Dx+=1,`node_${Dx}`}function i1(e,t,n){const r=Pr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function ibe({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(kr,{type:"target",position:Fe.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(il,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(kr,{type:"source",position:Fe.Right,className:"wfb-handle"})]})}const abe={agentNode:ibe},gI={type:"smoothstep",markerEnd:{type:nu.ArrowClosed,width:16,height:16}};function obe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Dx=0;const C=s1();return i1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=r6([u]),[p,m,g]=s6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>eB({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Lc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Lc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=d.length>0&&k===null&&d.every(C=>Lc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(j=>R4({...C,...gI},j)),[m]),R=E.useCallback(()=>{const C=s1(),j=d.length*28,L=i1(C,{x:80+j,y:120+j});f(P=>P.concat(L)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},D=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),U=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const L=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),P=s1(),A=i1(P,L);f(z=>z.concat(A)),y(P)},[f]),W=E.useCallback(C=>{w&&f(j=>j.map(L=>L.id===w?{...L,data:{...L.data,agent:{...L.data.agent,...C}}}:L))},[w,f]),M=E.useCallback(()=>{w&&(f(C=>C.filter(j=>j.id!==w)),m(C=>C.filter(j=>j.source!==w&&j.target!==w)),y(null))},[w,f,m]),$=E.useCallback(()=>{if(!T)return;const C=d.map(L=>L.data.agent),j={...Pr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(L=>({id:L.id,agent:L.data.agent})),edges:p.map(L=>({from:L.source,to:L.target}))}};t(j)},[T,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:sbe.map(({type:C,label:j,desc:L,Icon:P})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(P,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:j}),o.jsx("span",{className:"wfb-type-desc",children:L})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(Zz,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(il,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(dr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:$,disabled:!T,type:"button",children:[o.jsx(al,{className:"icon"}),"创建工作流"]}),o.jsxs(n6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:abe,defaultEdgeOptions:gI,onDrop:U,onDragOver:D,onNodeClick:(C,j)=>y(j.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(a6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(l6,{showInteractive:!1}),o.jsx(ofe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:M,title:"删除节点",children:o.jsx(Fi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>W({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>W({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>W({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>W({tools:C.target.value.split(",").map(j=>j.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(il,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function lbe(e){return o.jsx(C_,{children:o.jsx(obe,{...e})})}const yI=50*1024*1024,Px=800,cbe={name:"code_package",files:[]};function ube(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 dbe(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 fbe(e){const t=e.flatMap(a=>{const l=dbe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Px)throw new Error(`代码包文件数不能超过 ${Px} 个。`);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 hbe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,T]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(U){const W=++l.current;if(x(""),!U.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(U.size>yI){x("代码包不能超过 50 MB。");return}g(!0);try{const M=await nB(new Uint8Array(await U.arrayBuffer()),{maxEntries:Px,maxUncompressedBytes:yI}),$=fbe(M);if(W!==l.current)return;f(U.name),u({name:ube(U.name),files:$})}catch(M){if(W!==l.current)return;f(""),u(null),x(M instanceof Error?M.message:String(M))}finally{W===l.current&&g(!1)}}function R(U){var M;const W=(M=U.currentTarget.files)==null?void 0:M[0];U.currentTarget.value="",W&&S(W)}function I(U){var M;U.preventDefault(),y(!1);const W=(M=U.dataTransfer.files)==null?void 0:M[0];W&&S(W)}async function D(U,W,M){const $=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return m0(U.name,U.files,{region:_,projectName:"default",network:$},{...M,onStage:W})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(ey,{project:c??cbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:D,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:T,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:U=>{U.preventDefault(),y(!0)},onDragOver:U=>U.preventDefault(),onDragLeave:U=>{U.currentTarget.contains(U.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var U;m||(U=a.current)==null||U.click()},onKeyDown:U=>{var W;!m&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),(W=a.current)==null||W.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:U=>{U.stopPropagation(),p(!0)},onKeyDown:U=>U.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(J5,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const pbe=3*60*1e3,mbe=3e3,gbe=10*60*1e3,Pg="veadk.studio.pending-update",bI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],ybe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function bbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function Ebe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function xbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Pg);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(Pg),null}function a1(e,t){window.localStorage.setItem(Pg,JSON.stringify({targetVersion:e,startedAt:t}))}function Fp(){window.localStorage.removeItem(Pg)}function EI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function wbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function vbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function xI({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function _be(){var W,M;const[e]=E.useState(xbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const $=j=>{var L;j.target instanceof Node&&!((L=y.current)!=null&&L.contains(j.target))&&h(!1)},C=j=>{j.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",$),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",$),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const $=await lj(b.current||void 0,x.current||void 0);return n($),$},[]);if(E.useEffect(()=>{let $=!0;const C=()=>{_().catch(()=>{$&&n(L=>L)})};C();const j=window.setInterval(C,pbe);return()=>{$=!1,window.clearInterval(j)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const $=window.setInterval(()=>{_().then(C=>{const j=b.current;if(j&&Ebe(C.currentVersion,j)||!j&&!C.available&&C.latestVersion){window.clearInterval($),Fp(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval($),Fp(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>gbe&&(window.clearInterval($),Fp(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},mbe);return()=>window.clearInterval($)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),a1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const $=()=>{const j=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-j)/1e3)))};$();const C=window.setInterval($,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],T=u||((W=N[0])==null?void 0:W.version)||t.latestVersion,S=N.find($=>$.version===T),R=async()=>{b.current=T,x.current=Date.now(),a1(T,x.current),s("submitting"),c(""),m("idle");try{const $=await cj(T);b.current=$.version,a1($.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch($){if($ instanceof TypeError){c("连接已切换,正在确认新版本状态");return}Fp(),s("error");const C=$ instanceof Error?$.message:"Studio 更新失败";try{const j=await _();c(j.message||C)}catch{c(C)}}},I=(M=t.updateLogs)!=null&&M.length?t.updateLogs:(t.errorLog||t.progressMessage||l).split(` -`).filter(Boolean),D=async()=>{try{await navigator.clipboard.writeText(I.join(` -`)),m("copied")}catch{m("error")}},U=()=>{var $;h(!1),m("idle"),c(""),d(b.current||(($=N[0])==null?void 0:$.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var $;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d((($=N[0])==null?void 0:$.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(EI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(ma,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(EI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:ybe[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(xI,{lines:I,phase:"error",copyState:p,onCopy:()=>void D()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":bbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:bI.map(($,C)=>{const j=bI.findIndex(A=>A.id===t.progressStage),L=r==="published"||Cvoid D()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h($=>!$),onKeyDown:$=>{($.key==="ArrowDown"||$.key==="ArrowUp")&&($.preventDefault(),h(!0))},children:[o.jsx("span",{children:T}),o.jsx(wbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map($=>{const C=$.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d($.version),h(!1)},children:[o.jsx("span",{children:$.version}),C&&o.jsx(vbe,{})]},$.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map($=>o.jsx("li",{children:$},$))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:U,children:"重新尝试"})]})]})})]})}const kbe="/web/skill-creator";class sk extends Error{constructor(n,r){super(n);Mk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function kl(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function bn(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function EB(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Ch(e,t){return fetch(Pi(`${kbe}${e}`),{...t,headers:f0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function ik(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=kl(await e.json(),"错误响应");return bn(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ak(e,t){if(!e.ok)throw new sk(await ik(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Nbe(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 Sbe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Tbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=kl(t,`文件 ${n+1}`),s=bn(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=EB(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Abe(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 Cbe(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=kl(t,`活动 ${n+1}`),s=bn(r,"id"),i=bn(r,"kind"),a=bn(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=bn(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 l=bn(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function Ibe(e,t){const n=kl(e,`候选方案 ${t+1}`),r=bn(n,"id","candidate_id","candidateId"),s=bn(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:bn(n,"modelLabel","model_label")??s,status:Nbe(n.status),stage:Sbe(n.stage),name:bn(n,"name","skill_name","skillName"),description:bn(n,"description"),skillMd:bn(n,"skillMd","skill_md"),files:Tbe(n.files),activities:Cbe(n.activities),validation:Abe(n.validation),durationMs:EB(n,"elapsedMs","elapsed_ms"),error:bn(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:bn(n,"skill_id","skillId"),version:bn(n,"version")}}function Bx(e,t=""){const n=kl(e,"Skill 创建任务"),r=bn(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Ibe):[],i=bn(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:bn(n,"prompt")??t,status:i,candidates:s}}async function Rbe(e,t){const n=await Ch("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new sk(await ik(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Bx(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="",l;const c=u=>{if(!u.trim())return;const d=kl(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(bn(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Bx(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Obe(e){const t=await Ch(`/jobs/${encodeURIComponent(e)}`);return Bx(await ak(t,"读取 Skill 任务失败"))}async function Lbe(e){const t=await Ch(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ak(t,"清理 Skill 任务失败")}async function Mbe(e,t){var l;const n=await Ch(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await ik(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 jbe(e,t,n){const r=await Ch(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=kl(await ak(r,"添加到 AgentKit 失败"),"发布结果"),i=bn(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:bn(s,"name"),version:bn(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:bn(s,"message")}}const Dbe=()=>{};function Pbe(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 Bbe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map(Pbe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(F_,{blocks:t,onAction:Dbe})})}const wI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},vI=12e4;function Fbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Ube(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function $be(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Hbe({candidate:e}){var c,u;const[t,n]=E.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,vI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>vI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function zbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),T=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",D=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(Fbe,{status:n.status})}),R?o.jsx(ma,{duration:2.2,spread:16,children:wI[n.stage]}):o.jsx("span",{children:wI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Bbe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var U;return(U=S.current)==null?void 0:U.focus()})},children:[o.jsx(Ube,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()})},children:[o.jsx($be,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(D==null?void 0:D.valid)===!1?"is-invalid":"is-valid",children:(D==null?void 0:D.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,D&&(D.errors.length>0||D.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...D.errors,...D.warnings].map((U,W)=>o.jsx("div",{children:U},`${U}-${W}`))]}):null,o.jsx(Hbe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Mbe(t,n.id).catch(U=>{w(U instanceof Error?U.message:String(U))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:U=>{U.preventDefault();const W=y.split(",").map(M=>M.trim()).filter(Boolean);c({skillSpaceIds:W,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:U=>b(U.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:U=>_(U.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:U=>N(U.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const _I=new Set(["completed"]),Up=1100,Vbe=3e4;function Kbe(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 Ybe({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(_I.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Vbe,_=async()=>{try{const k=await Obe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),_I.has(k.status)||(b=window.setTimeout(_,Up)))}catch(k){if(!y){const N=k instanceof sk?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=U_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??Kbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await jbe(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(zbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const o1="/web/sandbox/sessions",Wbe=33e4,Gbe=6e5,qbe=15e3;function l1(e){const t=f0(e);return t.set("Accept","application/json"),t}async function c1(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 Xbe(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 u1={async startSession(e={}){const t=await fetch(Pi(o1),{method:"POST",headers:l1({"Content-Type":"application/json"}),signal:pi(e.signal,Wbe)});if(!t.ok)throw await c1(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(Pi(`${o1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:l1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:pi(t.signal,Gbe)});if(!n.ok)throw await c1(n,"沙箱对话失败,请稍后重试。");return Xbe(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Pi(`${o1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:l1(),signal:pi(t.signal,qbe)});if(!n.ok&&n.status!==404)throw await c1(n,"无法清理 AgentKit 沙箱会话。")}},Qbe=1e4;async function xB(e){const t=await fetch(Pi(e),{headers:f0({Accept:"application/json"}),signal:pi(void 0,Qbe)});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 Zbe(){return xB("/web/sandbox/capabilities")}async function Jbe(){return xB("/web/skill-creator/capabilities")}function e1e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 t1e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return ps.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(e1e,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function n1e({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function r1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 s1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function i1e(e){return e.toLowerCase()==="github"?o.jsx(Qz,{className:"icon"}):o.jsx(rV,{className:"icon"})}function a1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),PM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=NV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||jv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(ma,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>TV(m.loginUrl),children:[i1e(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Fd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function o1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?ps.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(l0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function l1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}_l("Button",l1e);function c1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}_l("Card",c1e);const u1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},d1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function wB(e){return u1e[e]??"flex-start"}function vB(e){return d1e[e]??"stretch"}function f1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:wB(e.justify),alignItems:vB(e.align)},children:n.map(r=>t.render(r))})}_l("Column",f1e);function h1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}_l("Divider",h1e);const p1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function m1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:p1e[t]??"•"})}_l("Icon",m1e);function g1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:wB(e.justify),alignItems:vB(e.align??"center")},children:n.map(r=>t.render(r))})}_l("Row",g1e);const y1e=new Set(["h1","h2","h3","h4","h5"]);function b1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=y1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}_l("Text",b1e);async function $p(e){const[t,n,r]=await Promise.allSettled([Zbe(),Jbe(),Iv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const E1e="创建 Agent",x1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Mo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},w1e=new Set,v1e=[];function Qi(){return{skills:[]}}function Po(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function d1(e){return`${Po(e)}.active`}function Fx(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function _1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Po(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function k1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(Fx(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Ux(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Ux(n,t);if(r)return r}}function _B(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(..._B(n)));return t}function kI(){const e=typeof localStorage<"u"?localStorage.getItem(Mo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function N1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 S1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function kB(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 T1e(e){if(!e)return"";const t=[];return e.ts&&t.push(kB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function NI(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const A1e="send_a2ui_json_to_client";function C1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===A1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?H6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function I1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function R1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function O1e(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 SI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(zs,{className:"icon"}):o.jsx(c0,{className:"icon"})})}function L1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function M1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx(Ft,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(SM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(l0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(NE,{className:"global-deploy-task-icon"}):o.jsx(nV,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(pv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:L1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Mg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const TI=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],AI=()=>TI[Math.floor(Math.random()*TI.length)];function f1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function j1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function D1e(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 P1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[T,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[D,U]=E.useState({}),W=a?D[a]??[]:f,M=p?g:W,$=(F,K)=>U(ie=>({...ie,[F]:typeof K=="function"?K(ie[F]??[]):K})),[C,j]=E.useState(""),[L,P]=E.useState("agent"),[A,z]=E.useState(null),[G,B]=E.useState({}),re=E.useRef(new Map),Q=G.ready===!0&&G.agentId===n,[se,de]=E.useState(null),[te,pe]=E.useState(!1),ne=E.useRef(0),[ye,ge]=E.useState([]),[be,xe]=E.useState(Qi),[ke,Ae]=E.useState(null),[He,Ce]=E.useState(0),[gt,Ge]=E.useState(!1),[ze,le]=E.useState(null),[Ee,ut]=E.useState(!1),[ft,X]=E.useState([]),[ee,me]=E.useState(!1),Le=E.useRef(new Set),[Ye,Ze]=E.useState(()=>new Set),[Pt,bt]=E.useState(()=>new Set),Bt=E.useRef(new Map),zt=E.useRef(new Map),Nt=(F,K)=>Ze(ie=>{const fe=new Set(ie);return K?fe.add(F):fe.delete(F),fe}),Ut=F=>{const K=zt.current.get(F);K!==void 0&&window.clearTimeout(K),zt.current.delete(F),bt(ie=>new Set(ie).add(F))},Be=F=>{const K=zt.current.get(F);K!==void 0&&window.clearTimeout(K);const ie=window.setTimeout(()=>{zt.current.delete(F),bt(fe=>{const Te=new Set(fe);return Te.delete(F),Te})},2400);zt.current.set(F,ie)},pt=E.useRef(""),[Je,Re]=E.useState(""),[It,St]=E.useState(""),ce=E.useRef(null);E.useEffect(()=>()=>{ce.current!==null&&window.clearTimeout(ce.current)},[]);const[Ve,at]=E.useState(()=>new Set),[rn,sn]=E.useState(!1),[fn,Wt]=E.useState(!1),Jt=E.useRef(null),Mn=E.useCallback(()=>Wt(!1),[]),[Vn,Kn]=E.useState(AI),[vt,an]=E.useState(null),[ue,Se]=E.useState(!1),[ve,Qe]=E.useState(!1),[ot,et]=E.useState(""),lt=E.useRef(!1),[Vt,Kt]=E.useState(null),[J,rt]=E.useState(""),[Ue,qe]=E.useState(),[Xe,Rt]=E.useState(null),[Yn,Wn]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[en,vn]=E.useState("cloud"),[Yt,_n]=E.useState(Af),[kn,Mt]=E.useState(""),[Nn,mr]=E.useState("chat"),[Lt,jn]=E.useState(!1),[lr,gr]=E.useState(!1),[Ar,Ks]=E.useState(!1),[Hr,ns]=E.useState({}),[Ys,Es]=E.useState({}),[Vi,Cr]=E.useState({}),Ki=Ye.has(a),xa=Pt.has(a),vi=Ki||u,Iu=!!a&&Ee,Ws=p?y:vi,Ru=Ws||!p&&xa,xs=Hr[a]??"",ws=Ys[a]??w1e,wa=Vi[a]??v1e,nr=ke==null?void 0:ke.graph,va=[ke==null?void 0:ke.name,nr==null?void 0:nr.name,nr==null?void 0:nr.id].filter(F=>!!F),Yi=be.targetAgent&&nr?Ux(nr,be.targetAgent.name):nr,Nl=(Yi==null?void 0:Yi.skills)??(be.targetAgent?[]:(ke==null?void 0:ke.skills)??[]),Sl=nr?_B(nr):[];function _a(F){f1(F);for(const K of F)K.status==="uploading"?Le.current.add(K.id):K.uri&&im(n,K.uri).catch(ie=>Re(String(ie)))}function ka(){ne.current+=1;const F=se;de(null),pe(!1),F&&!F.id.startsWith("pending-")&&Lbe(F.id).catch(K=>{Re(K instanceof Error?K.message:String(K))})}async function Na(F){try{await IE(n,J,F),await CE(n,J,F),i(K=>K.filter(ie=>ie.id!==F)),U(K=>{const{[F]:ie,...fe}=K;return fe})}catch(K){Re(String(K))}}function Tl(F){const K=ye.find(Te=>Te.id===F);if(!K)return;const ie=ye.filter(Te=>Te.id!==F);f1([K]),K.status==="uploading"&&Le.current.add(F),ge(ie),ie.length===0&&!C.trim()&&!!a&&M.length===0?(pt.current="",l(""),Na(a)):K.uri&&im(n,K.uri).catch(Te=>Re(String(Te)))}const bo=(F,K)=>{var Me,tt,_e,$e,dt;const ie=K.author&&K.author!=="user"?K.author:void 0;ie&&(ns(je=>({...je,[F]:ie})),Es(je=>({...je,[F]:new Set(je[F]??[]).add(ie)})),Cr(je=>{var ht;return(ht=je[F])!=null&&ht.length?je:{...je,[F]:[ie]}}));const fe=((Me=K.actions)==null?void 0:Me.transferToAgent)??((tt=K.actions)==null?void 0:tt.transfer_to_agent);fe&&Cr(je=>{const ht=je[F]??[];return ht[ht.length-1]===fe?je:{...je,[F]:[...ht,fe]}}),(((_e=K.actions)==null?void 0:_e.endOfAgent)??(($e=K.actions)==null?void 0:$e.end_of_agent)??((dt=K.actions)==null?void 0:dt.escalate))&&Cr(je=>{const ht=je[F]??[];return ht.length<=1?je:{...je,[F]:ht.slice(0,-1)}})},[Gs,_t]=E.useState(kI),[Eo,V]=E.useState([]),O=E.useCallback(F=>{V(K=>{const ie=K.findIndex(Te=>Te.id===F.id);if(ie===-1)return[F,...K];const fe=[...K];return fe[ie]={...fe[ie],...F},fe})},[]),q=E.useCallback(async F=>{try{await sj(F.id),V(K=>K.map(ie=>ie.id===F.id?{...ie,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:ie))}catch(K){const ie=K instanceof Error?K.message:String(K);V(fe=>fe.map(Te=>Te.id===F.id?{...Te,message:`取消失败:${ie}`}:Te))}},[]),[oe,Pe]=E.useState(!0),[nt,it]=E.useState(!1),[tn,We]=E.useState(!1),[Gt,Et]=E.useState(!1),[Dn,$t]=E.useState(null),[vs,qs]=E.useState([]),[ok,Ih]=E.useState([]),[zr,Xs]=E.useState(""),_s=E.useRef(null),[Rh,Ir]=E.useState(!1),[Ou,on]=E.useState(!1),[lk,ny]=E.useState(""),[NB,SB]=E.useState("good"),[TB,Lu]=E.useState("basic"),[AB,CB]=E.useState("good"),[Oh,Lh]=E.useState(""),[Qs,yr]=E.useState(!1),ry=E.useRef(null),[xo,Al]=E.useState(()=>{const F=As();return yu(F),F}),[IB,ck]=E.useState(!1),[RB,uk]=E.useState(""),[dk,Mh]=E.useState(null),[OB,fk]=E.useState({}),[LB,hk]=E.useState(()=>new Set),[Cl,_i]=E.useState(null),[jh,sy]=E.useState("cn-beijing"),[pk,Vr]=E.useState(""),[iy,Rr]=E.useState(""),[Ht,ks]=E.useState(null),[MB,Dh]=E.useState(!1),ay=E.useRef(!1),Ph=E.useRef(!1),jB=E.useCallback((F,K,ie)=>{!F||!J||qs(fe=>{const Me=[{id:F,draft:K,updatedAt:Date.now(),deploymentTarget:ie},...fe.filter(tt=>tt.id!==F)];return localStorage.setItem(Po(J),JSON.stringify(Me)),Me})},[J]),oy=E.useCallback(F=>{!F||!J||qs(K=>{const ie=K.filter(fe=>fe.id!==F);return localStorage.setItem(Po(J),JSON.stringify(ie)),ie})},[J]),DB=E.useCallback(F=>{if(!J||F.length===0)return;const K=new Set(F.map(ie=>ie.id));qs(ie=>{const fe=ie.filter(Te=>!K.has(Te.id));return localStorage.setItem(Po(J),JSON.stringify(fe)),fe}),K.has(zr)&&(Xs(""),$t(null),_i(null),_s.current=null,localStorage.removeItem(d1(J)))},[zr,J]),mk=E.useCallback(F=>{if(!F||!J)return;const K=_s.current;qs(ie=>{const fe=ie.filter(Me=>Me.id!==F),Te=(K==null?void 0:K.id)===F?[K,...fe]:fe;return localStorage.setItem(Po(J),JSON.stringify(Te)),Te})},[J]);E.useEffect(()=>{if(!J){qs([]),Ih([]),Xs(""),_s.current=null;return}const F=_1e(J);qs(F),Ih(k1e(J));const K=localStorage.getItem(d1(J))||"",ie=F.find(fe=>fe.id===K);_s.current=ie??null,Gs==="custom"&&ie&&(Xs(ie.id),$t(ie.draft),_i(ie.deploymentTarget??null))},[J]),E.useEffect(()=>{if(!J)return;const F=d1(J);Gs==="custom"&&zr?localStorage.setItem(F,zr):localStorage.removeItem(F)},[Gs,zr,J]);const PB=E.useCallback(F=>{if(!J)return;const K=[...new Set(F.filter(Boolean))];Ih(K),localStorage.setItem(Fx(J),JSON.stringify(K))},[J]),BB=E.useCallback(async F=>{const K=F.filter(_e=>!!_e.runtimeId&&_e.canDelete===!0);if(K.length===0)return;const ie=new Set(K.map(_e=>_e.runtimeId));hk(_e=>{const $e=new Set(_e);for(const dt of ie)$e.add(dt);return $e}),MC(ie);const fe=new Set,Te=new Set,Me=new Set,tt=[];for(const _e of K)try{if(!_e.region)throw new Error("Runtime 缺少地域信息,无法删除");await dj(_e.runtimeId,_e.region),ag(_e.runtimeId),fe.add(_e.runtimeId),Te.add(_e.id)}catch($e){const dt=$e instanceof Error?$e.message:String($e);Me.add(_e.runtimeId),tt.push(`${_e.label}: ${dt}`)}if(fe.size>0&&(MC(fe),Al(As()),Mh(_e=>{if(!_e)return _e;const $e=new Set(_e);for(const dt of fe)$e.delete(dt);return $e}),fk(_e=>Object.fromEntries(Object.entries(_e).filter(([$e])=>!fe.has($e)))),Ih(_e=>{const $e=_e.filter(dt=>!Te.has(dt));return J&&localStorage.setItem(Fx(J),JSON.stringify($e)),$e}),qs(_e=>{const $e=_e.filter(dt=>{var je;return!((je=dt.deploymentTarget)!=null&&je.runtimeId)||!fe.has(dt.deploymentTarget.runtimeId)});return J&&localStorage.setItem(Po(J),JSON.stringify($e)),$e}),K.some(_e=>_e.id===n)&&(pt.current="",l(""),r("")),Ht!=null&&Ht.runtime&&fe.has(Ht.runtime.runtimeId)&&(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),Vr(""),Rr(""),yr(!0),Re(""))),Me.size>0&&hk(_e=>{const $e=new Set(_e);for(const dt of Me)$e.delete(dt);return $e}),tt.length>0){const _e=tt.slice(0,3).join(";"),$e=tt.length>3?`;另有 ${tt.length-3} 个失败`:"";throw new Error(`${tt.length} 个 Agent 删除失败:${_e}${$e}`)}},[Ht,n,J]),ly=E.useCallback(async()=>{ck(!0),uk("");try{const F=[];let K="";do{const ie=await kc({scope:"mine",region:"all",pageSize:100,nextToken:K});F.push(...ie.runtimes),K=ie.nextToken}while(K&&F.length<2e3);Mh(new Set(F.map(ie=>ie.runtimeId))),fk(Object.fromEntries(F.map(ie=>[ie.runtimeId,{canDelete:ie.canDelete}])))}catch(F){uk(F instanceof Error?F.message:String(F))}finally{ck(!1)}},[]);function Bh(F){console.log("create agent draft:",F),_t(null),ko()}function cy(F,K){console.log("Agent added, navigating to:",F,K),Al(As()),Mh(null),oy(zr),Xs(""),_s.current=null,_i(null),Vr(""),Rr(F),Lu("basic"),_t(null),on(!0),r(F)}const gk=E.useCallback(F=>{_t(null),Et(!1),ks(null),on(!0),Rr(""),Lu("basic"),Vr(F.id),Re("")},[]),yk=E.useCallback(async F=>{if(!F.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const K=(Cl==null?void 0:Cl.region)??jh,ie=await ig(F.runtimeId,F.agentName,F.region??K,F.version);Al(As()),Ce(Te=>Te+1);const fe=await $p(ie);re.current.set(ie,fe),B(fe),Mh(Te=>{const Me=new Set(Te??[]);return Me.add(F.runtimeId),Me}),_i(null),oy(zr),Xs(""),_s.current=null,Rr(ie),Lu("basic"),_t(null),on(!0),r(ie)},[zr,jh,oy,Cl]),Mu=E.useRef(null),uy=E.useRef(new Map),wo=E.useRef(!0),Sa=E.useRef(!1),vo=E.useRef(null),bk=E.useRef({key:"",turnCount:0}),dy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const F=Mu.current,K=bk.current,ie=K.key!==dy,fe=!ie&&M.length>K.turnCount;if(bk.current={key:dy,turnCount:M.length},!F||M.length===0||!ie&&!fe)return;wo.current=!0,Sa.current=!1,vo.current!==null&&(window.clearTimeout(vo.current),vo.current=null);const Te=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(ie||Te){F.scrollTop=F.scrollHeight;return}Sa.current=!0,F.scrollTo({top:F.scrollHeight,behavior:"smooth"}),vo.current=window.setTimeout(()=>{Sa.current=!1,vo.current=null},450)},[dy,M.length]),E.useLayoutEffect(()=>{const F=Mu.current;!F||!wo.current||Sa.current||(F.scrollTop=F.scrollHeight)},[Ws,M]),E.useEffect(()=>{if(!Oh||Ou||M.length===0)return;const F=uy.current.get(Oh);if(!F)return;wo.current=!1,F.scrollIntoView({behavior:"smooth",block:"center"});const K=window.setTimeout(()=>{Lh("")},2600);return()=>window.clearTimeout(K)},[Oh,Ou,M]),E.useEffect(()=>()=>{vo.current!==null&&window.clearTimeout(vo.current)},[]);const FB=E.useCallback(()=>{const F=Mu.current;!F||Sa.current||(wo.current=F.scrollHeight-F.scrollTop-F.clientHeight<32)},[]),UB=E.useCallback(F=>{F.deltaY<0&&(Sa.current=!1,wo.current=!1)},[]),$B=E.useCallback(()=>{Sa.current=!1,wo.current=!1},[]),HB=E.useCallback(()=>{const F=Mu.current;!F||!wo.current||Sa.current||(F.scrollTop=F.scrollHeight)},[]),fy=E.useCallback(()=>{Kt(null),SE().then(F=>{rt(F.userId),qe(F.info),gr(!!F.local),an(F.status),F.status==="authenticated"&&(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),yr(!0))}).catch(F=>{Kt(F instanceof Error?F.message:String(F))})},[]);E.useEffect(()=>{fy()},[fy]),E.useEffect(()=>{const F=()=>{et(""),Se(!0)};return window.addEventListener(TE,F),jV()&&F(),()=>window.removeEventListener(TE,F)},[]);const zB=E.useCallback(async()=>{if(lt.current)return;lt.current=!0;const F=AV();if(!F){lt.current=!1,et("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),et("");try{for(;;){await new Promise(K=>window.setTimeout(K,1e3));try{const K=await SE();if(K.status==="authenticated"){rt(K.userId),qe(K.info),gr(!!K.local),an(K.status),Se(!1),DV(),F.close();return}}catch{}if(F.closed){et("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{lt.current=!1,Qe(!1)}},[]);E.useEffect(()=>{lr&&J&&fT(J)},[lr,J]),E.useEffect(()=>{if(vt!=="authenticated"||!J||!n){B({});return}const F=re.current.get(n);if(F){B(F);return}let K=!1;return B({}),$p(n).then(ie=>{K||(re.current.set(n,ie),B(ie))}),()=>{K=!0}},[n,vt,J]),E.useEffect(()=>{if(vt!=="authenticated"||!J){Rt(null);return}let F=!1;return Rt(null),oj().then(K=>{F||Rt(K)}).catch(K=>{console.warn("[app] /web/access failed; using ordinary-user access:",K),F||Rt(aj)}),()=>{F=!0}},[vt,J]),E.useEffect(()=>{ij().then(F=>{Wn(F.features),vn(F.agentsSource),_n(F.branding),Mt(F.version),mr(F.defaultView),jn(!0)})},[]),E.useEffect(()=>{!Xe||!Lt||Ph.current||Qs||(Ph.current=!0,Nn==="addAgent"&&Xe.capabilities.createAgents&&(_t(null),it(!1),Ir(!1),on(!1),We(!1),Et(!0)))},[Xe,Nn,Qs,Lt]),E.useEffect(()=>{Xe&&(Xe.capabilities.createAgents||(_t(null),$t(null),We(!1),Et(!1),V([])),Xe.capabilities.manageAgents||on(!1))},[Xe]),E.useEffect(()=>{vt!=="authenticated"||en!=="cloud"||!Lt||!Ou||Ht||ly()},[Ht,en,vt,Ou,ly,Lt]),E.useEffect(()=>{document.title=Yt.title;let F=document.querySelector('link[rel~="icon"]');F||(F=document.createElement("link"),F.rel="icon",document.head.appendChild(F)),F.removeAttribute("type"),F.href=Yt.logoUrl||jv},[Yt]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(F=>F.ok?F.json():null).then(F=>{F&&Pe(!!F.credentials)}).catch(F=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",F)})},[]);function VB(F){fT(F),ay.current=!0,Ph.current=!1,Rt(null),_t(null),$t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ko(),yr(!0),rt(F),qe({name:F}),gr(!0),an("authenticated")}function KB(){Ph.current=!1,Rt(null),lr?(SV(),rt(""),qe(void 0),an("unauthenticated")):IV()}E.useEffect(()=>{if(vt==="authenticated"){if(en==="cloud"){const F=localStorage.getItem(Mo.app),K=xo.flatMap(ie=>ie.apps.map(fe=>ro(ie.id,fe)));r(ie=>ie&&K.includes(ie)?ie:F&&K.includes(F)?F:K[0]??"");return}$M().then(F=>{t(F);const K=localStorage.getItem(Mo.app),ie=xo.flatMap(Me=>Me.apps.map(tt=>ro(Me.id,tt))),fe=K&&(F.includes(K)||ie.includes(K)),Te=["web_search_agent","web_demo"].find(Me=>F.includes(Me))??F.find(Me=>!/^\d/.test(Me))??F[0];r(fe?K:Te||"")}).catch(F=>Re(String(F)))}},[vt,en,xo]),E.useEffect(()=>{n&&localStorage.setItem(Mo.app,n)},[n]),E.useEffect(()=>{let F=!1;if(le(null),X([]),Qs||Ht||!n||!J||!a){ut(!1);return}return ut(!0),RE(n,J,a).then(K=>{F||(le(K),Iv(n).then(ie=>{F||X(ie)}).catch(()=>{F||X([])}))}).catch(()=>{F||le(null)}).finally(()=>{F||ut(!1)}),()=>{F=!0}},[Ht,n,Qs,J,a]),E.useEffect(()=>{let F=!1;if(Ae(null),xe(Qi()),vt!=="authenticated"||Qs||Ht||!n){Ge(!1);return}return Ge(!0),Rv(n).then(K=>{F||Ae(K)}).catch(()=>{F||Ae(null)}).finally(()=>{F||Ge(!1)}),()=>{F=!0}},[Ht,n,He,vt,Qs]),E.useEffect(()=>{Xe&&localStorage.setItem(Mo.view,Xe.capabilities.createAgents?Gs??"chat":"chat")},[Xe,Gs]),E.useEffect(()=>{localStorage.setItem(Mo.session,a),pt.current=a},[a]),E.useEffect(()=>()=>Bt.current.forEach(F=>F.abort()),[]),E.useEffect(()=>()=>zt.current.forEach(F=>{window.clearTimeout(F)}),[]),E.useEffect(()=>()=>{var F,K;(F=R.current)==null||F.abort(),(K=I.current)==null||K.abort()},[]),E.useEffect(()=>{if(Qs||Ht||p||!n||!J)return;let F=!1;return(async()=>{const K=await Fh(n);if(!F){if(!ay.current){ay.current=!0;const ie=localStorage.getItem(Mo.session)||"";if(kI()===null&&ie&&K.some(fe=>fe.id===ie)){ju(ie);return}}ko()}})(),()=>{F=!0}},[Ht,n,Qs,p,J]),E.useEffect(()=>{const F=ry.current;F&&F.app===n&&(ry.current=null,ju(F.sid))},[n]);function YB(F,K){Ir(!1),F===n?ju(K):(ry.current={app:F,sid:K},r(F))}async function Fh(F){try{const K=await Tv(F,J),ie=await Promise.all(K.map(fe=>{var Te;return(Te=fe.events)!=null&&Te.length?Promise.resolve(fe):rg(F,J,fe.id)}));return i(ie),ie}catch(K){return Re(String(K)),[]}}function Ek(){p||(Re(""),S(""),N("confirm"),_(!0))}function WB(){var F;(F=R.current)==null||F.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&L==="temporary"&&P("agent")}async function GB(){var K;(K=R.current)==null||K.abort();const F=new AbortController;R.current=F,N("loading"),S("");try{const ie=await u1.startSession({signal:F.signal});if(R.current!==F)return;pt.current="",l(""),h([]),j(""),xe(Qi()),P("temporary"),ka(),pe(!1),_a(ye),ge([]),w([]),m(ie),_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),_(!1),N("confirm")}catch(ie){if((ie==null?void 0:ie.name)==="AbortError"||R.current!==F)return;S(ie instanceof Error?ie.message:String(ie)),N("error")}finally{R.current===F&&(R.current=null)}}function _o(){var K;(K=I.current)==null||K.abort(),I.current=null,b(!1),w([]),j(""),Re(""),P("agent");const F=p;m(null),F&&u1.closeSession(F.id).catch(ie=>Re(String(ie)))}async function qB(F){var Te;const K=p;if(!K||y||!F.trim())return;Re("");const ie=new AbortController;(Te=I.current)==null||Te.abort(),I.current=ie;const fe=[{role:"user",blocks:[{kind:"text",text:F}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Me=>[...Me,...fe]),b(!0);try{const Me=await u1.sendMessage({sessionId:K.id,text:F},{signal:ie.signal,onBlocks:tt=>{I.current===ie&&w(_e=>{const $e=_e.slice(),dt=$e[$e.length-1];return(dt==null?void 0:dt.role)==="assistant"&&($e[$e.length-1]={...dt,blocks:tt}),$e})}});if(I.current!==ie)return;w(tt=>{const _e=tt.slice(),$e=_e[_e.length-1];return($e==null?void 0:$e.role)==="assistant"&&(_e[_e.length-1]={...$e,blocks:Me.blocks,meta:{ts:Date.now()/1e3}}),_e})}catch(Me){if((Me==null?void 0:Me.name)==="AbortError"||I.current!==ie)return;w(tt=>tt.slice(0,-2)),j(F),Re(`内置智能体发送失败:${Me instanceof Error?Me.message:String(Me)}`)}finally{I.current===ie&&(I.current=null,b(!1))}}function ko(){_o(),Re(""),Wt(!1),Kn(AI()),P("agent"),z(null),ka(),pe(!1);const F=a&&W.length===0&&ye.length>0?a:"";pt.current="",l(""),le(null),X([]),d(!1),h([]),xe(Qi()),_a(ye),ge([]),F&&Na(F)}function XB(F){ce.current!==null&&window.clearTimeout(ce.current),St(F),ce.current=window.setTimeout(()=>{St(""),ce.current=null},3e3)}function QB(){if(_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),!n&&!p){yr(!0),XB("请先选择 agent");return}yr(!1),ko()}async function ZB(F){var K;try{(K=Bt.current.get(F))==null||K.abort(),await IE(n,J,F),await CE(n,J,F);const ie=zt.current.get(F);ie!==void 0&&window.clearTimeout(ie),zt.current.delete(F),bt(fe=>{if(!fe.has(F))return fe;const Te=new Set(fe);return Te.delete(F),Te}),U(fe=>{const{[F]:Te,...Me}=fe;return Me}),F===a&&ko(),await Fh(n)}catch(ie){Re(String(ie))}}async function ju(F){if(p&&_o(),F!==a&&(pt.current=F,Re(""),d(!1),h([]),P("agent"),z(null),ka(),xe(Qi()),le(null),X([]),l(F),D[F]===void 0)){Ks(!0);try{const K=await rg(n,J,F);$(F,uK(K.events??[],K.state))}catch(K){Re(String(K))}finally{Ks(!1)}}}async function JB(F){if(!F.sessionId||!F.messageId){Re("这条案例缺少会话定位信息,无法跳转。");return}Ir(!1),_t(null),We(!1),Et(!1),it(!1),on(!1),ny(n),SB(F.kind),Lh(F.messageId),await ju(F.sessionId)}function e8(){const F=lk||n;Ir(!1),_t(null),We(!1),Et(!1),it(!1),Vr(""),Rr(F),Lu("evaluations"),CB(NB),on(!0),ny(""),Lh("")}function t8(F){const K=new Map,ie=new Map;for(const fe of F){if(!fe.sessionId||!fe.messageId)continue;const Te=K.get(fe.sessionId)??new Set;if(Te.add(fe.messageId),K.set(fe.sessionId,Te),fe.runtimeId&&fe.userId){const Me=[fe.runtimeId,n,fe.userId,fe.sessionId].join(":"),tt=ie.get(Me)??{runtimeId:fe.runtimeId,appName:n,userId:fe.userId,sessionId:fe.sessionId,eventIds:new Set};tt.eventIds.add(fe.messageId),ie.set(Me,tt)}}if(K.size!==0){U(fe=>{const Te={...fe};for(const[Me,tt]of K){const _e=Te[Me];_e&&(Te[Me]=_e.map($e=>{var dt;return(dt=$e.meta)!=null&&dt.eventId&&tt.has($e.meta.eventId)?{...$e,meta:{...$e.meta,feedback:void 0}}:$e}))}return Te}),i(fe=>fe.map(Te=>{const Me=K.get(Te.id);if(!Me||!Te.state)return Te;const tt={...Te.state};for(const _e of Me)delete tt[`veadk_feedback:${_e}`];return{...Te,state:tt}})),at(fe=>{const Te=new Set(fe);for(const Me of K.values())for(const tt of Me)Te.delete(tt);return Te});for(const fe of ie.values())BM({runtimeId:fe.runtimeId,appName:fe.appName,userId:fe.userId,sessionId:fe.sessionId,eventIds:[...fe.eventIds]})}}async function xk(F=!0){if(a)return a;c.current||(c.current=ng(n,J));const K=c.current;try{const ie=await K;F&&l(ie);const fe=Date.now()/1e3,Te={id:ie,lastUpdateTime:fe,events:[]};return i(Me=>[Te,...Me.filter(tt=>tt.id!==ie)]),ie}finally{c.current===K&&(c.current=null)}}async function wk(F){if(!n||!J||!a||!ze)return!1;me(!0),Re("");try{const K=await OE(n,J,a,F,ze.revision);return le(K),!0}catch(K){return Re(String(K)),!1}finally{me(!1)}}async function vk(F){if(!(!n||!J||!a||!ze)){me(!0),Re("");try{const K=await ej(n,J,a,F,ze.revision);le(K)}catch(K){Re(String(K))}finally{me(!1)}}}async function n8(F){Re("");let K;try{K=await xk()}catch(fe){Re(String(fe));return}const ie=Array.from(F).map(fe=>({file:fe,attachment:{id:j1e(),mimeType:D1e(fe),name:fe.name,sizeBytes:fe.size,status:"uploading"}}));ge(fe=>[...fe,...ie.map(Te=>Te.attachment)]),await Promise.all(ie.map(async({file:fe,attachment:Te})=>{try{const Me=await qM(n,J,K,fe);if(Le.current.delete(Te.id)){Me.uri&&await im(n,Me.uri);return}ge(tt=>tt.map(_e=>_e.id===Te.id?Me:_e))}catch(Me){if(Le.current.delete(Te.id))return;const tt=Me instanceof Error?Me.message:String(Me);ge(_e=>_e.map($e=>$e.id===Te.id?{...$e,status:"error",error:tt}:$e)),Re(tt)}}))}async function _k(F,K=[],ie=Qi()){if(!F.trim()&&K.length===0||vi||Iu||!n||!J)return;Re("");const fe=[];(ie.skills.length>0||ie.targetAgent)&&fe.push({kind:"invocation",value:ie}),K.length&&fe.push({kind:"attachment",files:K.map(je=>({id:je.id,mimeType:je.mimeType,data:je.data,uri:je.uri,name:je.name,sizeBytes:je.sizeBytes}))}),F.trim()&&fe.push({kind:"text",text:F});const Te=[{role:"user",blocks:fe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Me=!a;Me&&(h(Te),d(!0));const tt=A;let _e;try{_e=await xk(!Me)}catch(je){Me&&(h([]),d(!1),j(F),xe(ie)),Re(String(je));return}let $e=ze!==null;if(tt)try{let je=await RE(n,J,_e);const ht=lge[tt].filter(Xt=>{var rr;return(rr=G.builtinTools)==null?void 0:rr.includes(Xt)});for(const Xt of[...J6[tt],...ht])je.tools.some(rr=>rr.name===Xt)||(je=await OE(n,J,_e,{kind:"tool",name:Xt},je.revision));le(je),$e=!0}catch(je){Me&&(h([]),d(!1),j(F),xe(ie)),Re(`任务能力挂载失败:${String(je)}`);return}$(_e,je=>Me?Te:[...je,...Te]),Me&&(pt.current=_e,l(_e),h([]),d(!1));const dt=new AbortController;Bt.current.set(_e,dt),Nt(_e,!0),Ut(_e),pt.current=_e,ns(je=>({...je,[_e]:""})),Es(je=>({...je,[_e]:new Set})),Cr(je=>({...je,[_e]:[]}));try{let je=ci(),ht="",Xt=0,rr=Date.now()/1e3,Ta="",Aa="";for await(const Rn of Tf({appName:n,userId:J,sessionId:_e,text:F,attachments:K,invocation:ie,signal:dt.signal,sessionCapabilities:$e})){if(dt.signal.aborted)break;const Gi=Rn.error??Rn.errorMessage??Rn.error_message;if(typeof Gi=="string"&&Gi){pt.current===_e&&Re(Gi);break}bo(_e,Rn);const Gn=Rn.author&&Rn.author!=="user"?Rn.author:"";Gn&&Gn!==ht&&(ht=Gn,je=ci()),je=Vc(je,Rn);const Pn=Rn.usageMetadata??Rn.usage_metadata;Pn!=null&&Pn.totalTokenCount&&(Xt=Pn.totalTokenCount),Rn.timestamp&&(rr=Rn.timestamp),Rn.id&&(Ta=Rn.id);const Kr=Rn.invocationId??Rn.invocation_id;Kr&&(Aa=Kr);const ki=je.blocks,rs={author:ht||void 0,tokens:Xt||void 0,ts:rr,eventId:Ta||void 0,invocationId:Aa||void 0};$(_e,py=>{var Uu;const ss=py.slice(),hn=ss[ss.length-1];return(hn==null?void 0:hn.role)==="assistant"&&(!((Uu=hn.meta)!=null&&Uu.author)||hn.meta.author===ht)?ss[ss.length-1]={...hn,blocks:ki,meta:rs}:ss.push({role:"assistant",blocks:ki,meta:rs}),ss})}Fh(n)}catch(je){(je==null?void 0:je.name)!=="AbortError"&&!dt.signal.aborted&&pt.current===_e&&Re(String(je))}finally{Bt.current.get(_e)===dt&&Bt.current.delete(_e),Nt(_e,!1),Be(_e),ns(je=>({...je,[_e]:""})),Cr(je=>({...je,[_e]:[]}))}}function r8(F,K){var Te,Me;const ie=((Te=F==null?void 0:F.event)==null?void 0:Te.name)??K.id,fe=((Me=F==null?void 0:F.event)==null?void 0:Me.context)??{};_k(`[ui-action] ${ie}: ${JSON.stringify(fe)}`)}async function s8(F){var $e,dt,je;if(!F.authUri)throw new Error("事件中没有授权地址。");if(!n||!J||!a)throw new Error("会话尚未就绪。");const K=a,ie=await R1e(F.authUri),fe=O1e(F.authConfig,ie),Te=ht=>ht.map(Xt=>Xt.kind==="auth"&&!Xt.done?{...Xt,done:!0}:Xt);$(K,ht=>{const Xt=ht.slice(),rr=Xt[Xt.length-1];return(rr==null?void 0:rr.role)==="assistant"&&(Xt[Xt.length-1]={...rr,blocks:Te(rr.blocks)}),Xt});const Me=M[M.length-1],tt=Te(Me&&Me.role==="assistant"?Me.blocks:[]),_e=new AbortController;Bt.current.set(K,_e),Nt(K,!0),Ut(K);try{let ht=ci(),Xt=(($e=Me==null?void 0:Me.meta)==null?void 0:$e.author)??"",rr=tt,Ta=0,Aa=Date.now()/1e3,Rn=((dt=Me==null?void 0:Me.meta)==null?void 0:dt.eventId)??"",Gi=((je=Me==null?void 0:Me.meta)==null?void 0:je.invocationId)??"";for await(const Gn of Tf({appName:n,userId:J,sessionId:a,text:"",functionResponses:[{id:F.callId,name:"adk_request_credential",response:fe}],signal:_e.signal,sessionCapabilities:ze!==null})){if(_e.signal.aborted)break;bo(K,Gn);const Pn=Gn.author&&Gn.author!=="user"?Gn.author:"";Pn&&Pn!==Xt&&(Xt=Pn,rr=[],ht=ci()),ht=Vc(ht,Gn);const Kr=Gn.usageMetadata??Gn.usage_metadata;Kr!=null&&Kr.totalTokenCount&&(Ta=Kr.totalTokenCount),Gn.timestamp&&(Aa=Gn.timestamp),Gn.id&&(Rn=Gn.id);const ki=Gn.invocationId??Gn.invocation_id;ki&&(Gi=ki);const rs=[...rr,...ht.blocks];$(K,py=>{var Ck,Ik,Rk,Ok,Lk;const ss=py.slice(),hn=ss[ss.length-1],Uu={author:Xt||((Ck=hn==null?void 0:hn.meta)==null?void 0:Ck.author),tokens:Ta||((Ik=hn==null?void 0:hn.meta)==null?void 0:Ik.tokens),ts:Aa,eventId:Rn||((Rk=hn==null?void 0:hn.meta)==null?void 0:Rk.eventId),invocationId:Gi||((Ok=hn==null?void 0:hn.meta)==null?void 0:Ok.invocationId)};return(hn==null?void 0:hn.role)==="assistant"&&(!((Lk=hn.meta)!=null&&Lk.author)||hn.meta.author===Xt)?ss[ss.length-1]={...hn,blocks:rs,meta:Uu}:ss.push({role:"assistant",blocks:rs,meta:Uu}),ss})}Fh(n)}catch(ht){(ht==null?void 0:ht.name)!=="AbortError"&&!_e.signal.aborted&&pt.current===K&&Re(String(ht))}finally{Bt.current.get(K)===_e&&Bt.current.delete(K),Nt(K,!1),Be(K),ns(ht=>({...ht,[K]:""})),Cr(ht=>({...ht,[K]:[]}))}}if(Vt)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Vt}),o.jsx("button",{type:"button",onClick:fy,children:"重试"})]});if(vt===null)return o.jsx("div",{className:"boot"});if(vt==="unauthenticated")return o.jsx(a1e,{branding:Yt,onUsername:VB});if(!Xe)return o.jsx("div",{className:"boot"});const Zs=Xe.capabilities.createAgents,kk=Xe.capabilities.manageAgents,Ns=Zs?Gs:null,Du=Zs&&Gt,Pu=Zs&&tn,Bu=Ou,Nk=_j(e,xo),Fu=Nk.filter(F=>F.runtimeId&&(dk===null||dk.has(F.runtimeId))).map(F=>{var K;return{...F,canDelete:F.runtimeId?((K=OB[F.runtimeId])==null?void 0:K.canDelete)===!0:!1}}),i8=(()=>{if(Fu.length===0)return Fu;const F=new Map(ok.map((K,ie)=>[K,ie]));return[...Fu].sort((K,ie)=>{const fe=F.get(K.id),Te=F.get(ie.id);return fe!=null&&Te!=null?fe-Te:fe!=null?-1:Te!=null?1:Fu.indexOf(K)-Fu.indexOf(ie)})})(),Uh=F=>{var K;return((K=Nk.find(ie=>ie.id===F))==null?void 0:K.label)??F},Or=xo.find(F=>F.runtimeId&&F.apps.some(K=>ro(F.id,K)===n)),Il=Or&&Or.runtimeId&&Or.region?{runtimeId:Or.runtimeId,name:Or.name,region:Or.region}:void 0,a8=(Il==null?void 0:Il.runtimeId)??xo.reduce((F,K)=>K.runtimeId??F,""),Sk=async(F,K)=>{var tt,_e;const ie=(tt=F.meta)==null?void 0:tt.eventId,fe=a;if(!ie||!fe||!Il)return;const Te=(_e=F.meta)==null?void 0:_e.feedback,Me={...Te,rating:K,syncStatus:"syncing",updatedAt:Date.now()/1e3};$(fe,$e=>$e.map(dt=>{var je;return((je=dt.meta)==null?void 0:je.eventId)===ie?{...dt,meta:{...dt.meta,feedback:Me}}:dt})),at($e=>new Set($e).add(ie));try{const $e=await zM({appName:n,userId:J,sessionId:fe,eventId:ie,rating:K});$(fe,dt=>dt.map(je=>{var ht;return((ht=je.meta)==null?void 0:ht.eventId)===ie?{...je,meta:{...je.meta,feedback:$e}}:je})),i(dt=>dt.map(je=>je.id===fe?{...je,state:{...je.state??{},[`veadk_feedback:${ie}`]:$e}}:je))}catch($e){$(fe,dt=>dt.map(je=>{var ht;return((ht=je.meta)==null?void 0:ht.eventId)===ie?{...je,meta:{...je.meta,feedback:Te}}:je})),pt.current===fe&&Re($e instanceof Error?$e.message:String($e))}finally{at($e=>{const dt=new Set($e);return dt.delete(ie),dt})}},$h=async F=>{Al(As());let K=re.current.get(F);K||(K=await $p(F),re.current.set(F,K)),B(K),F===n&&Ce(ie=>ie+1),pt.current="",l(""),yr(!1),r(F)},o8=F=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}yr(!1),on(!1),sy(F),$t(null),_t(null),Et(!0),Re("")},Tk=async F=>{if(F.runtime)try{const K=await ig(F.runtime.runtimeId,F.name,F.runtime.region,F.runtime.currentVersion);Al(As()),Ce(fe=>fe+1);const ie=await $p(K);re.current.set(K,ie),B(ie),ks(null),yr(!1),on(!1),ko(),r(K)}catch(K){Re(K instanceof Error?K.message:String(K))}},l8=F=>{F.runtime&&(ks(F),Vr(""),Rr(""),yr(!1),on(!0),Re(""))},Ak=()=>{p&&_o(),pt.current="",l(""),_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),Vr(""),Rr(""),yr(!0),Re("")},c8=F=>{if(ny(""),Lh(""),Ht){Tk(Ht);return}Vr(""),Rr(""),on(!1),$h(F)},u8=F=>(Vr(""),Rr(F),Lu("basic"),$h(F)),hy=Ht!=null&&Ht.runtime?xo.find(F=>{var K;return F.runtimeId===((K=Ht.runtime)==null?void 0:K.runtimeId)}):void 0,Wi=Ht!=null&&Ht.runtime?{id:`detail:${Ht.runtime.runtimeId}`,label:Ht.name,app:Ht.name,remote:!0,runtimeApp:hy==null?void 0:hy.apps[0],runtimeId:Ht.runtime.runtimeId,region:Ht.runtime.region,currentVersion:Ht.runtime.currentVersion,canDelete:Ht.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(IK,{branding:Yt,access:Xe,features:Yn,sessions:s,currentSessionId:a,streamingSids:Ye,onNewChat:QB,onSearch:()=>{p&&_o(),_t(null),it(!1),We(!1),Et(!1),on(!1),ks(null),yr(!1),Ir(!0),Re("")},onQuickCreate:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}p&&_o(),pt.current="",l(""),it(!1),We(!1),Ir(!1),on(!1),ks(null),yr(!1),_t(null),$t(null),sy("cn-beijing"),Et(!0),Re("")},onSkillCenter:()=>{p&&_o(),_t(null),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),it(!0),Re("")},onAddAgent:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}p&&_o(),pt.current="",_t(null),it(!1),Ir(!1),on(!1),ks(null),yr(!1),l(""),Et(!1),We(!0),Re("")},onMyAgents:Ak,onPickSession:F=>{_t(null),it(!1),We(!1),Et(!1),Ir(!1),on(!1),ks(null),yr(!1),Re(""),ju(F)},onDeleteSession:ZB,userInfo:Ue,version:kn,onLogout:KB}),(()=>{const F=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(n1e,{onExit:ko}),o.jsx(hge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Uh(n):"Agent",value:C,onChange:j,onSubmit:()=>{if(!p&&L==="skill-create"){const Te=C.trim();if(!Te||te)return;const Me={id:`pending-${Date.now()}`,prompt:Te,status:"provisioning",candidates:U_.map((_e,$e)=>({id:`pending-${$e}`,model:_e,modelLabel:_e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};pe(!0);const tt=++ne.current;Re(""),de(Me),j(""),Rbe(Te,_e=>{ne.current===tt&&de(_e)}).then(_e=>{ne.current===tt&&de(_e)}).catch(_e=>{ne.current===tt&&(de(null),j(Te),Re(_e instanceof Error?_e.message:String(_e)))}).finally(()=>{ne.current===tt&&pe(!1)});return}const K=C;if(j(""),p){qB(K);return}const ie=ye,fe=be;ge([]),xe(Qi()),_k(K,ie,fe),f1(ie)},disabled:p?!1:!J||L==="temporary"||L==="agent"&&!n,busy:p?y:L==="skill-create"?te:vi,showMeta:M.length>0&&!p,attachments:p?[]:ye,skills:p?[]:Nl,agents:p?[]:Sl,invocation:p?Qi():be,capabilitiesLoading:!p&>,allowAttachments:!p,onInvocationChange:xe,onAddFiles:n8,onRemoveAttachment:Tl,newChatMode:p?"agent":L,newChatTask:p?null:A,newChatLayout:!p&&M.length===0&&se===null,showModeSelector:!1,temporaryEnabled:Q&&G.temporaryEnabled,skillCreateEnabled:Q&&G.skillCreateEnabled,harnessEnabled:Q&&G.harnessEnabled,builtinTools:Q?G.builtinTools:[],onModeChange:K=>{if(!(K==="temporary"&&!G.temporaryEnabled||K==="skill-create"&&!G.skillCreateEnabled)){if(K==="temporary"){z(null),P(K),Ek();return}if(P(K),K!=="agent"&&z(null),Re(""),K==="skill-create"){xe(Qi());const ie=a&&W.length===0&&ye.length>0?a:"";_a(ye),ge([]),ie&&(pt.current="",l(""),Na(ie))}}},onTaskChange:z})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(KK,{appName:n,onAppChange:Bu?u8:$h,agentLabel:Uh,agentsSource:en,localApps:e,currentRuntime:Il,runtimeScope:Xe.capabilities.runtimeScope,onBrowseAgents:Ak,title:p?"Codex 智能体":Qs?"智能体":Du?"添加 Agent":Pu?"添加 AgentKit 智能体":Bu?Ht?Ht.name:iy?Uh(iy):"智能体详情":void 0,titleLeading:M.length>0&&!p&&L==="agent"&&!Du&&!Pu&&!nt&&!Rh&&!Bu&&!Qs&&Ns===null&&n?o.jsx("button",{ref:Jt,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":fn,onClick:()=>Wt(!0),children:o.jsx(Kc,{})}):void 0,crumbs:nt?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:Rh||Pu||Du||!Ns?void 0:Ns==="menu"?[{label:E1e,onClick:()=>{_t(null),$t(null),Et(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Dh(!0)},{label:x1e[Ns]}],rightContent:o.jsxs(o.Fragment,{children:[Xe.role==="admin"&&o.jsx(_be,{}),o.jsx(M1e,{tasks:Zs?Eo:[],onCancel:q})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[Je&&o.jsx("div",{className:"error",children:Je}),Ar&&o.jsxs("div",{className:"session-loading",children:[o.jsx(Ft,{className:"icon spin"})," 加载会话…"]}),lk&&!Bu&&!Du&&!Pu&&!Rh&&!nt&&Ns===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:e8,children:[o.jsx(hv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),Qs?o.jsx(_me,{onCreateAgent:o8,onCreateCodexAgent:Ek,onUseAgent:Tk,onViewAgentDetails:l8,connectedRuntimeId:a8,hiddenRuntimeIds:LB}):Bu?o.jsx(ume,{agents:Wi?[Wi]:i8,drafts:vs,agentOrder:ok,selectedAgentId:n,agentInfo:ke,agentInfoAgentId:n,loadingAgentInfo:gt,canCreate:Zs,canUpdate:Zs||kk,loadingAgents:IB,agentsError:RB,deploymentTasks:Eo,focusedDeploymentTaskId:pk,focusedAgentId:(Wi==null?void 0:Wi.id)??iy,focusedAgentSection:TB,focusedCaseKind:AB,detailOnly:!!Wi||!!pk,onRetryAgents:()=>void ly(),onAgentOrderChange:PB,onDeleteAgents:BB,onDeleteDrafts:DB,onSelectAgent:$h,onTalkAgent:c8,onOpenFeedbackCase:K=>void JB(K),onFeedbackCasesDeleted:t8,onCreateAgent:()=>{if(!Zs){Re("当前账号没有添加 Agent 的权限。");return}on(!1),Et(!0),_t(null),$t(null),_i(null),sy("cn-beijing"),Xs(""),_s.current=null,Vr(""),Rr(""),Re("")},onUpdateAgent:K=>{if(!kk&&!Zs){Re("当前账号没有管理 Agent 的权限。");return}if(!(Or!=null&&Or.runtimeId)){Re("仅支持更新已部署的云端智能体。");return}if(!Or.region){Re("Runtime 缺少地域信息,无法更新。");return}on(!1),$t(K);const ie=`runtime-${Or.runtimeId}`;Xs(ie),_s.current=vs.find(fe=>fe.id===ie)??null,Vr(""),Rr(""),_i({runtimeId:Or.runtimeId,name:Or.name,region:Or.region,currentVersion:Or.currentVersion}),_t("custom"),Re("")},onEditDraft:K=>{on(!1),$t(K.draft),Xs(K.id),_s.current=K,_i(K.deploymentTarget??null),Vr(""),Rr(""),_t("custom"),Re("")}},(Wi==null?void 0:Wi.id)??"workspace"):Du?o.jsx(e5,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:N1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{Et(!1),$t(null),_t("menu")}},{key:"package",icon:zz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{Et(!1),$t(null),_t("package")}}]}):Rh?o.jsx(_K,{userId:J,appId:n,agentInfo:ke,capabilitiesLoading:gt,agentLabel:Uh,onOpenSession:YB}):Pu?o.jsx(Kse,{onAdded:K=>{Al(As()),We(!1),r(K)},onCancel:()=>We(!1)}):nt?o.jsx(Vse,{}):Ns!==null&&!oe?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Ns==="menu"?o.jsx(C0e,{onSelect:K=>{$t(null),_i(null),Vr(""),Rr(""),Xs(K==="custom"?`draft-${Date.now().toString(36)}`:""),_s.current=null,_t(K)},onImport:K=>{$t(K),_i(null),Vr(""),Rr(""),Xs(`draft-${Date.now().toString(36)}`),_s.current=null,_t("custom")}}):Ns==="intelligent"?o.jsx(rye,{userId:J,onBack:()=>_t("menu"),onCreate:Bh,onAgentAdded:cy,onDeploymentTaskChange:O}):Ns==="custom"?o.jsx(Qye,{initialDraft:Dn??void 0,onBack:()=>_t("menu"),onCreate:Bh,onAgentAdded:cy,features:Yn,onDeploymentTaskChange:O,deploymentTarget:Cl??void 0,initialDeployRegion:jh,onDraftChange:(K,ie)=>{zr&&(ie?jB(zr,K,Cl??void 0):mk(zr))},onDiscard:zr?()=>{mk(zr),Xs(""),_s.current=null,$t(null),_i(null),Vr(""),Rr(n),_t(null),Et(!1),on(!0),Re("")}:void 0,onDeploymentStarted:gk,onDeploymentComplete:yk},zr||"custom"):Ns==="template"?o.jsx(ebe,{onBack:()=>_t("menu"),onCreate:Bh}):Ns==="workflow"?o.jsx(lbe,{onBack:()=>_t("menu"),onCreate:Bh}):Ns==="package"?o.jsx(hbe,{onBack:()=>{_t(null),Et(!0)},onAgentAdded:cy,onDeploymentTaskChange:O,onDeploymentStarted:gk,onDeploymentComplete:yk,initialDeployRegion:jh}):M.length===0&&se?o.jsx(Ybe,{initialJob:se}):M.length===0&&!Q?o.jsxs("div",{className:"session-loading",children:[o.jsx(Ft,{className:"icon spin"})," 正在检查 Agent 能力…"]}):M.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(ma,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":L==="skill-create"?"想创建一个什么 Skill?":Vn}),F]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Ru?" is-streaming":""}`,ref:Mu,onScroll:FB,onWheel:UB,onTouchMove:$B,children:M.map((K,ie)=>{var Ta,Aa,Rn,Gi,Gn;const fe=ie===M.length-1;if(K.role==="user"){const Pn=K.blocks.map(rs=>rs.kind==="text"?rs.text:"").join(""),Kr=K.blocks.flatMap(rs=>rs.kind==="attachment"?rs.files:[]),ki=K.blocks.find(rs=>rs.kind==="invocation");return o.jsxs(Zt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(ki==null?void 0:ki.kind)==="invocation"&&o.jsx(D_,{value:ki.value}),Kr.length>0&&o.jsx(B_,{appName:n,items:Kr}),Pn&&o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:Pn})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ta=K.meta)==null?void 0:Ta.ts)&&o.jsx("span",{className:"meta-text",children:kB(K.meta.ts)}),o.jsx(SI,{text:Pn})]})]},ie)}const Te=((Aa=K.meta)==null?void 0:Aa.author)??"",Me=Te&&nr?Ux(nr,Te):void 0,tt=!!(Te&&va.length>0&&!va.includes(Te)),_e=(Me==null?void 0:Me.name)||Te,$e=(Me==null?void 0:Me.description)||(tt?"正在执行主 Agent 移交的任务。":"");if(K.blocks.length>0&&K.blocks.every(Pn=>Pn.kind==="agent-transfer"))return null;const dt=K.blocks.length===0,je=((Gi=(Rn=K.meta)==null?void 0:Rn.feedback)==null?void 0:Gi.rating)??null,ht=((Gn=K.meta)==null?void 0:Gn.eventId)??"",Xt=Ve.has(ht),rr=!!(Il&&ht&&NI(K));return o.jsxs(Zt.div,{ref:Pn=>{ht&&(Pn?uy.current.set(ht,Pn):uy.current.delete(ht))},className:["turn turn--assistant",tt?"turn--subagent":"",Oh===ht?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[tt&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(Fz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:_e})]}),o.jsx("p",{className:"subagent-run-description",title:$e,children:$e})]}),dt?fe&&Ws?o.jsx(Q6,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(F_,{appName:n,blocks:K.blocks,streaming:fe&&(Ws||xa),onStreamFrame:fe?HB:void 0,onAction:r8,onAuth:s8,onArtifactDownload:(Pn,Kr)=>YM(n,J,a,Pn,Kr),onArtifactPreview:(Pn,Kr)=>GM(n,J,a,Pn,Kr)}),!(fe&&Ws)&&!C1e(K)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(fe&&Ws)&&!I1e(K)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[rr&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${je==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":je==="good","aria-busy":Xt,title:je==="good"?"取消点赞":"赞",disabled:Xt,onClick:()=>void Sk(K,je==="good"?null:"good"),children:o.jsx(r1e,{className:"icon",filled:je==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${je==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":je==="bad","aria-busy":Xt,title:je==="bad"?"取消点踩":"踩",disabled:Xt,onClick:()=>void Sk(K,je==="bad"?null:"bad"),children:o.jsx(s1e,{className:"icon",filled:je==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>sn(!0),children:o.jsx(S1e,{})}),o.jsx(SI,{text:NI(K)})]}),K.meta&&o.jsx("span",{className:"meta-text",children:T1e(K.meta)})]})]})]},ie)})}),!p&&o.jsx(jj,{appName:n,info:ke,loading:gt,activeAgent:xs,seenAgents:ws,execPath:wa,capabilities:ze,capabilityLoading:Ee,capabilityMutating:ee,builtinTools:ft,onAddCapability:wk,onRemoveCapability:K=>void vk(K)}),o.jsx("div",{className:"conversation-composer-slot",children:F})]})]})]})})(),rn&&a&&o.jsx(aB,{appName:n,sessionId:a,onClose:()=>sn(!1)}),fn&&M.length>0&&o.jsx(cY,{appName:n,info:ke,loading:gt,activeAgent:xs,seenAgents:ws,execPath:wa,capabilities:ze,capabilityLoading:Ee,capabilityMutating:ee,builtinTools:ft,onAddCapability:wk,onRemoveCapability:F=>void vk(F),onClose:Mn,returnFocusRef:Jt}),o.jsx(t1e,{open:x,state:k,error:T,onCancel:WB,onConfirm:()=>void GB()}),It&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:It}),o.jsx(o1e,{open:ue,checking:ve,error:ot,onLogin:()=>void zB()}),MB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Dh(!1),children:o.jsxs("div",{className:"confirm-box",onClick:F=>F.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Dh(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{$t(null),_t("menu"),Dh(!1)},children:"确定返回"})]})]})})]})}const CI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(CI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(CI,String(t))}catch{}window.location.reload()}});(()=>{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})()||h1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(q9,{reducedMotion:"user",children:o.jsx(Az,{maskOpacity:.9,children:o.jsx(P1e,{})})})}));export{E as A,w0 as B,fs as C,H1e as D,Hd as E,ll as F,k3 as G,F1e as R,Sr as V,kt as a,qc as b,y2 as c,z1e as d,Hv as e,gq as f,Rf as g,jt as h,LQ as i,UQ as j,bq as k,Wf as l,UZ as m,wQ as n,vQ as o,GZ as p,pZ as q,mZ as r,j3 as s,o as t,st as u,nn as v,At as w,$1e as x,RQ as y,ps as z}; diff --git a/veadk/webui/assets/index-ClNM_Oc4.css b/veadk/webui/assets/index-Tf-_sqTv.css similarity index 99% rename from veadk/webui/assets/index-ClNM_Oc4.css rename to veadk/webui/assets/index-Tf-_sqTv.css index c6c03009..fcd13205 100644 --- a/veadk/webui/assets/index-ClNM_Oc4.css +++ b/veadk/webui/assets/index-Tf-_sqTv.css @@ -7,4 +7,4 @@ 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:9px 56px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group.is-compact-empty .abc-group-head{border-bottom:0}.abc-group-head>span:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.studio-confirm-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:studio-confirm-fade-in .14s ease-out}.studio-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;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 24px 64px hsl(var(--foreground) / .16);animation:studio-confirm-rise-in .18s cubic-bezier(.2,.8,.2,1)}.studio-confirm-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))}.studio-confirm-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.studio-confirm-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:#f59f0a1f;color:#ba6708}.studio-confirm-title-icon svg,.studio-confirm-close svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-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;transition:background .16s ease,color .16s ease}.studio-confirm-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-confirm-close:focus-visible,.studio-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.studio-confirm-close:disabled{cursor:not-allowed;opacity:.48}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.studio-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.studio-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}.studio-confirm-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.studio-confirm-actions button:disabled{cursor:not-allowed;opacity:.6}.studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.studio-confirm-dialog--danger .studio-confirm-title-icon{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--destructive) / .9)}@keyframes studio-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes studio-confirm-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.studio-confirm-backdrop,.studio-confirm-dialog{animation:none}}.app-toast{position:fixed;top:20px;left:50%;z-index:120;padding:9px 14px;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 8px 24px hsl(var(--foreground) / .18);font-size:13px;font-weight:400;transform:translate(-50%)} +*/.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:9px 56px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group.is-compact-empty .abc-group-head{border-bottom:0}.abc-group-head>span:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.studio-confirm-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:studio-confirm-fade-in .14s ease-out}.studio-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;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 24px 64px hsl(var(--foreground) / .16);animation:studio-confirm-rise-in .18s cubic-bezier(.2,.8,.2,1)}.studio-confirm-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))}.studio-confirm-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.studio-confirm-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:#f59f0a1f;color:#ba6708}.studio-confirm-title-icon svg,.studio-confirm-close svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-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;transition:background .16s ease,color .16s ease}.studio-confirm-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-confirm-close:focus-visible,.studio-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.studio-confirm-close:disabled{cursor:not-allowed;opacity:.48}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.studio-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.studio-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}.studio-confirm-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.studio-confirm-actions button:disabled{cursor:not-allowed;opacity:.6}.studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.studio-confirm-dialog--warning .studio-confirm-title-icon{background:#f59f0a1f;color:#ba6708}.studio-confirm-dialog--danger .studio-confirm-title-icon{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--destructive) / .9)}@keyframes studio-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes studio-confirm-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.studio-confirm-backdrop,.studio-confirm-dialog{animation:none}}.app-toast{position:fixed;top:20px;left:50%;z-index:120;padding:9px 14px;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 8px 24px hsl(var(--foreground) / .18);font-size:13px;font-weight:400;transform:translate(-50%)} diff --git a/veadk/webui/index.html b/veadk/webui/index.html index d48e2225..05e07b03 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +
From 0b31a217d4bee79945aefb5b45b36c51e36d085f Mon Sep 17 00:00:00 2001 From: zhengchuyi Date: Thu, 30 Jul 2026 15:59:15 +0800 Subject: [PATCH 3/3] fix(frontend): refine agent validation feedback --- frontend/src/App.tsx | 2 +- frontend/src/create/CustomCreate.tsx | 30 +- frontend/src/styles.css | 32 +- frontend/tests/agentBuildCanvas.test.mjs | 5 +- frontend/tests/markdownPromptEditor.test.mjs | 37 ++- frontend/tests/sessionHeader.test.mjs | 6 +- ...tor-DdBhy0vU.js => CodeEditor-CfI7VXuc.js} | 2 +- ...vP.js => MarkdownPromptEditor-4R032isI.js} | 2 +- ...{index-Tf-_sqTv.css => index--lpW_agw.css} | 2 +- .../{index-DsGJ5Unm.js => index-CPoHDjEO.js} | 290 +++++++++--------- veadk/webui/index.html | 4 +- 11 files changed, 247 insertions(+), 165 deletions(-) rename veadk/webui/assets/{CodeEditor-DdBhy0vU.js => CodeEditor-CfI7VXuc.js} (99%) rename veadk/webui/assets/{MarkdownPromptEditor-CV6FT_vP.js => MarkdownPromptEditor-4R032isI.js} (99%) rename veadk/webui/assets/{index-Tf-_sqTv.css => index--lpW_agw.css} (99%) rename veadk/webui/assets/{index-DsGJ5Unm.js => index-CPoHDjEO.js} (78%) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 15bfabe4..4e7fb83d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2131,7 +2131,7 @@ export default function App() { if (!sandboxSession && !hasAgentSelection(appName, apps, connections)) { if (appName) clearSelectedAgentAfterRemoval(); setMyAgents(true); - showToast("请先选择 agent"); + showToast("请先选择 Agent 后再开始新会话"); return; } setMyAgents(false); diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 0465670e..61764c98 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -1440,6 +1440,7 @@ function nodeProblem( interface TreeProblem { path: NodePath; name: string; + typeLabel: string; problem: string; } @@ -1456,6 +1457,7 @@ function treeProblems( out.push({ path, name: remote ? "远程 Agent" : root.name.trim() || "未命名", + typeLabel: agentTypeMeta(root.agentType).label, problem: p, }); } @@ -1467,6 +1469,13 @@ function treeProblems( return out; } +function validationProblemMessage(problem: TreeProblem): string { + if (problem.problem === "缺少子 Agent") { + return `${problem.typeLabel}至少需要添加一个子 Agent 后才能调试或发布。`; + } + return `${problem.name}:${problem.problem}`; +} + /** Count the root Agent and every nested sub-Agent in the draft. */ function countDraftAgents(root: AgentDraft): number { return ( @@ -2813,7 +2822,9 @@ export function CustomCreate({ setValidationPulse((pulse) => pulse + 1); if (problems[0]) { setSelectedPath(problems[0].path); - window.requestAnimationFrame(() => scrollToSection("basic")); + window.requestAnimationFrame(() => + scrollToSection(problems[0].problem === "缺少子 Agent" ? "type" : "basic"), + ); } return false; }; @@ -3230,6 +3241,7 @@ export function CustomCreate({ const handleWorkspaceChange = async (nextMode: WorkspaceMode) => { if (nextMode === "publish") { + if (!requireCompleteDraft()) return; if (project) setWorkspaceMode("publish"); else openPublishPreview(); return; @@ -3362,7 +3374,11 @@ export function CustomCreate({
-
+
{AGENT_TYPES.map((t) => { const on = (node.agentType ?? "llm") === t.id; const remoteTypeDisabled = isRootAgent && t.id === "a2a"; @@ -3409,6 +3425,16 @@ export function CustomCreate({ ); })}
+ {showErrors && orchestrator && node.subAgents.length === 0 && ( + + {validationProblemMessage({ + path: safePath, + name: node.name.trim() || "未命名", + typeLabel: agentTypeMeta(node.agentType).label, + problem: "缺少子 Agent", + })} + + )}
diff --git a/frontend/src/styles.css b/frontend/src/styles.css index 0c63be48..3ffcc541 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -6159,15 +6159,31 @@ a.search-result { text-decoration: none; color: inherit; } .app-toast { position: fixed; - top: 20px; + top: 16px; left: 50%; z-index: 120; - padding: 9px 14px; - border-radius: 8px; - background: hsl(var(--foreground)); - color: hsl(var(--background)); - box-shadow: 0 8px 24px hsl(var(--foreground) / 0.18); - font-size: 13px; - font-weight: 400; + display: inline-flex; + align-items: center; + gap: 8px; + min-height: 36px; + max-width: min(360px, calc(100vw - 48px)); + padding: 8px 13px; + border: 1px solid hsl(var(--border)); + border-radius: 10px; + background: hsl(var(--panel)); + color: hsl(var(--foreground)); + box-shadow: 0 12px 30px hsl(var(--foreground) / 0.12); + font-size: 12.5px; + font-weight: 500; + line-height: 1.45; transform: translateX(-50%); } + +.app-toast::before { + content: ""; + flex: 0 0 auto; + width: 6px; + height: 6px; + border-radius: 999px; + background: hsl(var(--primary)); +} diff --git a/frontend/tests/agentBuildCanvas.test.mjs b/frontend/tests/agentBuildCanvas.test.mjs index 3d944f08..9e7e2a38 100644 --- a/frontend/tests/agentBuildCanvas.test.mjs +++ b/frontend/tests/agentBuildCanvas.test.mjs @@ -140,7 +140,10 @@ test("uses distinct restrained type colors and removes the LLM node icon", () => assert.match(source, /loop:\s*\{[\s\S]*?label:\s*"循环执行"/); assert.match(source, /\{type !== "llm" && \(/); assert.match(customCreateSource, /
/); - assert.match(customCreateSource, /role="radiogroup" aria-label="Agent 类型"/); + assert.match( + customCreateSource, + /role="radiogroup"[\s\S]*?aria-label="Agent 类型"/, + ); assert.match(customCreateSource, /className="cw-agent-type-radio"/); assert.match(customCreateSource, /data-agent-type=\{t\.id\}/); }); diff --git a/frontend/tests/markdownPromptEditor.test.mjs b/frontend/tests/markdownPromptEditor.test.mjs index 2be1d4f9..bb40d3e3 100644 --- a/frontend/tests/markdownPromptEditor.test.mjs +++ b/frontend/tests/markdownPromptEditor.test.mjs @@ -217,7 +217,10 @@ test("leaving debug mode uses the shared Studio confirm dialog", () => { test("agent type is a form section with radio choices", () => { assert.match(createSource, /
/); - assert.match(createSource, /role="radiogroup" aria-label="Agent 类型"/); + assert.match( + createSource, + /role="radiogroup"[\s\S]*?aria-label="Agent 类型"/, + ); assert.match(createSource, /type="radio"[\s\S]*?className="cw-agent-type-radio"/); assert.match(createStyles, /\.cw-agent-type-options\s*\{[\s\S]*?display:\s*grid/); assert.match(createStyles, /\.cw-agent-type-option\.is-on\s*\{/); @@ -248,6 +251,38 @@ test("build workspace has a validated primary path into debugging", () => { assert.doesNotMatch(createSource, /下一步:开始调试| { + assert.match( + createSource, + /if \(isOrchestratorType\(n\.agentType\)\)[\s\S]*?return n\.subAgents\.length === 0 \? "缺少子 Agent" : null;/, + ); + assert.match(createSource, /typeLabel: agentTypeMeta\(root\.agentType\)\.label/); + assert.match( + createSource, + /function validationProblemMessage\(problem: TreeProblem\): string \{[\s\S]*?problem\.problem === "缺少子 Agent"[\s\S]*?`\$\{problem\.typeLabel\}至少需要添加一个子 Agent 后才能调试或发布。`/, + ); + assert.match( + createSource, + /scrollToSection\(problems\[0\]\.problem === "缺少子 Agent" \? "type" : "basic"\)/, + ); + assert.match( + createSource, + /
[\s\S]*?className="cw-agent-type-options"[\s\S]*?\{showErrors && orchestrator && node\.subAgents\.length === 0 && \([\s\S]*?[\s\S]*?validationProblemMessage\(\{[\s\S]*?typeLabel: agentTypeMeta\(node\.agentType\)\.label,[\s\S]*?problem: "缺少子 Agent"/, + ); + assert.match( + createSource, + /\{buildErr && \([\s\S]*?className="cw-workspace-alert" role="alert"[\s\S]*?\{buildErr\}/, + ); + assert.doesNotMatch( + createSource, + /buildErr \|\| validationMessage|const validationMessage/, + ); + assert.match( + createSource, + /if \(nextMode === "publish"\) \{[\s\S]*?if \(!requireCompleteDraft\(\)\) return;[\s\S]*?if \(project\) setWorkspaceMode\("publish"\);/, + ); +}); + test("debug workspace compares multiple configurations behind one shared input", () => { assert.match(createSource, /label: "上下文优化"/); assert.match(createSource, /label: "幻觉抑制"/); diff --git a/frontend/tests/sessionHeader.test.mjs b/frontend/tests/sessionHeader.test.mjs index d86f2323..3639547e 100644 --- a/frontend/tests/sessionHeader.test.mjs +++ b/frontend/tests/sessionHeader.test.mjs @@ -39,12 +39,14 @@ test("shows the Codex identity instead of the Agent picker in sandbox sessions", test("redirects new chat to Agent selection when no Agent is active", () => { assert.match( appSource, - /function openNewChat\(\)[\s\S]*?!hasAgentSelection\(appName, apps, connections\)[\s\S]*?setMyAgents\(true\)[\s\S]*?showToast\("请先选择 agent"\)[\s\S]*?return;/, + /function openNewChat\(\)[\s\S]*?!hasAgentSelection\(appName, apps, connections\)[\s\S]*?setMyAgents\(true\)[\s\S]*?showToast\("请先选择 Agent 后再开始新会话"\)[\s\S]*?return;/, ); assert.match(appSource, /if \(appName\) clearSelectedAgentAfterRemoval\(\)/); assert.match(appSource, /onNewChat=\{openNewChat\}/); assert.match(appSource, /className="app-toast" role="status" aria-live="polite"/); - assert.match(stylesSource, /\.app-toast\s*\{[\s\S]*?position:\s*fixed;/); + assert.match(stylesSource, /\.app-toast\s*\{[\s\S]*?position:\s*fixed;[\s\S]*?border:\s*1px solid hsl\(var\(--border\)\);[\s\S]*?background:\s*hsl\(var\(--panel\)\);/); + assert.match(stylesSource, /\.app-toast::before\s*\{[\s\S]*?background:\s*hsl\(var\(--primary\)\);/); + assert.doesNotMatch(stylesSource, /\.app-toast\s*\{[\s\S]*?background:\s*hsl\(var\(--foreground\)\);/); }); test("only using an Agent selects it for the main conversation", () => { diff --git a/veadk/webui/assets/CodeEditor-DdBhy0vU.js b/veadk/webui/assets/CodeEditor-CfI7VXuc.js similarity index 99% rename from veadk/webui/assets/CodeEditor-DdBhy0vU.js rename to veadk/webui/assets/CodeEditor-CfI7VXuc.js index 6f85afc0..52195ce9 100644 --- a/veadk/webui/assets/CodeEditor-DdBhy0vU.js +++ b/veadk/webui/assets/CodeEditor-CfI7VXuc.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-DsGJ5Unm.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-CPoHDjEO.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-CV6FT_vP.js b/veadk/webui/assets/MarkdownPromptEditor-4R032isI.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-CV6FT_vP.js rename to veadk/webui/assets/MarkdownPromptEditor-4R032isI.js index 4cdafb0e..3ed0e5b1 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-CV6FT_vP.js +++ b/veadk/webui/assets/MarkdownPromptEditor-4R032isI.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-DsGJ5Unm.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-CPoHDjEO.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++nspan:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.studio-confirm-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:studio-confirm-fade-in .14s ease-out}.studio-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;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 24px 64px hsl(var(--foreground) / .16);animation:studio-confirm-rise-in .18s cubic-bezier(.2,.8,.2,1)}.studio-confirm-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))}.studio-confirm-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.studio-confirm-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:#f59f0a1f;color:#ba6708}.studio-confirm-title-icon svg,.studio-confirm-close svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-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;transition:background .16s ease,color .16s ease}.studio-confirm-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-confirm-close:focus-visible,.studio-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.studio-confirm-close:disabled{cursor:not-allowed;opacity:.48}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.studio-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.studio-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}.studio-confirm-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.studio-confirm-actions button:disabled{cursor:not-allowed;opacity:.6}.studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.studio-confirm-dialog--warning .studio-confirm-title-icon{background:#f59f0a1f;color:#ba6708}.studio-confirm-dialog--danger .studio-confirm-title-icon{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--destructive) / .9)}@keyframes studio-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes studio-confirm-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.studio-confirm-backdrop,.studio-confirm-dialog{animation:none}}.app-toast{position:fixed;top:20px;left:50%;z-index:120;padding:9px 14px;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 8px 24px hsl(var(--foreground) / .18);font-size:13px;font-weight:400;transform:translate(-50%)} +*/.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:9px 56px;border-bottom:1px solid hsl(var(--border) / .75)}.abc-group.is-compact-empty .abc-group-head{border-bottom:0}.abc-group-head>span:first-child{width:100%;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{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;line-height:1.3;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.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-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-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-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.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-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.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-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.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-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.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:#fff}.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-talk svg{width:15px;height:15px}.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{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.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-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.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-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.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-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;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-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button,.aw-case-note{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-note{margin-bottom:14px;padding:12px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.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-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.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:86px;display:grid;grid-template-columns:minmax(190px,.78fr) minmax(260px,1.32fr) minmax(150px,.52fr);align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:12px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-text,.aw-case-output,.aw-case-meta{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-title-line,.aw-case-meta-top{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{min-width:0}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:10.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-meta{align-items:flex-start}.aw-case-meta-top{width:100%;justify-content:space-between}.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-delete{width:26px;height:26px;flex:0 0 26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--destructive) / .2);border-radius:7px;background:transparent;color:hsl(var(--destructive));cursor:pointer}.aw-case-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-tag.is-good{background:#3c86661a;color:#28674c}.aw-case-tag.is-bad{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.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-readonly-config dd.is-ready{color:#1d7c40}.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,.86fr) minmax(200px,1.14fr) 104px}}@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-case-summary,.aw-case-row{grid-template-columns:minmax(0,1fr)}.aw-case-meta{align-items:flex-start}.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}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-region-picker{position:relative}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agents-region{display:inline-flex;align-items:center;justify-content:space-between;gap:4px;height:24px;padding:0 6px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:1;transition:background-color .16s ease}.my-agents-region:hover,.my-agents-region[aria-expanded=true]{background:hsl(var(--foreground) / .055)}.my-agents-region:focus-visible{outline:2px solid hsl(var(--ring) / .6);outline-offset:1px}.my-agents-region-chevron{width:12px;height:12px;flex:0 0 12px;color:hsl(var(--muted-foreground));transition:transform .16s ease}.my-agents-region-chevron.is-open{transform:rotate(180deg)}.my-agents-region-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:31;width:112px;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12);animation:my-agents-region-pop .14s ease-out}.my-agents-region-option{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12.5px;text-align:left}.my-agents-region-option:hover,.my-agents-region-option:focus-visible,.my-agents-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.my-agents-region-option.is-selected{font-weight:600}.my-agents-region-option svg{width:14px;height:14px;flex:0 0 14px;color:hsl(var(--primary))}@keyframes my-agents-region-pop{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-add{min-width:max-content;height:32px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.my-agent-add:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.48}.my-agent-add svg{width:14px;height:14px;flex:0 0 14px}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 14px}.my-agent-card{min-width:0;min-height:82px;display:grid;grid-template-columns:minmax(0,1fr) 68px;align-items:center;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .025);animation:my-agent-card-enter .22s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.my-agent-card:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--panel) / .88);box-shadow:0 3px 12px hsl(var(--foreground) / .06)}.my-agent-card-main{min-width:0;align-self:stretch;display:flex;align-items:center;padding:15px 4px 15px 16px;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;text-align:left}.my-agent-card-main:disabled{cursor:default}.my-agent-card-copy{min-width:0;display:block}.my-agent-card h3{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45;letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{margin-top:5px}.my-agent-created-at{display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}.my-agent-created-at dd{font-weight:400}.my-agent-connect{min-width:52px;height:32px;justify-self:center;display:inline-grid;place-items:center;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s ease,color .15s ease}.my-agent-connect:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-connect:disabled{cursor:default;opacity:.48}.my-agent-connect.is-connected,.my-agent-connect.is-connected:disabled{background:#e7f8ed;color:#1d7c40;opacity:1}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-empty .my-agent-empty-create{height:auto;padding:0;border:0;border-radius:0;background:transparent;color:hsl(var(--primary));font-size:inherit;text-decoration:underline;text-underline-offset:2px}.my-agent-empty .my-agent-empty-create:hover{color:hsl(var(--primary) / .78)}.my-agent-card-main:focus-visible,.my-agent-connect:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-add:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 980px){.my-agent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-add{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 640px){.my-agent-grid{grid-template-columns:1fr}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-connect,.my-agent-type-pill,.my-agent-add,.my-agent-search{transition:none}.my-agents-region,.my-agents-region-chevron,.my-agents-region-menu{transition:none;animation:none}}.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=presentation]{--builtin-tool-accent: 252 38% 52%}.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:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:linear-gradient(to bottom,hsl(var(--secondary) / 0),hsl(var(--secondary) / .18) 34%,hsl(var(--secondary) / .18));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-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.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;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.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%;max-width:none;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:13px;font-weight:600;color:hsl(var(--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}.case-return-bar{flex:0 0 auto;display:flex;justify-content:center;padding:12px 16px 0}.case-return-bar button{min-height:32px;display:inline-flex;align-items:center;gap:7px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;box-shadow:0 1px 2px hsl(var(--foreground) / .05)}.case-return-bar button:hover{background:hsl(var(--secondary) / .55)}.case-return-bar svg{width:14px;height:14px}.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}.turn--assistant.is-feedback-target{border-radius:12px;animation:feedback-target-pulse 2.4s ease-out}@keyframes feedback-target-pulse{0%{background:hsl(var(--foreground) / .07);box-shadow:0 0 0 8px hsl(var(--foreground) / .05)}to{background:transparent;box-shadow:0 0 hsl(var(--foreground) / 0)}}.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))}.artifact-list{display:grid;gap:8px;width:min(100%,440px);margin:6px 0}.artifact-card{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(216 80% 90%);border-radius:12px;background:#f5f9ff;color:hsl(var(--foreground));text-align:left}.artifact-card__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:#d8e7fd;color:#2371e7}.artifact-card__icon svg{width:18px;height:18px}.artifact-card__copy{display:grid;flex:1 1 auto;gap:3px;min-width:0}.artifact-card__name{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.artifact-card__hint{font-size:12px;color:hsl(var(--muted-foreground))}.artifact-card__actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}.artifact-card__action{display:inline-flex;align-items:center;flex:0 0 auto;gap:5px;min-height:30px;padding:0 10px;border:1px solid hsl(216 42% 82%);border-radius:8px;background:hsl(var(--background));color:#315b9b;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}.artifact-card__action:hover:not(:disabled){background:#ebf3ff}.artifact-card__action:disabled{cursor:default;opacity:.55}.artifact-card__action svg{width:14px;height:14px}.artifact-card__action--primary{border-color:#3e81e5;background:#2c77e8;color:#fff}.artifact-card__action--primary:hover:not(:disabled){background:#1867dc}.artifact-card__error{font-size:12px;color:hsl(var(--destructive))}.artifact-preview{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:28px}.artifact-preview__backdrop{position:absolute;top:0;right:0;bottom:0;left:0;border:0;background:#0b182b94;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);cursor:default}.artifact-preview__panel{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(1120px,92vw);max-height:90vh;border:1px solid hsl(var(--border));border-radius:16px;overflow:hidden;background:hsl(var(--background));box-shadow:0 26px 80px #0b182b4d}.artifact-preview__header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:52px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border));font-size:14px;font-weight:600}.artifact-preview__header button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.artifact-preview__header button:hover{background:hsl(var(--muted))}.artifact-preview__header svg{width:17px;height:17px}.artifact-preview__canvas{min-height:0;padding:18px;overflow:auto;background:#eceff3}.artifact-preview__canvas img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 6px 24px #0b182b29}.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--has-task .new-chat-mode{left:138px}.composer--new-chat.composer--task-image .new-chat-mode,.composer--new-chat.composer--task-video .new-chat-mode{left:176px}.composer--new-chat.composer--skill-mode .new-chat-mode{left:10px}.new-chat-task-chip{position:absolute;bottom:10px;left:52px;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:7px;width:78px;height:36px;padding:0 10px;border:0;border-radius:999px;background:transparent;color:#7a5bae;font:inherit;font-size:15px;line-height:1;white-space:nowrap;cursor:pointer;transition:background .15s ease,transform .15s ease}.new-chat-task-chip--image,.new-chat-task-chip--video{width:116px}.new-chat-task-chip--skill{left:10px;width:86px}.new-chat-task-chip>span:last-child{flex:0 0 auto;white-space:nowrap}.new-chat-task-chip:hover,.new-chat-task-chip:focus-visible{background:#f4f1f8;outline:none}.new-chat-task-chip:active{transform:scale(.97)}.new-chat-task-chip:disabled{cursor:default;opacity:.5}.new-chat-task-chip__icon{position:relative;display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border-radius:50%}.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{position:absolute;width:18px;height:18px;transition:opacity .12s ease,transform .15s ease}.new-chat-task-chip__remove-icon{width:12px;height:12px;padding:3px;border-radius:50%;background:#896bbd;color:#fff;opacity:0;transform:scale(.72);box-sizing:content-box}.new-chat-task-chip:hover .new-chat-task-chip__task-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__task-icon{opacity:0;transform:scale(.72)}.new-chat-task-chip:hover .new-chat-task-chip__remove-icon,.new-chat-task-chip:focus-visible .new-chat-task-chip__remove-icon{opacity:1;transform:scale(1)}.composer--new-chat .comp-send{position:absolute;right:10px;bottom:10px}.composer--new-chat .comp-send .icon{width:20px;height:20px}.task-shortcuts{position:absolute;top:calc(100% + 18px);left:0;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;width:100%;gap:10px}.task-shortcut{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:8px;min-width:92px;height:40px;padding:0 18px;border:1px solid hsl(var(--border) / .72);border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;opacity:0;transform:translateY(6px);animation:task-shortcut-enter .32s cubic-bezier(.22,1,.36,1) forwards;transition:border-color .14s ease,background .14s ease,color .14s ease,transform .14s ease}.task-shortcut>span{white-space:nowrap}.task-shortcut:nth-child(2){animation-delay:45ms}.task-shortcut:nth-child(3){animation-delay:90ms}.task-shortcut:nth-child(4){animation-delay:135ms}.task-shortcut:hover{border-color:#8970b257;background:#f6f5fa;color:#7454ab;transform:translateY(-1px)}.task-shortcut:focus-visible{outline:2px solid hsl(262 30% 57% / .34);outline-offset:2px}.task-shortcut:disabled{cursor:not-allowed;opacity:.5}.task-shortcut>svg{flex:0 0 auto;width:18px;height:18px;stroke:currentColor}.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:nth-child(4){animation-delay:195ms}.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{width:18px;height:18px;flex:0 0 auto;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>span{display:block;min-width:0;max-height:1.5em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:max-height .22s cubic-bezier(.22,1,.36,1)}.prompt-suggestion:hover>span,.prompt-suggestion:focus-visible>span{max-height:4.5em;white-space:normal;text-overflow:clip}.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)}.prompt-suggestion:nth-child(4):hover>svg{transform:rotate(5deg) scale(1.06)}@keyframes prompt-suggestion-enter{to{opacity:1;transform:translateY(0)}}@keyframes task-shortcut-enter{to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion: reduce){.task-shortcut,.prompt-suggestion,.new-chat-task-chip,.new-chat-task-chip__task-icon,.new-chat-task-chip__remove-icon{opacity:1;transform:none;animation:none;transition:none}.prompt-suggestion>svg{transition:none}.prompt-suggestion>span{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}.loading-gap-spinner{display:inline-block;width:16px;height:16px;flex:0 0 16px;box-sizing:border-box;border:1.5px solid #111;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}@keyframes loading-gap-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.loading-gap-spinner{animation-duration:1.4s}}.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)}.agent-switch{display:inline-flex;min-width:0;max-width:33.333cqw;align-items:center;gap:6px;padding:5px 8px;font-size:16px;font-weight:650;letter-spacing:-.01em}.agent-switch-action{display:inline-flex;width:28px;height:28px;flex:0 0 28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.agent-switch-action:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.agent-switch-action:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.agent-switch-action svg{width:16px;height:16px}@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)}.studio-confirm-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:studio-confirm-fade-in .14s ease-out}.studio-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;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 24px 64px hsl(var(--foreground) / .16);animation:studio-confirm-rise-in .18s cubic-bezier(.2,.8,.2,1)}.studio-confirm-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))}.studio-confirm-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.studio-confirm-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:#f59f0a1f;color:#ba6708}.studio-confirm-title-icon svg,.studio-confirm-close svg{width:16px;height:16px}.studio-confirm-title-wrap h2{min-width:0;margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.studio-confirm-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;transition:background .16s ease,color .16s ease}.studio-confirm-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-confirm-close:focus-visible,.studio-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.studio-confirm-close:disabled{cursor:not-allowed;opacity:.48}.studio-confirm-body{padding:24px 20px}.studio-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.studio-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.studio-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}.studio-confirm-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.studio-confirm-actions button:disabled{cursor:not-allowed;opacity:.6}.studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.studio-confirm-dialog--warning .studio-confirm-title-icon{background:#f59f0a1f;color:#ba6708}.studio-confirm-dialog--danger .studio-confirm-title-icon{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.studio-confirm-dialog--danger .studio-confirm-actions .studio-confirm-primary:hover:not(:disabled){background:hsl(var(--destructive) / .9)}@keyframes studio-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes studio-confirm-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.studio-confirm-backdrop,.studio-confirm-dialog{animation:none}}.app-toast{position:fixed;top:16px;left:50%;z-index:120;display:inline-flex;align-items:center;gap:8px;min-height:36px;max-width:min(360px,calc(100vw - 48px));padding:8px 13px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));color:hsl(var(--foreground));box-shadow:0 12px 30px hsl(var(--foreground) / .12);font-size:12.5px;font-weight:500;line-height:1.45;transform:translate(-50%)}.app-toast:before{content:"";flex:0 0 auto;width:6px;height:6px;border-radius:999px;background:hsl(var(--primary))} diff --git a/veadk/webui/assets/index-DsGJ5Unm.js b/veadk/webui/assets/index-CPoHDjEO.js similarity index 78% rename from veadk/webui/assets/index-DsGJ5Unm.js rename to veadk/webui/assets/index-CPoHDjEO.js index 995dbead..dbeeacf5 100644 --- a/veadk/webui/assets/index-DsGJ5Unm.js +++ b/veadk/webui/assets/index-CPoHDjEO.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-CV6FT_vP.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var m8=Object.defineProperty;var g8=(e,t,n)=>t in e?m8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pk=(e,t,n)=>g8(e,typeof t!="symbol"?t+"":t,n);function y8(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 _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var LI={exports:{}},Ug={},MI={exports:{}},At={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-4R032isI.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +var g8=Object.defineProperty;var y8=(e,t,n)=>t in e?g8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pk=(e,t,n)=>y8(e,typeof t!="symbol"?t+"":t,n);function b8(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 _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var LI={exports:{}},Ug={},MI={exports:{}},At={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ var m8=Object.defineProperty;var g8=(e,t,n)=>t in e?m8(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Qf=Symbol.for("react.element"),b8=Symbol.for("react.portal"),E8=Symbol.for("react.fragment"),x8=Symbol.for("react.strict_mode"),w8=Symbol.for("react.profiler"),v8=Symbol.for("react.provider"),_8=Symbol.for("react.context"),k8=Symbol.for("react.forward_ref"),N8=Symbol.for("react.suspense"),S8=Symbol.for("react.memo"),T8=Symbol.for("react.lazy"),Bk=Symbol.iterator;function A8(e){return e===null||typeof e!="object"?null:(e=Bk&&e[Bk]||e["@@iterator"],typeof e=="function"?e:null)}var jI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},DI=Object.assign,PI={};function gu(e,t,n){this.props=e,this.context=t,this.refs=PI,this.updater=n||jI}gu.prototype.isReactComponent={};gu.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")};gu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function BI(){}BI.prototype=gu.prototype;function Vx(e,t,n){this.props=e,this.context=t,this.refs=PI,this.updater=n||jI}var Kx=Vx.prototype=new BI;Kx.constructor=Vx;DI(Kx,gu.prototype);Kx.isPureReactComponent=!0;var Fk=Array.isArray,FI=Object.prototype.hasOwnProperty,Yx={current:null},UI={key:!0,ref:!0,__self:!0,__source:!0};function $I(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)FI.call(t,r)&&!UI.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1t in e?m8(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var L8=E,M8=Symbol.for("react.element"),j8=Symbol.for("react.fragment"),D8=Object.prototype.hasOwnProperty,P8=L8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B8={key:!0,ref:!0,__self:!0,__source:!0};function zI(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)D8.call(t,r)&&!B8.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:M8,type:e,key:i,ref:a,props:s,_owner:P8.current}}Ug.Fragment=j8;Ug.jsx=zI;Ug.jsxs=zI;LI.exports=Ug;var o=LI.exports,m1={},VI={exports:{}},Ns={},KI={exports:{}},YI={};/** + */var M8=E,j8=Symbol.for("react.element"),D8=Symbol.for("react.fragment"),P8=Object.prototype.hasOwnProperty,B8=M8.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,F8={key:!0,ref:!0,__self:!0,__source:!0};function zI(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)P8.call(t,r)&&!F8.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:j8,type:e,key:i,ref:a,props:s,_owner:B8.current}}Ug.Fragment=D8;Ug.jsx=zI;Ug.jsxs=zI;LI.exports=Ug;var o=LI.exports,m1={},VI={exports:{}},Ns={},KI={exports:{}},YI={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var m8=Object.defineProperty;var g8=(e,t,n)=>t in e?m8(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(O,D){var A=O.length;O.push(D);e:for(;0>>1,W=O[H];if(0>>1;Hs(X,A))nes(ce,X)?(O[H]=ce,O[ne]=A,H=ne):(O[H]=X,O[te]=A,H=te);else if(nes(ce,A))O[H]=ce,O[ne]=A,H=ne;else break e}}return D}function s(O,D){var A=O.sortIndex-D.sortIndex;return A!==0?A:O.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=O)r(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function _(O){if(g=!1,x(O),!m)if(n(c)!==null)m=!0,C(k);else{var D=n(u);D!==null&&M(_,D.startTime-O)}}function k(O,D){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var A=h;try{for(x(D),f=n(c);f!==null&&(!(f.expirationTime>D)||O&&!j());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var W=H(f.expirationTime<=D);D=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(c)&&r(c),x(D)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var te=n(u);te!==null&&M(_,te.startTime-D),P=!1}return P}finally{f=null,h=A,p=!1}}var N=!1,T=null,S=-1,R=5,I=-1;function j(){return!(e.unstable_now()-IO||125H?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(g?(y(S),S=-1):g=!0,M(_,A-H))):(O.sortIndex=W,t(c,O),m||p||(m=!0,C(k))),O},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(O){var D=h;return function(){var A=h;h=D;try{return O.apply(this,arguments)}finally{h=A}}}})(YI);KI.exports=YI;var F8=KI.exports;/** + */(function(e){function t(O,D){var A=O.length;O.push(D);e:for(;0>>1,W=O[H];if(0>>1;Hs(X,A))nes(ce,X)?(O[H]=ce,O[ne]=A,H=ne):(O[H]=X,O[te]=A,H=te);else if(nes(ce,A))O[H]=ce,O[ne]=A,H=ne;else break e}}return D}function s(O,D){var A=O.sortIndex-D.sortIndex;return A!==0?A:O.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=O)r(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(u)}}function _(O){if(g=!1,x(O),!m)if(n(c)!==null)m=!0,C(k);else{var D=n(u);D!==null&&M(_,D.startTime-O)}}function k(O,D){m=!1,g&&(g=!1,y(S),S=-1),p=!0;var A=h;try{for(x(D),f=n(c);f!==null&&(!(f.expirationTime>D)||O&&!j());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var W=H(f.expirationTime<=D);D=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(c)&&r(c),x(D)}else r(c);f=n(c)}if(f!==null)var P=!0;else{var te=n(u);te!==null&&M(_,te.startTime-D),P=!1}return P}finally{f=null,h=A,p=!1}}var N=!1,T=null,S=-1,R=5,I=-1;function j(){return!(e.unstable_now()-IO||125H?(O.sortIndex=A,t(u,O),n(c)===null&&O===n(u)&&(g?(y(S),S=-1):g=!0,M(_,A-H))):(O.sortIndex=W,t(c,O),m||p||(m=!0,C(k))),O},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(O){var D=h;return function(){var A=h;h=D;try{return O.apply(this,arguments)}finally{h=A}}}})(YI);KI.exports=YI;var U8=KI.exports;/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ var m8=Object.defineProperty;var g8=(e,t,n)=>t in e?m8(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var U8=E,ws=F8;function Me(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g1=Object.prototype.hasOwnProperty,$8=/^[: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]*$/,$k={},Hk={};function H8(e){return g1.call(Hk,e)?!0:g1.call($k,e)?!1:$8.test(e)?Hk[e]=!0:($k[e]=!0,!1)}function z8(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 V8(e,t,n,r){if(t===null||typeof t>"u"||z8(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 Qr(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 Sr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Sr[e]=new Qr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Sr[t]=new Qr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Sr[e]=new Qr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Sr[e]=new Qr(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){Sr[e]=new Qr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Sr[e]=new Qr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Sr[e]=new Qr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Sr[e]=new Qr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Sr[e]=new Qr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gx=/[\-:]([a-z])/g;function qx(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(Gx,qx);Sr[t]=new Qr(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(Gx,qx);Sr[t]=new Qr(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(Gx,qx);Sr[t]=new Qr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Sr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!1,!1)});Sr.xlinkHref=new Qr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Sr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xx(e,t,n,r){var s=Sr.hasOwnProperty(t)?Sr[t]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g1=Object.prototype.hasOwnProperty,H8=/^[: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]*$/,$k={},Hk={};function z8(e){return g1.call(Hk,e)?!0:g1.call($k,e)?!1:H8.test(e)?Hk[e]=!0:($k[e]=!0,!1)}function V8(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 K8(e,t,n,r){if(t===null||typeof t>"u"||V8(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 Qr(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 Tr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tr[e]=new Qr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tr[t]=new Qr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tr[e]=new Qr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tr[e]=new Qr(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){Tr[e]=new Qr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tr[e]=new Qr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tr[e]=new Qr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tr[e]=new Qr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tr[e]=new Qr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gx=/[\-:]([a-z])/g;function qx(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(Gx,qx);Tr[t]=new Qr(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(Gx,qx);Tr[t]=new Qr(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(Gx,qx);Tr[t]=new Qr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!1,!1)});Tr.xlinkHref=new Qr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tr[e]=new Qr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xx(e,t,n,r){var s=Tr.hasOwnProperty(t)?Tr[t]:null;(s!==null?s.type!==0:r||!(2l||s[a]!==i[l]){var c=` -`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Ey=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pd(e):""}function K8(e){switch(e.tag){case 5:return pd(e.type);case 16:return pd("Lazy");case 13:return pd("Suspense");case 19:return pd("SuspenseList");case 0:case 2:case 15:return e=xy(e.type,!1),e;case 11:return e=xy(e.type.render,!1),e;case 1:return e=xy(e.type,!0),e;default:return""}}function x1(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 Ql:return"Fragment";case Xl:return"Portal";case y1:return"Profiler";case Qx:return"StrictMode";case b1:return"Suspense";case E1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qI:return(e.displayName||"Context")+".Consumer";case GI:return(e._context.displayName||"Context")+".Provider";case Zx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jx:return t=e.displayName||null,t!==null?t:x1(e.type)||"Memo";case Ua:t=e._payload,e=e._init;try{return x1(e(t))}catch{}}return null}function Y8(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 x1(t);case 8:return t===Qx?"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 lo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function W8(e){var t=QI(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 Yh(e){e._valueTracker||(e._valueTracker=W8(e))}function ZI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=QI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function km(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 w1(e,t){var n=t.checked;return Un({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=lo(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 JI(e,t){t=t.checked,t!=null&&Xx(e,"checked",t,!1)}function v1(e,t){JI(e,t);var n=lo(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")?_1(e,t.type,n):t.hasOwnProperty("defaultValue")&&_1(e,t.type,lo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kk(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 _1(e,t,n){(t!=="number"||km(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var md=Array.isArray;function vc(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Wh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function of(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cd={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},G8=["Webkit","ms","Moz","O"];Object.keys(Cd).forEach(function(e){G8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cd[t]=Cd[e]})});function rR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cd.hasOwnProperty(e)&&Cd[e]?(""+t).trim():t+"px"}function sR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=rR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var q8=Un({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 S1(e,t){if(t){if(q8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Me(62))}}function T1(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 A1=null;function ew(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var C1=null,_c=null,kc=null;function Gk(e){if(e=eh(e)){if(typeof C1!="function")throw Error(Me(280));var t=e.stateNode;t&&(t=Kg(t),C1(e.stateNode,e.type,t))}}function iR(e){_c?kc?kc.push(e):kc=[e]:_c=e}function aR(){if(_c){var e=_c,t=kc;if(kc=_c=null,Gk(e),t)for(e=0;e>>=0,e===0?32:31-(aF(e)/oF|0)|0}var Gh=64,qh=4194304;function gd(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 Am(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 l=a&~s;l!==0?r=gd(l):(i&=a,i!==0&&(r=gd(i)))}else a=n&~s,a!==0?r=gd(a):i!==0&&(r=gd(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 Zf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gi(t),e[t]=n}function dF(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=Rd),rN=" ",sN=!1;function SR(e,t){switch(e){case"keyup":return FF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zl=!1;function $F(e,t){switch(e){case"compositionend":return TR(t);case"keypress":return t.which!==32?null:(sN=!0,rN);case"textInput":return e=t.data,e===rN&&sN?null:e;default:return null}}function HF(e,t){if(Zl)return e==="compositionend"||!lw&&SR(e,t)?(e=kR(),Wp=iw=Wa=null,Zl=!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=lN(n)}}function RR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function OR(){for(var e=window,t=km();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=km(e.document)}return t}function cw(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 QF(e){var t=OR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&RR(n.ownerDocument.documentElement,n)){if(r!==null&&cw(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=cN(n,i);var a=cN(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,Jl=null,j1=null,Ld=null,D1=!1;function uN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;D1||Jl==null||Jl!==km(r)||(r=Jl,"selectionStart"in r&&cw(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}),Ld&&hf(Ld,r)||(Ld=r,r=Rm(j1,"onSelect"),0nc||(e.current=H1[nc],H1[nc]=null,nc--)}function yn(e,t){nc++,H1[nc]=e.current,e.current=t}var co={},Pr=po(co),is=po(!1),sl=co;function Uc(e,t){var n=e.type.contextTypes;if(!n)return co;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 as(e){return e=e.childContextTypes,e!=null}function Lm(){vn(is),vn(Pr)}function yN(e,t,n){if(Pr.current!==co)throw Error(Me(168));yn(Pr,t),yn(is,n)}function $R(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Me(108,Y8(e)||"Unknown",s));return Un({},n,r)}function Mm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||co,sl=Pr.current,yn(Pr,e),yn(is,is.current),!0}function bN(e,t,n){var r=e.stateNode;if(!r)throw Error(Me(169));n?(e=$R(e,t,sl),r.__reactInternalMemoizedMergedChildContext=e,vn(is),vn(Pr),yn(Pr,e)):vn(is),yn(is,n)}var sa=null,Yg=!1,My=!1;function HR(e){sa===null?sa=[e]:sa.push(e)}function c9(e){Yg=!0,HR(e)}function mo(){if(!My&&sa!==null){My=!0;var e=0,t=Zt;try{var n=sa;for(Zt=1;e>=a,s-=a,aa=1<<32-gi(t)+s|n<S?(R=T,T=null):R=T.sibling;var I=h(y,T,x[S],_);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(y,T),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,T=R}if(S===x.length)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;SS?(R=T,T=null):R=T.sibling;var j=h(y,T,I.value,_);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(y,T),b=i(j,b,S),N===null?k=j:N.sibling=j,N=j,T=R}if(I.done)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return Cn&&Lo(y,S),k}for(T=r(y,T);!I.done;S++,I=x.next())I=p(T,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&T.forEach(function(F){return t(y,F)}),Cn&&Lo(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Ql&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Kh:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Ql){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ua&&wN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=qu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Ql?(b=Qo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=tm(x.type,x.key,x.props,null,y.mode,_),_.ref=qu(y,b,x),_.return=y,y=_)}return a(y);case Xl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Hy(x,y.mode,_),b.return=y,y=b}return a(y);case Ua:return N=x._init,w(y,b,N(x._payload),_)}if(md(x))return m(y,b,x,_);if(Vu(x))return g(y,b,x,_);np(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=$y(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var Hc=YR(!0),WR=YR(!1),Pm=po(null),Bm=null,ic=null,hw=null;function pw(){hw=ic=Bm=null}function mw(e){var t=Pm.current;vn(Pm),e._currentValue=t}function K1(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 Sc(e,t){Bm=e,hw=ic=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rs=!0),e.firstContext=null)}function Vs(e){var t=e._currentValue;if(hw!==e)if(e={context:e,memoizedValue:t,next:null},ic===null){if(Bm===null)throw Error(Me(308));ic=e,Bm.dependencies={lanes:0,firstContext:e}}else ic=ic.next=e;return t}var zo=null;function gw(e){zo===null?zo=[e]:zo.push(e)}function GR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gw(t)):(n.next=s.next,s.next=n),t.interleaved=n,ga(e,r)}function ga(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 $a=!1;function yw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qR(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 ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function no(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ga(e,n)}return s=r.interleaved,s===null?(t.next=t,gw(r)):(t.next=s.next,s.next=t),r.interleaved=t,ga(e,n)}function qp(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,nw(e,n)}}function vN(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 Fm(e,t,n,r){var s=e.updateQueue;$a=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Un({},f,h);break e;case 2:$a=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);ol|=a,e.lanes=a,e.memoizedState=f}}function _N(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Dy.transition;Dy.transition={};try{e(!1),t()}finally{Zt=n,Dy.transition=r}}function fO(){return Ks().memoizedState}function h9(e,t,n){var r=so(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hO(e))pO(t,n);else if(n=GR(e,t,n,r),n!==null){var s=Gr();yi(n,e,r,s),mO(n,t,r)}}function p9(e,t,n){var r=so(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hO(e))pO(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,wi(l,a)){var c=t.interleaved;c===null?(s.next=s,gw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=GR(e,t,s,r),n!==null&&(s=Gr(),yi(n,e,r,s),mO(n,t,r))}}function hO(e){var t=e.alternate;return e===Fn||t!==null&&t===Fn}function pO(e,t){Md=$m=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nw(e,n)}}var Hm={readContext:Vs,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},m9={readContext:Vs,useCallback:function(e,t){return Oi().memoizedState=[e,t===void 0?null:t],e},useContext:Vs,useEffect:NN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qp(4194308,4,oO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qp(4,2,e,t)},useMemo:function(e,t){var n=Oi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oi();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=h9.bind(null,Fn,e),[r.memoizedState,e]},useRef:function(e){var t=Oi();return e={current:e},t.memoizedState=e},useState:kN,useDebugValue:Nw,useDeferredValue:function(e){return Oi().memoizedState=e},useTransition:function(){var e=kN(!1),t=e[0];return e=f9.bind(null,e[1]),Oi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fn,s=Oi();if(Cn){if(n===void 0)throw Error(Me(407));n=n()}else{if(n=t(),xr===null)throw Error(Me(349));al&30||JR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,NN(tO.bind(null,r,i,e),[e]),r.flags|=2048,wf(9,eO.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Oi(),t=xr.identifierPrefix;if(Cn){var n=oa,r=aa;n=(r&~(1<<32-gi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ef++,0")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Ey=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pd(e):""}function Y8(e){switch(e.tag){case 5:return pd(e.type);case 16:return pd("Lazy");case 13:return pd("Suspense");case 19:return pd("SuspenseList");case 0:case 2:case 15:return e=xy(e.type,!1),e;case 11:return e=xy(e.type.render,!1),e;case 1:return e=xy(e.type,!0),e;default:return""}}function x1(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 Zl:return"Fragment";case Ql:return"Portal";case y1:return"Profiler";case Qx:return"StrictMode";case b1:return"Suspense";case E1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qI:return(e.displayName||"Context")+".Consumer";case GI:return(e._context.displayName||"Context")+".Provider";case Zx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jx:return t=e.displayName||null,t!==null?t:x1(e.type)||"Memo";case Ua:t=e._payload,e=e._init;try{return x1(e(t))}catch{}}return null}function W8(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 x1(t);case 8:return t===Qx?"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 lo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QI(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function G8(e){var t=QI(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 Yh(e){e._valueTracker||(e._valueTracker=G8(e))}function ZI(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=QI(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function km(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 w1(e,t){var n=t.checked;return Un({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=lo(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 JI(e,t){t=t.checked,t!=null&&Xx(e,"checked",t,!1)}function v1(e,t){JI(e,t);var n=lo(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")?_1(e,t.type,n):t.hasOwnProperty("defaultValue")&&_1(e,t.type,lo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kk(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 _1(e,t,n){(t!=="number"||km(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var md=Array.isArray;function _c(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Wh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function of(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cd={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},q8=["Webkit","ms","Moz","O"];Object.keys(Cd).forEach(function(e){q8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Cd[t]=Cd[e]})});function rR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Cd.hasOwnProperty(e)&&Cd[e]?(""+t).trim():t+"px"}function sR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=rR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var X8=Un({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 S1(e,t){if(t){if(X8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Me(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Me(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Me(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Me(62))}}function T1(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 A1=null;function ew(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var C1=null,kc=null,Nc=null;function Gk(e){if(e=eh(e)){if(typeof C1!="function")throw Error(Me(280));var t=e.stateNode;t&&(t=Kg(t),C1(e.stateNode,e.type,t))}}function iR(e){kc?Nc?Nc.push(e):Nc=[e]:kc=e}function aR(){if(kc){var e=kc,t=Nc;if(Nc=kc=null,Gk(e),t)for(e=0;e>>=0,e===0?32:31-(oF(e)/lF|0)|0}var Gh=64,qh=4194304;function gd(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 Am(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 l=a&~s;l!==0?r=gd(l):(i&=a,i!==0&&(r=gd(i)))}else a=n&~s,a!==0?r=gd(a):i!==0&&(r=gd(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 Zf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gi(t),e[t]=n}function fF(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=Rd),rN=" ",sN=!1;function SR(e,t){switch(e){case"keyup":return UF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TR(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function HF(e,t){switch(e){case"compositionend":return TR(t);case"keypress":return t.which!==32?null:(sN=!0,rN);case"textInput":return e=t.data,e===rN&&sN?null:e;default:return null}}function zF(e,t){if(Jl)return e==="compositionend"||!lw&&SR(e,t)?(e=kR(),Wp=iw=Wa=null,Jl=!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=lN(n)}}function RR(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RR(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function OR(){for(var e=window,t=km();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=km(e.document)}return t}function cw(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 ZF(e){var t=OR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&RR(n.ownerDocument.documentElement,n)){if(r!==null&&cw(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=cN(n,i);var a=cN(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,ec=null,j1=null,Ld=null,D1=!1;function uN(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;D1||ec==null||ec!==km(r)||(r=ec,"selectionStart"in r&&cw(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}),Ld&&hf(Ld,r)||(Ld=r,r=Rm(j1,"onSelect"),0rc||(e.current=H1[rc],H1[rc]=null,rc--)}function yn(e,t){rc++,H1[rc]=e.current,e.current=t}var co={},Pr=po(co),is=po(!1),sl=co;function $c(e,t){var n=e.type.contextTypes;if(!n)return co;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 as(e){return e=e.childContextTypes,e!=null}function Lm(){vn(is),vn(Pr)}function yN(e,t,n){if(Pr.current!==co)throw Error(Me(168));yn(Pr,t),yn(is,n)}function $R(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Me(108,W8(e)||"Unknown",s));return Un({},n,r)}function Mm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||co,sl=Pr.current,yn(Pr,e),yn(is,is.current),!0}function bN(e,t,n){var r=e.stateNode;if(!r)throw Error(Me(169));n?(e=$R(e,t,sl),r.__reactInternalMemoizedMergedChildContext=e,vn(is),vn(Pr),yn(Pr,e)):vn(is),yn(is,n)}var sa=null,Yg=!1,My=!1;function HR(e){sa===null?sa=[e]:sa.push(e)}function u9(e){Yg=!0,HR(e)}function mo(){if(!My&&sa!==null){My=!0;var e=0,t=Zt;try{var n=sa;for(Zt=1;e>=a,s-=a,aa=1<<32-gi(t)+s|n<S?(R=T,T=null):R=T.sibling;var I=h(y,T,x[S],_);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(y,T),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I,T=R}if(S===x.length)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;SS?(R=T,T=null):R=T.sibling;var j=h(y,T,I.value,_);if(j===null){T===null&&(T=R);break}e&&T&&j.alternate===null&&t(y,T),b=i(j,b,S),N===null?k=j:N.sibling=j,N=j,T=R}if(I.done)return n(y,T),Cn&&Lo(y,S),k;if(T===null){for(;!I.done;S++,I=x.next())I=f(y,I.value,_),I!==null&&(b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return Cn&&Lo(y,S),k}for(T=r(y,T);!I.done;S++,I=x.next())I=p(T,y,S,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?S:I.key),b=i(I,b,S),N===null?k=I:N.sibling=I,N=I);return e&&T.forEach(function(F){return t(y,F)}),Cn&&Lo(y,S),k}function w(y,b,x,_){if(typeof x=="object"&&x!==null&&x.type===Zl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Kh:e:{for(var k=x.key,N=b;N!==null;){if(N.key===k){if(k=x.type,k===Zl){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ua&&wN(k)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=Xu(y,N,x),b.return=y,y=b;break e}n(y,N);break}else t(y,N);N=N.sibling}x.type===Zl?(b=Qo(x.props.children,y.mode,_,x.key),b.return=y,y=b):(_=tm(x.type,x.key,x.props,null,y.mode,_),_.ref=Xu(y,b,x),_.return=y,y=_)}return a(y);case Ql:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Hy(x,y.mode,_),b.return=y,y=b}return a(y);case Ua:return N=x._init,w(y,b,N(x._payload),_)}if(md(x))return m(y,b,x,_);if(Ku(x))return g(y,b,x,_);np(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=$y(x,y.mode,_),b.return=y,y=b),a(y)):n(y,b)}return w}var zc=YR(!0),WR=YR(!1),Pm=po(null),Bm=null,ac=null,hw=null;function pw(){hw=ac=Bm=null}function mw(e){var t=Pm.current;vn(Pm),e._currentValue=t}function K1(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 Tc(e,t){Bm=e,hw=ac=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rs=!0),e.firstContext=null)}function Vs(e){var t=e._currentValue;if(hw!==e)if(e={context:e,memoizedValue:t,next:null},ac===null){if(Bm===null)throw Error(Me(308));ac=e,Bm.dependencies={lanes:0,firstContext:e}}else ac=ac.next=e;return t}var zo=null;function gw(e){zo===null?zo=[e]:zo.push(e)}function GR(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,gw(t)):(n.next=s.next,s.next=n),t.interleaved=n,ga(e,r)}function ga(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 $a=!1;function yw(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qR(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 ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function no(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ga(e,n)}return s=r.interleaved,s===null?(t.next=t,gw(r)):(t.next=s.next,s.next=t),r.interleaved=t,ga(e,n)}function qp(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,nw(e,n)}}function vN(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 Fm(e,t,n,r){var s=e.updateQueue;$a=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(h=t,p=n,g.tag){case 1:if(m=g.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=g.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Un({},f,h);break e;case 2:$a=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=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);ol|=a,e.lanes=a,e.memoizedState=f}}function _N(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Dy.transition;Dy.transition={};try{e(!1),t()}finally{Zt=n,Dy.transition=r}}function fO(){return Ks().memoizedState}function p9(e,t,n){var r=so(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hO(e))pO(t,n);else if(n=GR(e,t,n,r),n!==null){var s=Gr();yi(n,e,r,s),mO(n,t,r)}}function m9(e,t,n){var r=so(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hO(e))pO(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,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,wi(l,a)){var c=t.interleaved;c===null?(s.next=s,gw(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=GR(e,t,s,r),n!==null&&(s=Gr(),yi(n,e,r,s),mO(n,t,r))}}function hO(e){var t=e.alternate;return e===Fn||t!==null&&t===Fn}function pO(e,t){Md=$m=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nw(e,n)}}var Hm={readContext:Vs,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},g9={readContext:Vs,useCallback:function(e,t){return Oi().memoizedState=[e,t===void 0?null:t],e},useContext:Vs,useEffect:NN,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qp(4194308,4,oO.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qp(4,2,e,t)},useMemo:function(e,t){var n=Oi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oi();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=p9.bind(null,Fn,e),[r.memoizedState,e]},useRef:function(e){var t=Oi();return e={current:e},t.memoizedState=e},useState:kN,useDebugValue:Nw,useDeferredValue:function(e){return Oi().memoizedState=e},useTransition:function(){var e=kN(!1),t=e[0];return e=h9.bind(null,e[1]),Oi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fn,s=Oi();if(Cn){if(n===void 0)throw Error(Me(407));n=n()}else{if(n=t(),xr===null)throw Error(Me(349));al&30||JR(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,NN(tO.bind(null,r,i,e),[e]),r.flags|=2048,wf(9,eO.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Oi(),t=xr.identifierPrefix;if(Cn){var n=oa,r=aa;n=(r&~(1<<32-gi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ef++,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[Di]=t,e[gf]=r,NO(e,t,!1,!1),t.stateNode=e;e:{switch(a=T1(n,r),n){case"dialog":wn("cancel",e),wn("close",e),s=r;break;case"iframe":case"object":case"embed":wn("load",e),s=r;break;case"video":case"audio":for(s=0;sKc&&(t.flags|=128,r=!0,Xu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Um(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Cn)return Rr(t),null}else 2*Xn()-i.renderingStartTime>Kc&&n!==1073741824&&(t.flags|=128,r=!0,Xu(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=Xn(),t.sibling=null,n=Pn.current,yn(Pn,r?n&1|2:n&1),t):(Rr(t),null);case 22:case 23:return Rw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ms&1073741824&&(Rr(t),t.subtreeFlags&6&&(t.flags|=8192)):Rr(t),null;case 24:return null;case 25:return null}throw Error(Me(156,t.tag))}function _9(e,t){switch(dw(t),t.tag){case 1:return as(t.type)&&Lm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zc(),vn(is),vn(Pr),xw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ew(t),null;case 13:if(vn(Pn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Me(340));$c()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vn(Pn),null;case 4:return zc(),null;case 10:return mw(t.type._context),null;case 22:case 23:return Rw(),null;case 24:return null;default:return null}}var sp=!1,Lr=!1,k9=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function ac(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vn(e,t,r)}else n.current=null}function eE(e,t,n){try{n()}catch(r){Vn(e,t,r)}}var DN=!1;function N9(e,t){if(P1=Cm,e=OR(),cw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(B1={focusedElem:e,selectionRange:n},Cm=!1,Xe=t;Xe!==null;)if(t=Xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xe=e;else for(;Xe!==null;){t=Xe;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:oi(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(_){Vn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Xe=e;break}Xe=t.return}return m=DN,DN=!1,m}function jd(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&&eE(t,n,i)}s=s.next}while(s!==r)}}function qg(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 tE(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 AO(e){var t=e.alternate;t!==null&&(e.alternate=null,AO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[gf],delete t[$1],delete t[o9],delete t[l9])),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 CO(e){return e.tag===5||e.tag===3||e.tag===4}function PN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CO(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 nE(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=Om));else if(r!==4&&(e=e.child,e!==null))for(nE(e,t,n),e=e.sibling;e!==null;)nE(e,t,n),e=e.sibling}function rE(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(rE(e,t,n),e=e.sibling;e!==null;)rE(e,t,n),e=e.sibling}var vr=null,li=!1;function Oa(e,t,n){for(n=n.child;n!==null;)IO(e,t,n),n=n.sibling}function IO(e,t,n){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount($g,n)}catch{}switch(n.tag){case 5:Lr||ac(n,t);case 6:var r=vr,s=li;vr=null,Oa(e,t,n),vr=r,li=s,vr!==null&&(li?(e=vr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):vr.removeChild(n.stateNode));break;case 18:vr!==null&&(li?(e=vr,n=n.stateNode,e.nodeType===8?Ly(e.parentNode,n):e.nodeType===1&&Ly(e,n),df(e)):Ly(vr,n.stateNode));break;case 4:r=vr,s=li,vr=n.stateNode.containerInfo,li=!0,Oa(e,t,n),vr=r,li=s;break;case 0:case 11:case 14:case 15:if(!Lr&&(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)&&eE(n,t,a),s=s.next}while(s!==r)}Oa(e,t,n);break;case 1:if(!Lr&&(ac(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Vn(n,t,l)}Oa(e,t,n);break;case 21:Oa(e,t,n);break;case 22:n.mode&1?(Lr=(r=Lr)||n.memoizedState!==null,Oa(e,t,n),Lr=r):Oa(e,t,n);break;default:Oa(e,t,n)}}function BN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new k9),t.forEach(function(r){var s=M9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ri(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Xn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*T9(r/1960))-r,10e?16:e,Ga===null)var r=!1;else{if(e=Ga,Ga=null,Km=0,Dt&6)throw Error(Me(331));var s=Dt;for(Dt|=4,Xe=e.current;Xe!==null;){var i=Xe,a=i.child;if(Xe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cXn()-Cw?Xo(e,0):Aw|=n),os(e,t)}function BO(e,t){t===0&&(e.mode&1?(t=qh,qh<<=1,!(qh&130023424)&&(qh=4194304)):t=1);var n=Gr();e=ga(e,t),e!==null&&(Zf(e,t,n),os(e,n))}function L9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BO(e,n)}function M9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Me(314))}r!==null&&r.delete(t),BO(e,n)}var FO;FO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||is.current)rs=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rs=!1,w9(e,t,n);rs=!!(e.flags&131072)}else rs=!1,Cn&&t.flags&1048576&&zR(t,Dm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zp(e,t),e=t.pendingProps;var s=Uc(t,Pr.current);Sc(t,n),s=vw(null,t,r,e,s,n);var i=_w();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,as(r)?(i=!0,Mm(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,yw(t),s.updater=Gg,t.stateNode=s,s._reactInternals=t,W1(t,r,e,n),t=X1(null,t,r,!0,i,n)):(t.tag=0,Cn&&i&&uw(t),Vr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=D9(r),e=oi(r,e),s){case 0:t=q1(null,t,r,e,n);break e;case 1:t=LN(null,t,r,e,n);break e;case 11:t=RN(null,t,r,e,n);break e;case 14:t=ON(null,t,r,oi(r.type,e),n);break e}throw Error(Me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),q1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),LN(e,t,r,s,n);case 3:e:{if(vO(t),e===null)throw Error(Me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,qR(e,t),Fm(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=Vc(Error(Me(423)),t),t=MN(e,t,r,n,s);break e}else if(r!==s){s=Vc(Error(Me(424)),t),t=MN(e,t,r,n,s);break e}else for(ys=to(t.stateNode.containerInfo.firstChild),bs=t,Cn=!0,ui=null,n=WR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($c(),r===s){t=ya(e,t,n);break e}Vr(e,t,r,n)}t=t.child}return t;case 5:return XR(t),e===null&&V1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,F1(r,s)?a=null:i!==null&&F1(r,i)&&(t.flags|=32),wO(e,t),Vr(e,t,a,n),t.child;case 6:return e===null&&V1(t),null;case 13:return _O(e,t,n);case 4:return bw(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:oi(r,s),RN(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,yn(Pm,r._currentValue),r._currentValue=a,i!==null)if(wi(i.value,a)){if(i.children===s.children&&!is.current){t=ya(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ua(-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),K1(i.return,n,t),l.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(Me(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),K1(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,Sc(t,n),s=Vs(s),r=r(s),t.flags|=1,Vr(e,t,r,n),t.child;case 14:return r=t.type,s=oi(r,t.pendingProps),s=oi(r.type,s),ON(e,t,r,s,n);case 15:return EO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),Zp(e,t),t.tag=1,as(r)?(e=!0,Mm(t)):e=!1,Sc(t,n),gO(t,r,s),W1(t,r,s,n),X1(null,t,r,!0,e,n);case 19:return kO(e,t,n);case 22:return xO(e,t,n)}throw Error(Me(156,t.tag))};function UO(e,t){return hR(e,t)}function j9(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 Us(e,t,n,r){return new j9(e,t,n,r)}function Lw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function D9(e){if(typeof e=="function")return Lw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zx)return 11;if(e===Jx)return 14}return 2}function io(e,t){var n=e.alternate;return n===null?(n=Us(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 tm(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Lw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ql:return Qo(n.children,s,i,t);case Qx:a=8,s|=8;break;case y1:return e=Us(12,n,t,s|2),e.elementType=y1,e.lanes=i,e;case b1:return e=Us(13,n,t,s),e.elementType=b1,e.lanes=i,e;case E1:return e=Us(19,n,t,s),e.elementType=E1,e.lanes=i,e;case XI:return Qg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case GI:a=10;break e;case qI:a=9;break e;case Zx:a=11;break e;case Jx:a=14;break e;case Ua:a=16,r=null;break e}throw Error(Me(130,e==null?e:typeof e,""))}return t=Us(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Qo(e,t,n,r){return e=Us(7,e,r,t),e.lanes=n,e}function Qg(e,t,n,r){return e=Us(22,e,r,t),e.elementType=XI,e.lanes=n,e.stateNode={isHidden:!1},e}function $y(e,t,n){return e=Us(6,e,null,t),e.lanes=n,e}function Hy(e,t,n){return t=Us(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function P9(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=vy(0),this.expirationTimes=vy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Mw(e,t,n,r,s,i,a,l,c){return e=new P9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Us(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yw(i),e}function B9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VO)}catch(e){console.error(e)}}VO(),VI.exports=Ns;var vs=VI.exports,YN=vs;m1.createRoot=YN.createRoot,m1.hydrateRoot=YN.hydrateRoot;const Bw=E.createContext({});function n0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const r0=E.createContext(null),_f=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class z9 extends E.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 V9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(_f);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Fy(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function G1(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var E9=typeof WeakMap=="function"?WeakMap:Map;function yO(e,t,n){n=ua(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vm||(Vm=!0,sE=r),G1(e,t)},n}function bO(e,t,n){n=ua(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){G1(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){G1(e,t),typeof r!="function"&&(ro===null?ro=new Set([this]):ro.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function AN(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new E9;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=L9.bind(null,e,t,n),t.then(e,e))}function CN(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function IN(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ua(-1,1),t.tag=2,no(n,t,1))),n.lanes|=1),e)}var x9=wa.ReactCurrentOwner,rs=!1;function Vr(e,t,n,r){t.child=e===null?WR(t,null,n,r):zc(t,e.child,n,r)}function RN(e,t,n,r,s){n=n.render;var i=t.ref;return Tc(t,s),r=vw(e,t,n,r,i,s),n=_w(),e!==null&&!rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ya(e,t,s)):(Cn&&n&&uw(t),t.flags|=1,Vr(e,t,r,s),t.child)}function ON(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Lw(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,EO(e,t,i,r,s)):(e=tm(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:hf,n(a,r)&&e.ref===t.ref)return ya(e,t,s)}return t.flags|=1,e=io(i,r),e.ref=t.ref,e.return=t,t.child=e}function EO(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(hf(i,r)&&e.ref===t.ref)if(rs=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(rs=!0);else return t.lanes=e.lanes,ya(e,t,s)}return q1(e,t,n,r,s)}function xO(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},yn(lc,ms),ms|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,yn(lc,ms),ms|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,yn(lc,ms),ms|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,yn(lc,ms),ms|=r;return Vr(e,t,s,n),t.child}function wO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function q1(e,t,n,r,s){var i=as(n)?sl:Pr.current;return i=$c(t,i),Tc(t,s),n=vw(e,t,n,r,i,s),r=_w(),e!==null&&!rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ya(e,t,s)):(Cn&&r&&uw(t),t.flags|=1,Vr(e,t,n,s),t.child)}function LN(e,t,n,r,s){if(as(n)){var i=!0;Mm(t)}else i=!1;if(Tc(t,s),t.stateNode===null)Zp(e,t),gO(t,n,r),W1(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Vs(u):(u=as(n)?sl:Pr.current,u=$c(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&TN(t,a,r,u),$a=!1;var h=t.memoizedState;a.state=h,Fm(t,r,a,s),c=t.memoizedState,l!==r||h!==c||is.current||$a?(typeof d=="function"&&(Y1(t,n,d,r),c=t.memoizedState),(l=$a||SN(t,n,l,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,qR(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:oi(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Vs(c):(c=as(n)?sl:Pr.current,c=$c(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||h!==c)&&TN(t,a,r,c),$a=!1,h=t.memoizedState,a.state=h,Fm(t,r,a,s);var m=t.memoizedState;l!==f||h!==m||is.current||$a?(typeof p=="function"&&(Y1(t,n,p,r),m=t.memoizedState),(u=$a||SN(t,n,u,r,h,m,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return X1(e,t,n,r,i,s)}function X1(e,t,n,r,s,i){wO(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&bN(t,n,!1),ya(e,t,i);r=t.stateNode,x9.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=zc(t,e.child,null,i),t.child=zc(t,null,l,i)):Vr(e,t,l,i),t.memoizedState=r.state,s&&bN(t,n,!0),t.child}function vO(e){var t=e.stateNode;t.pendingContext?yN(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yN(e,t.context,!1),bw(e,t.containerInfo)}function MN(e,t,n,r,s){return Hc(),fw(s),t.flags|=256,Vr(e,t,n,r),t.child}var Q1={dehydrated:null,treeContext:null,retryLane:0};function Z1(e){return{baseLanes:e,cachePool:null,transitions:null}}function _O(e,t,n){var r=t.pendingProps,s=Pn.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),yn(Pn,s&1),e===null)return V1(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Qg(a,r,0,null),e=Qo(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Z1(n),t.memoizedState=Q1,e):Sw(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return w9(e,t,a,r,l,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=io(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=io(l,i):(i=Qo(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Z1(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Q1,r}return i=e.child,e=i.sibling,r=io(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Sw(e,t){return t=Qg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rp(e,t,n,r){return r!==null&&fw(r),zc(t,e.child,null,n),e=Sw(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function w9(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Fy(Error(Me(422))),rp(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Qg({mode:"visible",children:r.children},s,0,null),i=Qo(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&zc(t,e.child,null,a),t.child.memoizedState=Z1(a),t.memoizedState=Q1,i);if(!(t.mode&1))return rp(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(Me(419)),r=Fy(i,r,void 0),rp(e,t,a,r)}if(l=(a&e.childLanes)!==0,rs||l){if(r=xr,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,ga(e,s),yi(r,e,s,-1))}return Ow(),r=Fy(Error(Me(421))),rp(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=M9.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,ys=to(s.nextSibling),bs=t,Cn=!0,ui=null,e!==null&&(Ms[js++]=aa,Ms[js++]=oa,Ms[js++]=il,aa=e.id,oa=e.overflow,il=t),t=Sw(t,r.children),t.flags|=4096,t)}function jN(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),K1(e.return,t,n)}function Uy(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function kO(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Vr(e,t,r.children,n),r=Pn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jN(e,n,t);else if(e.tag===19)jN(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(yn(Pn,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Um(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Uy(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Um(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Uy(t,!0,n,null,i);break;case"together":Uy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ya(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ol|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Me(153));if(t.child!==null){for(e=t.child,n=io(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=io(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function v9(e,t,n){switch(t.tag){case 3:vO(t),Hc();break;case 5:XR(t);break;case 1:as(t.type)&&Mm(t);break;case 4:bw(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;yn(Pm,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(yn(Pn,Pn.current&1),t.flags|=128,null):n&t.child.childLanes?_O(e,t,n):(yn(Pn,Pn.current&1),e=ya(e,t,n),e!==null?e.sibling:null);yn(Pn,Pn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return kO(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),yn(Pn,Pn.current),r)break;return null;case 22:case 23:return t.lanes=0,xO(e,t,n)}return ya(e,t,n)}var NO,J1,SO,TO;NO=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};J1=function(){};SO=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Vo(Fi.current);var i=null;switch(n){case"input":s=w1(e,s),r=w1(e,r),i=[];break;case"select":s=Un({},s,{value:void 0}),r=Un({},r,{value:void 0}),i=[];break;case"textarea":s=k1(e,s),r=k1(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Om)}S1(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(af.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(af.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&wn("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};TO=function(e,t,n,r){n!==r&&(t.flags|=4)};function Qu(e,t){if(!Cn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Rr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _9(e,t,n){var r=t.pendingProps;switch(dw(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rr(t),null;case 1:return as(t.type)&&Lm(),Rr(t),null;case 3:return r=t.stateNode,Vc(),vn(is),vn(Pr),xw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ui!==null&&(oE(ui),ui=null))),J1(e,t),Rr(t),null;case 5:Ew(t);var s=Vo(bf.current);if(n=t.type,e!==null&&t.stateNode!=null)SO(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Me(166));return Rr(t),null}if(e=Vo(Fi.current),tp(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Di]=t,r[gf]=i,e=(t.mode&1)!==0,n){case"dialog":wn("cancel",r),wn("close",r);break;case"iframe":case"object":case"embed":wn("load",r);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Di]=t,e[gf]=r,NO(e,t,!1,!1),t.stateNode=e;e:{switch(a=T1(n,r),n){case"dialog":wn("cancel",e),wn("close",e),s=r;break;case"iframe":case"object":case"embed":wn("load",e),s=r;break;case"video":case"audio":for(s=0;sYc&&(t.flags|=128,r=!0,Qu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Um(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Qu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Cn)return Rr(t),null}else 2*Xn()-i.renderingStartTime>Yc&&n!==1073741824&&(t.flags|=128,r=!0,Qu(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=Xn(),t.sibling=null,n=Pn.current,yn(Pn,r?n&1|2:n&1),t):(Rr(t),null);case 22:case 23:return Rw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ms&1073741824&&(Rr(t),t.subtreeFlags&6&&(t.flags|=8192)):Rr(t),null;case 24:return null;case 25:return null}throw Error(Me(156,t.tag))}function k9(e,t){switch(dw(t),t.tag){case 1:return as(t.type)&&Lm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vc(),vn(is),vn(Pr),xw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ew(t),null;case 13:if(vn(Pn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Me(340));Hc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vn(Pn),null;case 4:return Vc(),null;case 10:return mw(t.type._context),null;case 22:case 23:return Rw(),null;case 24:return null;default:return null}}var sp=!1,Lr=!1,N9=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function oc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vn(e,t,r)}else n.current=null}function eE(e,t,n){try{n()}catch(r){Vn(e,t,r)}}var DN=!1;function S9(e,t){if(P1=Cm,e=OR(),cw(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,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=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&&(l=a),h===i&&++d===r&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(B1={focusedElem:e,selectionRange:n},Cm=!1,Xe=t;Xe!==null;)if(t=Xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xe=e;else for(;Xe!==null;){t=Xe;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 g=m.memoizedProps,w=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:oi(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(_){Vn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Xe=e;break}Xe=t.return}return m=DN,DN=!1,m}function jd(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&&eE(t,n,i)}s=s.next}while(s!==r)}}function qg(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 tE(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 AO(e){var t=e.alternate;t!==null&&(e.alternate=null,AO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[gf],delete t[$1],delete t[l9],delete t[c9])),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 CO(e){return e.tag===5||e.tag===3||e.tag===4}function PN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CO(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 nE(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=Om));else if(r!==4&&(e=e.child,e!==null))for(nE(e,t,n),e=e.sibling;e!==null;)nE(e,t,n),e=e.sibling}function rE(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(rE(e,t,n),e=e.sibling;e!==null;)rE(e,t,n),e=e.sibling}var _r=null,li=!1;function Oa(e,t,n){for(n=n.child;n!==null;)IO(e,t,n),n=n.sibling}function IO(e,t,n){if(Bi&&typeof Bi.onCommitFiberUnmount=="function")try{Bi.onCommitFiberUnmount($g,n)}catch{}switch(n.tag){case 5:Lr||oc(n,t);case 6:var r=_r,s=li;_r=null,Oa(e,t,n),_r=r,li=s,_r!==null&&(li?(e=_r,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_r.removeChild(n.stateNode));break;case 18:_r!==null&&(li?(e=_r,n=n.stateNode,e.nodeType===8?Ly(e.parentNode,n):e.nodeType===1&&Ly(e,n),df(e)):Ly(_r,n.stateNode));break;case 4:r=_r,s=li,_r=n.stateNode.containerInfo,li=!0,Oa(e,t,n),_r=r,li=s;break;case 0:case 11:case 14:case 15:if(!Lr&&(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)&&eE(n,t,a),s=s.next}while(s!==r)}Oa(e,t,n);break;case 1:if(!Lr&&(oc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Vn(n,t,l)}Oa(e,t,n);break;case 21:Oa(e,t,n);break;case 22:n.mode&1?(Lr=(r=Lr)||n.memoizedState!==null,Oa(e,t,n),Lr=r):Oa(e,t,n);break;default:Oa(e,t,n)}}function BN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new N9),t.forEach(function(r){var s=j9.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ri(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Xn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*A9(r/1960))-r,10e?16:e,Ga===null)var r=!1;else{if(e=Ga,Ga=null,Km=0,Dt&6)throw Error(Me(331));var s=Dt;for(Dt|=4,Xe=e.current;Xe!==null;){var i=Xe,a=i.child;if(Xe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;cXn()-Cw?Xo(e,0):Aw|=n),os(e,t)}function BO(e,t){t===0&&(e.mode&1?(t=qh,qh<<=1,!(qh&130023424)&&(qh=4194304)):t=1);var n=Gr();e=ga(e,t),e!==null&&(Zf(e,t,n),os(e,n))}function M9(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),BO(e,n)}function j9(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Me(314))}r!==null&&r.delete(t),BO(e,n)}var FO;FO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||is.current)rs=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rs=!1,v9(e,t,n);rs=!!(e.flags&131072)}else rs=!1,Cn&&t.flags&1048576&&zR(t,Dm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zp(e,t),e=t.pendingProps;var s=$c(t,Pr.current);Tc(t,n),s=vw(null,t,r,e,s,n);var i=_w();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,as(r)?(i=!0,Mm(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,yw(t),s.updater=Gg,t.stateNode=s,s._reactInternals=t,W1(t,r,e,n),t=X1(null,t,r,!0,i,n)):(t.tag=0,Cn&&i&&uw(t),Vr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=P9(r),e=oi(r,e),s){case 0:t=q1(null,t,r,e,n);break e;case 1:t=LN(null,t,r,e,n);break e;case 11:t=RN(null,t,r,e,n);break e;case 14:t=ON(null,t,r,oi(r.type,e),n);break e}throw Error(Me(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),q1(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),LN(e,t,r,s,n);case 3:e:{if(vO(t),e===null)throw Error(Me(387));r=t.pendingProps,i=t.memoizedState,s=i.element,qR(e,t),Fm(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=Kc(Error(Me(423)),t),t=MN(e,t,r,n,s);break e}else if(r!==s){s=Kc(Error(Me(424)),t),t=MN(e,t,r,n,s);break e}else for(ys=to(t.stateNode.containerInfo.firstChild),bs=t,Cn=!0,ui=null,n=WR(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hc(),r===s){t=ya(e,t,n);break e}Vr(e,t,r,n)}t=t.child}return t;case 5:return XR(t),e===null&&V1(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,F1(r,s)?a=null:i!==null&&F1(r,i)&&(t.flags|=32),wO(e,t),Vr(e,t,a,n),t.child;case 6:return e===null&&V1(t),null;case 13:return _O(e,t,n);case 4:return bw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zc(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:oi(r,s),RN(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,yn(Pm,r._currentValue),r._currentValue=a,i!==null)if(wi(i.value,a)){if(i.children===s.children&&!is.current){t=ya(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ua(-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),K1(i.return,n,t),l.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(Me(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),K1(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,Tc(t,n),s=Vs(s),r=r(s),t.flags|=1,Vr(e,t,r,n),t.child;case 14:return r=t.type,s=oi(r,t.pendingProps),s=oi(r.type,s),ON(e,t,r,s,n);case 15:return EO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:oi(r,s),Zp(e,t),t.tag=1,as(r)?(e=!0,Mm(t)):e=!1,Tc(t,n),gO(t,r,s),W1(t,r,s,n),X1(null,t,r,!0,e,n);case 19:return kO(e,t,n);case 22:return xO(e,t,n)}throw Error(Me(156,t.tag))};function UO(e,t){return hR(e,t)}function D9(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 Us(e,t,n,r){return new D9(e,t,n,r)}function Lw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P9(e){if(typeof e=="function")return Lw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zx)return 11;if(e===Jx)return 14}return 2}function io(e,t){var n=e.alternate;return n===null?(n=Us(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 tm(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Lw(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Zl:return Qo(n.children,s,i,t);case Qx:a=8,s|=8;break;case y1:return e=Us(12,n,t,s|2),e.elementType=y1,e.lanes=i,e;case b1:return e=Us(13,n,t,s),e.elementType=b1,e.lanes=i,e;case E1:return e=Us(19,n,t,s),e.elementType=E1,e.lanes=i,e;case XI:return Qg(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case GI:a=10;break e;case qI:a=9;break e;case Zx:a=11;break e;case Jx:a=14;break e;case Ua:a=16,r=null;break e}throw Error(Me(130,e==null?e:typeof e,""))}return t=Us(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Qo(e,t,n,r){return e=Us(7,e,r,t),e.lanes=n,e}function Qg(e,t,n,r){return e=Us(22,e,r,t),e.elementType=XI,e.lanes=n,e.stateNode={isHidden:!1},e}function $y(e,t,n){return e=Us(6,e,null,t),e.lanes=n,e}function Hy(e,t,n){return t=Us(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function B9(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=vy(0),this.expirationTimes=vy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Mw(e,t,n,r,s,i,a,l,c){return e=new B9(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Us(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yw(i),e}function F9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VO)}catch(e){console.error(e)}}VO(),VI.exports=Ns;var vs=VI.exports,YN=vs;m1.createRoot=YN.createRoot,m1.hydrateRoot=YN.hydrateRoot;const Bw=E.createContext({});function n0(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const r0=E.createContext(null),_f=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class V9 extends E.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 K9({children:e,isPresent:t}){const n=E.useId(),r=E.useRef(null),s=E.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=E.useContext(_f);return E.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=s.current;if(t||!r.current||!a||!l)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return i&&(d.nonce=i),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -46,37 +46,37 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(z9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const K9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=n0(Y9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(V9,{isPresent:n,children:e})),o.jsx(r0.Provider,{value:d,children:e})};function Y9(){return new Map}function KO(e=!0){const t=E.useContext(r0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const op=e=>e.key||"";function WN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Fw=typeof window<"u",YO=Fw?E.useLayoutEffect:E.useEffect,di=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=KO(a),u=E.useMemo(()=>WN(e),[e]),d=a&&!l?[]:u.map(op),f=E.useRef(!0),h=E.useRef(u),p=n0(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);YO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=op(_),N=a&&!l?!1:u===w||d.includes(k),T=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx(K9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:T,children:_},k)})})},Es=e=>e;let WO=Es;const W9={useManualTiming:!1};function G9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const lp=["read","resolveKeyframes","update","preRender","render","postRender"],q9=40;function GO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=lp.reduce((y,b)=>(y[b]=G9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,q9),1),s.timestamp=y,s.isProcessing=!0,l.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:lp.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bGN[e].some(n=>!!t[n])};function X9(e){for(const t in e)Yc[t]={...Yc[t],...e[t]}}const Q9=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")||Q9.has(e)}let XO=e=>!Gm(e);function QO(e){e&&(XO=t=>t.startsWith("on")?!Gm(t):e(t))}try{QO(require("@emotion/is-prop-valid").default)}catch{}function Z9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(XO(s)||n===!0&&Gm(s)||!t&&!Gm(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function J9({children:e,isValidProp:t,...n}){t&&QO(t),n={...E.useContext(_f),...n},n.isStatic=n0(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(_f.Provider,{value:r,children:e})}function eU(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 s0=E.createContext({});function kf(e){return typeof e=="string"||Array.isArray(e)}function i0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Uw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$w=["initial",...Uw];function a0(e){return i0(e.animate)||$w.some(t=>kf(e[t]))}function ZO(e){return!!(a0(e)||e.variants)}function tU(e,t){if(a0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kf(n)?n:void 0,animate:kf(r)?r:void 0}}return e.inherit!==!1?t:{}}function nU(e){const{initial:t,animate:n}=tU(e,E.useContext(s0));return E.useMemo(()=>({initial:t,animate:n}),[qN(t),qN(n)])}function qN(e){return Array.isArray(e)?e.join(" "):e}const rU=Symbol.for("motionComponentSymbol");function lc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sU(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):lc(n)&&(n.current=r))},[t])}const Hw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),iU="framerAppearId",JO="data-"+Hw(iU),{schedule:zw}=GO(queueMicrotask,!1),eL=E.createContext({});function aU(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(s0),c=E.useContext(qO),u=E.useContext(r0),d=E.useContext(_f).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(eL);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&oU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[JO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return YO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),zw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function oU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tL(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&lc(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function tL(e){if(e)return e.options.allowProjection!==!1?e.projection:tL(e.parent)}function lU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&X9(e);function l(u,d){let f;const h={...E.useContext(_f),...u,layoutId:cU(u)},{isStatic:p}=h,m=nU(u),g=r(u,p);if(!p&&Fw){uU();const w=dU(h);f=w.MeasureLayout,m.visualElement=aU(s,g,h,t,w.ProjectionNode)}return o.jsxs(s0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,sU(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[rU]=s,c}function cU({layoutId:e}){const t=E.useContext(Bw).id;return t&&e!==void 0?t+"-"+e:e}function uU(e,t){E.useContext(qO).strict}function dU(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 fU=["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 Vw(e){return typeof e!="string"||e.includes("-")?!1:!!(fU.indexOf(e)>-1||/[A-Z]/u.test(e))}function XN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kw(e,t,n,r){if(typeof t=="function"){const[s,i]=XN(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]=XN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const lE=e=>Array.isArray(e),hU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),pU=e=>lE(e)?e[e.length-1]||0:e,Mr=e=>!!(e&&e.getVelocity);function nm(e){const t=Mr(e)?e.get():e;return hU(t)?t.toValue():t}function mU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:gU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const nL=e=>(t,n)=>{const r=E.useContext(s0),s=E.useContext(r0),i=()=>mU(e,t,r,s);return n?i():n0(i)};function gU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=nm(i[h]);let{initial:a,animate:l}=e;const c=a0(e),u=ZO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!i0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),sL=rL("--"),yU=rL("var(--"),Yw=e=>yU(e)?bU.test(e.split("/*")[0].trim()):!1,bU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,iL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ba=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Nf={...xu,transform:e=>ba(0,1,e)},cp={...xu,default:1},nh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pa=nh("deg"),Ui=nh("%"),lt=nh("px"),EU=nh("vh"),xU=nh("vw"),QN={...Ui,parse:e=>Ui.parse(e)/100,transform:e=>Ui.transform(e*100)},wU={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,backgroundPositionX:lt,backgroundPositionY:lt},vU={rotate:Pa,rotateX:Pa,rotateY:Pa,rotateZ:Pa,scale:cp,scaleX:cp,scaleY:cp,scaleZ:cp,skew:Pa,skewX:Pa,skewY:Pa,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:Nf,originX:QN,originY:QN,originZ:lt},ZN={...xu,transform:Math.round},Ww={...wU,...vU,zIndex:ZN,size:lt,fillOpacity:Nf,strokeOpacity:Nf,numOctaves:ZN},_U={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kU=Eu.length;function NU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),aL=()=>({...Xw(),attrs:{}}),Qw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oL(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 lL=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 cL(e,t,n,r){oL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(lL.has(s)?s:Hw(s),t.attrs[s])}const qm={};function IU(e){Object.assign(qm,e)}function uL(e,{layout:t,layoutId:n}){return wl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qm[e]||e==="opacity")}function Zw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(Mr(s[a])||t.style&&Mr(t.style[a])||uL(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 dL(e,t,n){const r=Zw(e,t,n);for(const s in e)if(Mr(e[s])||Mr(t[s])){const i=Eu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function RU(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 eS=["x","y","width","height","cx","cy","r"],OU={useVisualState:nL({scrapeMotionValuesFromProps:dL,createRenderState:aL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(wl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{RU(n,r),_n.render(()=>{qw(r,s,Qw(n.tagName),e.transformTemplate),cL(n,r)})})}})},LU={useVisualState:nL({scrapeMotionValuesFromProps:Zw,createRenderState:Xw})};function fL(e,t,n){for(const r in t)!Mr(t[r])&&!uL(r,n)&&(e[r]=t[r])}function MU({transformTemplate:e},t){return E.useMemo(()=>{const n=Xw();return Gw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function jU(e,t){const n=e.style||{},r={};return fL(r,n,e),Object.assign(r,MU(e,t)),r}function DU(e,t){const n={},r=jU(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 PU(e,t,n,r){const s=E.useMemo(()=>{const i=aL();return qw(i,t,Qw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};fL(i,e.style,e),s.style={...i,...s.style}}return s}function BU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=(Vw(n)?PU:DU)(r,i,a,n),u=Z9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>Mr(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function FU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Vw(r)?OU:LU,preloadedFeatures:e,useRender:BU(s),createVisualElement:t,Component:r};return lU(a)}}function hL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(rm===void 0&&$i.set(_r.isProcessing||W9.useManualTiming?_r.timestamp:performance.now()),rm),set:e=>{rm=e,queueMicrotask(UU)}};function ev(e,t){e.indexOf(t)===-1&&e.push(t)}function tv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class nv{constructor(){this.subscriptions=[]}add(t){return ev(this.subscriptions,t),()=>tv(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 HU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=$i.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=$i.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$U(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 nv);const r=this.events[t].add(n);return t==="change"?()=>{r(),_n.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=$i.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tS)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tS);return mL(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 Sf(e,t){return new HU(e,t)}function zU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Sf(n))}function VU(e,t){const n=o0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=pU(i[a]);zU(e,a,l)}}function KU(e){return!!(Mr(e)&&e.add)}function cE(e,t){const n=e.getValue("willChange");if(KU(n))return n.add(t)}function gL(e){return e.props[JO]}function rv(e){let t;return()=>(t===void 0&&(t=e()),t)}const YU=rv(()=>window.ScrollTimeline!==void 0);class WU{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(YU()&&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 GU extends WU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const da=e=>e*1e3,fa=e=>e/1e3;function sv(e){return typeof e=="function"}function nS(e,t){e.timeline=t,e.onfinish=null}const iv=e=>Array.isArray(e)&&typeof e[0]=="number",qU={linearEasing:void 0};function XU(e,t){const n=rv(e);return()=>{var r;return(r=qU[t])!==null&&r!==void 0?r:n()}}const Xm=XU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yL=(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})`,uE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bd([0,.65,.55,1]),circOut:bd([.55,0,1,.45]),backIn:bd([.31,.01,.66,-.59]),backOut:bd([.33,1.53,.69,.99])};function EL(e,t){if(e)return typeof e=="function"&&Xm()?yL(e,t):iv(e)?bd(e):Array.isArray(e)?e.map(n=>EL(n,t)||uE.easeOut):uE[e]}const xL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,QU=1e-7,ZU=12;function JU(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=xL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>QU&&++lJU(i,0,1,e,n);return i=>i===0||i===1?i:xL(s(i),t,r)}const wL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vL=e=>t=>1-e(1-t),_L=rh(.33,1.53,.69,.99),av=vL(_L),kL=wL(av),NL=e=>(e*=2)<1?.5*av(e):.5*(2-Math.pow(2,-10*(e-1))),ov=e=>1-Math.sin(Math.acos(e)),SL=vL(ov),TL=wL(ov),AL=e=>/^0[^.\s]+$/u.test(e);function e$(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||AL(e):!0}const Bd=e=>Math.round(e*1e5)/1e5,lv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function t$(e){return e==null}const n$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,cv=(e,t)=>n=>!!(typeof n=="string"&&n$.test(n)&&n.startsWith(e)||t&&!t$(n)&&Object.prototype.hasOwnProperty.call(n,t)),CL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(lv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},r$=e=>ba(0,255,e),Vy={...xu,transform:e=>Math.round(r$(e))},Ko={test:cv("rgb","red"),parse:CL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vy.transform(e)+", "+Vy.transform(t)+", "+Vy.transform(n)+", "+Bd(Nf.transform(r))+")"};function s$(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 dE={test:cv("#"),parse:s$,transform:Ko.transform},cc={test:cv("hsl","hue"),parse:CL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ui.transform(Bd(t))+", "+Ui.transform(Bd(n))+", "+Bd(Nf.transform(r))+")"},Or={test:e=>Ko.test(e)||dE.test(e)||cc.test(e),parse:e=>Ko.test(e)?Ko.parse(e):cc.test(e)?cc.parse(e):dE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ko.transform(e):cc.transform(e)},i$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function a$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(lv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(i$))===null||n===void 0?void 0:n.length)||0)>0}const IL="number",RL="color",o$="var",l$="var(",rS="${}",c$=/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 Tf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(c$,c=>(Or.test(c)?(r.color.push(i),s.push(RL),n.push(Or.parse(c))):c.startsWith(l$)?(r.var.push(i),s.push(o$),n.push(c)):(r.number.push(i),s.push(IL),n.push(parseFloat(c))),++i,rS)).split(rS);return{values:n,split:l,indexes:r,types:s}}function OL(e){return Tf(e).values}function LL(e){const{split:t,types:n}=Tf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function d$(e){const t=OL(e);return LL(e)(t.map(u$))}const fo={test:a$,parse:OL,createTransformer:LL,getAnimatableNone:d$},f$=new Set(["brightness","contrast","saturate","opacity"]);function h$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(lv)||[];if(!r)return e;const s=n.replace(r,"");let i=f$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const p$=/\b([a-z-]*)\(.*?\)/gu,fE={...fo,getAnimatableNone:e=>{const t=e.match(p$);return t?t.map(h$).join(" "):e}},m$={...Ww,color:Or,backgroundColor:Or,outlineColor:Or,fill:Or,stroke:Or,borderColor:Or,borderTopColor:Or,borderRightColor:Or,borderBottomColor:Or,borderLeftColor:Or,filter:fE,WebkitFilter:fE},uv=e=>m$[e];function ML(e,t){let n=uv(e);return n!==fE&&(n=fo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const g$=new Set(["auto","none","0"]);function y$(e,t,n){let r=0,s;for(;re===xu||e===lt,iS=(e,t)=>parseFloat(e.split(", ")[t]),aS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return iS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?iS(i[1],e):0}},b$=new Set(["x","y","z"]),E$=Eu.filter(e=>!b$.has(e));function x$(e){const t=[];return E$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Gc={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:aS(4,13),y:aS(5,14)};Gc.translateX=Gc.x;Gc.translateY=Gc.y;const Zo=new Set;let hE=!1,pE=!1;function jL(){if(pE){const e=Array.from(Zo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=x$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pE=!1,hE=!1,Zo.forEach(e=>e.complete()),Zo.clear()}function DL(){Zo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pE=!0)})}function w$(){DL(),jL()}class dv{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?(Zo.add(this),hE||(hE=!0,_n.read(DL),_n.resolveKeyframes(jL))):(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),v$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _$(e){const t=v$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function BL(e,t,n=1){const[r,s]=_$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return PL(a)?parseFloat(a):a}return Yw(s)?BL(s,t,n+1):s}const FL=e=>t=>t.test(e),k$={test:e=>e==="auto",parse:e=>e},UL=[xu,lt,Ui,Pa,xU,EU,k$],oS=e=>UL.find(FL(e));class $L extends dv{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 lS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fo.test(e)||e==="0")&&!e.startsWith("url("));function N$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function l0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(T$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const A$=40;class HL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$i.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>A$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&w$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=$i.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!S$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(l0(t,this.options,n)),l&&l(),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 mE=2e4;function zL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=mE?1/0:t}const Bn=(e,t,n)=>e+(t-e)*n;function Ky(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 C$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Ky(c,l,e+1/3),i=Ky(c,l,e),a=Ky(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Qm(e,t){return n=>n>0?t:e}const Yy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},I$=[dE,Ko,cc],R$=e=>I$.find(t=>t.test(e));function cS(e){const t=R$(e);if(!t)return!1;let n=t.parse(e);return t===cc&&(n=C$(n)),n}const uS=(e,t)=>{const n=cS(e),r=cS(t);if(!n||!r)return Qm(e,t);const s={...n};return i=>(s.red=Yy(n.red,r.red,i),s.green=Yy(n.green,r.green,i),s.blue=Yy(n.blue,r.blue,i),s.alpha=Bn(n.alpha,r.alpha,i),Ko.transform(s))},O$=(e,t)=>n=>t(e(n)),sh=(...e)=>e.reduce(O$),gE=new Set(["none","hidden"]);function L$(e,t){return gE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function M$(e,t){return n=>Bn(e,t,n)}function fv(e){return typeof e=="number"?M$:typeof e=="string"?Yw(e)?Qm:Or.test(e)?uS:P$:Array.isArray(e)?VL:typeof e=="object"?Or.test(e)?uS:j$:Qm}function VL(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>fv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function D$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=fo.createTransformer(t),r=Tf(e),s=Tf(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?gE.has(e)&&!s.values.length||gE.has(t)&&!r.values.length?L$(e,t):sh(VL(D$(r,s),s.values),n):Qm(e,t)};function KL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Bn(e,t,n):fv(e)(e,t)}const B$=5;function YL(e,t,n){const r=Math.max(t-B$,0);return mL(n-e(r),t-r)}const zn={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},Wy=.001;function F$({duration:e=zn.duration,bounce:t=zn.bounce,velocity:n=zn.velocity,mass:r=zn.mass}){let s,i,a=1-t;a=ba(zn.minDamping,zn.maxDamping,a),e=ba(zn.minDuration,zn.maxDuration,fa(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=yE(u,a),m=Math.exp(-f);return Wy-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),g=yE(Math.pow(u,2),a);return(-s(u)+Wy>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Wy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=$$(s,i,l);if(e=da(e),isNaN(c))return{stiffness:zn.stiffness,damping:zn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const U$=12;function $$(e,t,n){let r=n;for(let s=1;se[n]!==void 0)}function V$(e){let t={velocity:zn.velocity,stiffness:zn.stiffness,damping:zn.damping,mass:zn.mass,isResolvedFromDuration:!1,...e};if(!dS(e,z$)&&dS(e,H$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ba(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:zn.mass,stiffness:s,damping:i}}else{const n=F$(e);t={...t,...n,mass:zn.mass},t.isResolvedFromDuration=!0}return t}function WL(e=zn.visualDuration,t=zn.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],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=V$({...n,velocity:-fa(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=fa(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?zn.restSpeed.granular:zn.restSpeed.default),s||(s=b?zn.restDelta.granular:zn.restDelta.default);let x;if(g<1){const k=yE(y,g);x=N=>{const T=Math.exp(-g*y*N);return a-T*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const T=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-T*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let T=0;g<1&&(T=k===0?da(m):YL(x,k,N));const S=Math.abs(T)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(zL(_),mE),N=yL(T=>_.next(k*T).value,k,30);return k+"ms "+N}};return _}function fS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const T=S=>{p(h.value)&&(k=S,N=WL({keyframes:[h.value,m(h.value)],velocity:YL(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),T(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const K$=rh(.42,0,1,1),Y$=rh(0,0,.58,1),GL=rh(.42,0,.58,1),W$=e=>Array.isArray(e)&&typeof e[0]!="number",G$={linear:Es,easeIn:K$,easeInOut:GL,easeOut:Y$,circIn:ov,circInOut:TL,circOut:SL,backIn:av,backInOut:kL,backOut:_L,anticipate:NL},hS=e=>{if(iv(e)){WO(e.length===4);const[t,n,r,s]=e;return rh(t,n,r,s)}else if(typeof e=="string")return G$[e];return e};function q$(e,t,n){const r=[],s=n||KL,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 l=q$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(ba(e[0],e[i-1],d)):u}function Q$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Wc(0,t,r);e.push(Bn(n,1,s))}}function Z$(e){const t=[0];return Q$(t,e.length-1),t}function J$(e,t){return e.map(n=>n*t)}function e7(e,t){return e.map(()=>t||GL).splice(0,e.length-1)}function Zm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=W$(r)?r.map(hS):hS(r),i={done:!1,value:t[0]},a=J$(n&&n.length===t.length?n:Z$(t),e),l=X$(a,t,{ease:Array.isArray(s)?s:e7(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const t7=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_n.update(t,!0),stop:()=>uo(t),now:()=>_r.isProcessing?_r.timestamp:$i.now()}},n7={decay:fS,inertia:fS,tween:Zm,keyframes:Zm,spring:WL},r7=e=>e/100;class hv extends HL{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)||dv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=sv(n)?n:n7[n]||Zm;let c,u;l!==Zm&&typeof t[0]!="number"&&(c=sh(r7,KL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=zL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=ba(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return T&&s!==void 0&&(k.value=l0(c,this.options,s)),w&&w(k.value),T&&this.finish(),k}get duration(){const{resolved:t}=this;return t?fa(t.calculatedDuration):0}get time(){return fa(this.currentTime)}set time(t){t=da(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=fa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=t7,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 s7=new Set(["opacity","clipPath","filter","transform"]);function i7(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=EL(l,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 a7=rv(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jm=10,o7=2e4;function l7(e){return sv(e.type)||e.type==="spring"||!bL(e.ease)}function c7(e,t){const n=new hv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Xm()&&u7(i)&&(i=qL[i]),l7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=c7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=i7(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(nS(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(l0(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 fa(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return fa(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=da(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;nS(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:l}=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 hv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=da(this.time);u.setWithVelocity(m.sample(g-Jm).value,m.sample(g).value,Jm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return a7()&&r&&s7.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const d7={type:"spring",stiffness:500,damping:25,restSpeed:10},f7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),h7={type:"keyframes",duration:.8},p7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},m7=(e,{keyframes:t})=>t.length>2?h7:wl.has(e)?e.startsWith("scale")?f7(t[1]):d7:p7;function g7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const pv=(e,t,n,r={},s,i)=>a=>{const l=Jw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-da(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};g7(l)||(d={...d,...m7(e,d)}),d.duration&&(d.duration=da(d.duration)),d.repeatDelay&&(d.repeatDelay=da(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=l0(d.keyframes,l);if(h!==void 0)return _n.update(()=>{d.onUpdate(h),d.onComplete()}),new GU([])}return!i&&pS.supports(d)?new pS(d):new hv(d)};function y7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function XL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&y7(d,f))continue;const m={delay:n,...Jw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=gL(e);if(y){const b=window.MotionHandoffAnimation(y,f,_n);b!==null&&(m.startTime=b,g=!0)}}cE(e,f),h.start(pv(f,h,p,e.shouldReduceMotion&&pL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{_n.update(()=>{l&&VU(e,l)})}),u}function bE(e,t,n={}){var r;const s=o0(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(XL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return b7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function b7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(E7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(bE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function E7(e,t){return e.sortNodePosition(t)}function x7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>bE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=bE(e,t,n);else{const s=typeof t=="function"?o0(e,t,n.custom):t;r=Promise.all(XL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const w7=$w.length;function QL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?QL(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})=>x7(e,n,r)))}function N7(e){let t=k7(e),n=mS(),r=!0;const s=c=>(u,d)=>{var f;const h=o0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=QL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;w<_7;w++){const y=v7[w],b=n[y],x=u[y]!==void 0?u[y]:d[y],_=kf(x),k=y===c?b.isActive:null;k===!1&&(m=w);let N=x===d[y]&&x!==u[y]&&_;if(N&&r&&e.manuallyAnimateOnMount&&(N=!1),b.protectedKeys={...p},!b.isActive&&k===null||!x&&!b.prevProp||i0(x)||typeof x=="boolean")continue;const T=S7(b.prevProp,x);let S=T||y===c&&b.isActive&&!N&&_||w>m&&_,R=!1;const I=Array.isArray(x)?x:[x];let j=I.reduce(s(y),{});k===!1&&(j={});const{prevResolvedValues:F={}}=b,Y={...F,...j},L=M=>{S=!0,h.has(M)&&(R=!0,h.delete(M)),b.needsAnimating[M]=!0;const O=e.getValue(M);O&&(O.liveStyle=!1)};for(const M in Y){const O=j[M],D=F[M];if(p.hasOwnProperty(M))continue;let A=!1;lE(O)&&lE(D)?A=!hL(O,D):A=O!==D,A?O!=null?L(M):h.add(M):O!==void 0&&h.has(M)?L(M):b.protectedKeys[M]=!0}b.prevProp=x,b.prevResolvedValues=j,b.isActive&&(p={...p,...j}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&T)||R)&&f.push(...I.map(M=>({animation:M,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mS(),r=!0}}}function S7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hL(t,e):!1}function Io(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mS(){return{animate:Io(!0),whileInView:Io(),whileHover:Io(),whileTap:Io(),whileDrag:Io(),whileFocus:Io(),exit:Io()}}class go{constructor(t){this.isMounted=!1,this.node=t}update(){}}class T7 extends go{constructor(t){super(t),t.animationState||(t.animationState=N7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();i0(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 A7=0;class C7 extends go{constructor(){super(...arguments),this.id=A7++}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 I7={animation:{Feature:T7},exit:{Feature:C7}},ai={x:!1,y:!1};function ZL(){return ai.x||ai.y}function R7(e){return e==="x"||e==="y"?ai[e]?null:(ai[e]=!0,()=>{ai[e]=!1}):ai.x||ai.y?null:(ai.x=ai.y=!0,()=>{ai.x=ai.y=!1})}const mv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Af(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ih(e){return{point:{x:e.pageX,y:e.pageY}}}const O7=e=>t=>mv(t)&&e(t,ih(t));function Fd(e,t,n,r){return Af(e,t,O7(n),r)}const gS=(e,t)=>Math.abs(e-t);function L7(e,t){const n=gS(e.x,t.x),r=gS(e.y,t.y);return Math.sqrt(n**2+r**2)}class JL{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=qy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=L7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=_r;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Gy(h,this.transformPagePoint),_n.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qy(f.type==="pointercancel"?this.lastMoveEventInfo:Gy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!mv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ih(t),l=Gy(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=_r;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,qy(l,this.history)),this.removeListeners=sh(Fd(this.contextWindow,"pointermove",this.handlePointerMove),Fd(this.contextWindow,"pointerup",this.handlePointerUp),Fd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),uo(this.updatePoint)}}function Gy(e,t){return t?{point:t(e.point)}:e}function yS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qy({point:e},t){return{point:e,delta:yS(e,eM(t)),offset:yS(e,M7(t)),velocity:j7(t,.1)}}function M7(e){return e[0]}function eM(e){return e[e.length-1]}function j7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=eM(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>da(t)));)n--;if(!r)return{x:0,y:0};const i=fa(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 tM=1e-4,D7=1-tM,P7=1+tM,nM=.01,B7=0-nM,F7=0+nM;function _s(e){return e.max-e.min}function U7(e,t,n){return Math.abs(e-t)<=n}function bS(e,t,n,r=.5){e.origin=r,e.originPoint=Bn(t.min,t.max,e.origin),e.scale=_s(n)/_s(t),e.translate=Bn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=D7&&e.scale<=P7||isNaN(e.scale))&&(e.scale=1),(e.translate>=B7&&e.translate<=F7||isNaN(e.translate))&&(e.translate=0)}function Ud(e,t,n,r){bS(e.x,t.x,n.x,r?r.originX:void 0),bS(e.y,t.y,n.y,r?r.originY:void 0)}function ES(e,t,n){e.min=n.min+t.min,e.max=e.min+_s(t)}function $7(e,t,n){ES(e.x,t.x,n.x),ES(e.y,t.y,n.y)}function xS(e,t,n){e.min=t.min-n.min,e.max=e.min+_s(t)}function $d(e,t,n){xS(e.x,t.x,n.x),xS(e.y,t.y,n.y)}function H7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Bn(n,e,r.max):Math.min(e,n)),e}function wS(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 z7(e,{top:t,left:n,bottom:r,right:s}){return{x:wS(e.x,n,s),y:wS(e.y,t,r)}}function vS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Wc(t.min,t.max-r,e.min):r>s&&(n=Wc(e.min,e.max-s,t.min)),ba(0,1,n)}function Y7(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 EE=.35;function W7(e=EE){return e===!1?e=0:e===!0&&(e=EE),{x:_S(e,"left","right"),y:_S(e,"top","bottom")}}function _S(e,t,n){return{min:kS(e,t),max:kS(e,n)}}function kS(e,t){return typeof e=="number"?e:e[t]||0}const NS=()=>({translate:0,scale:1,origin:0,originPoint:0}),uc=()=>({x:NS(),y:NS()}),SS=()=>({min:0,max:0}),qn=()=>({x:SS(),y:SS()});function Os(e){return[e("x"),e("y")]}function rM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function G7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function q7(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 Xy(e){return e===void 0||e===1}function xE({scale:e,scaleX:t,scaleY:n}){return!Xy(e)||!Xy(t)||!Xy(n)}function jo(e){return xE(e)||sM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sM(e){return TS(e.x)||TS(e.y)}function TS(e){return e&&e!=="0%"}function eg(e,t,n){const r=e-n,s=t*r;return n+s}function AS(e,t,n,r,s){return s!==void 0&&(e=eg(e,s,r)),eg(e,n,r)+t}function wE(e,t=0,n=1,r,s){e.min=AS(e.min,t,n,r,s),e.max=AS(e.max,t,n,r,s)}function iM(e,{x:t,y:n}){wE(e.x,t.translate,t.scale,t.originPoint),wE(e.y,n.translate,n.scale,n.originPoint)}const CS=.999999999999,IS=1.0000000000001;function X7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lCS&&(t.x=1),t.yCS&&(t.y=1)}function dc(e,t){e.min=e.min+t,e.max=e.max+t}function RS(e,t,n,r,s=.5){const i=Bn(e.min,e.max,s);wE(e,t,n,i,r)}function fc(e,t){RS(e.x,t.x,t.scaleX,t.scale,t.originX),RS(e.y,t.y,t.scaleY,t.scale,t.originY)}function aM(e,t){return rM(q7(e.getBoundingClientRect(),t))}function Q7(e,t,n){const r=aM(e,n),{scroll:s}=t;return s&&(dc(r.x,s.offset.x),dc(r.y,s.offset.y)),r}const oM=({current:e})=>e?e.ownerDocument.defaultView:null,Z7=new WeakMap;class J7{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=qn(),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(ih(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=R7(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),Os(w=>{let y=this.getAxisMotionValue(w).get()||0;if(Ui.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=_s(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&_n.postRender(()=>m(d,f)),cE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=eH(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Os(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 JL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oM(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&&_n.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||!up(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=H7(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&&lc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=z7(s.layoutBox,n):this.constraints=!1,this.elastic=W7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Os(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Y7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!lc(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Q7(r,s.root,this.visualElement.getTransformPagePoint());let a=V7(s.layout.layoutBox,i);if(n){const l=n(G7(a));this.hasMutatedConstraints=!!l,l&&(a=rM(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Os(d=>{if(!up(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return cE(this.visualElement,t),r.start(pv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Os(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Os(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){Os(n=>{const{drag:r}=this.getProps();if(!up(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-Bn(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Os(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=K7({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(),Os(a=>{if(!up(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Bn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;Z7.set(this.visualElement,this);const t=this.visualElement.current,n=Fd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lc(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()),_n.read(r);const a=Af(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Os(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=EE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function up(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eH(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tH extends go{constructor(t){super(t),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new J7(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 OS=e=>(t,n)=>{e&&_n.postRender(()=>e(t,n))};class nH extends go{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(t){this.session=new JL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:OS(t),onStart:OS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&_n.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Fd(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 sm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function LS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(lt.test(e))e=parseFloat(e);else return e;const n=LS(e,t.target.x),r=LS(e,t.target.y);return`${n}% ${r}%`}},rH={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=fo.parse(e);if(s.length>5)return r;const i=fo.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=Bn(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class sH extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;IU(iH),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()})),sm.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()||_n.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zw.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 lM(e){const[t,n]=KO(),r=E.useContext(Bw);return o.jsx(sH,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(eL),isPresent:t,safeToRemove:n})}const iH={borderRadius:{...Zu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zu,borderTopRightRadius:Zu,borderBottomLeftRadius:Zu,borderBottomRightRadius:Zu,boxShadow:rH};function aH(e,t,n){const r=Mr(e)?e:Sf(e);return r.start(pv("",r,t,n)),r.animation}function oH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lH=(e,t)=>e.depth-t.depth;class cH{constructor(){this.children=[],this.isDirty=!1}add(t){ev(this.children,t),this.isDirty=!0}remove(t){tv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lH),this.isDirty=!1,this.children.forEach(t)}}function uH(e,t){const n=$i.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(uo(r),e(i-t))};return _n.read(r,!0),()=>uo(r)}const cM=["TopLeft","TopRight","BottomLeft","BottomRight"],dH=cM.length,MS=e=>typeof e=="string"?parseFloat(e):e,jS=e=>typeof e=="number"||lt.test(e);function fH(e,t,n,r,s,i){s?(e.opacity=Bn(0,n.opacity!==void 0?n.opacity:1,hH(r)),e.opacityExit=Bn(t.opacity!==void 0?t.opacity:1,0,pH(r))):i&&(e.opacity=Bn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Wc(e,t,r))}function PS(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){PS(e.x,t.x),PS(e.y,t.y)}function BS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function FS(e,t,n,r,s){return e-=t,e=eg(e,1/n,r),s!==void 0&&(e=eg(e,1/s,r)),e}function mH(e,t=0,n=1,r=.5,s,i=e,a=e){if(Ui.test(t)&&(t=parseFloat(t),t=Bn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Bn(i.min,i.max,r);e===i&&(l-=t),e.min=FS(e.min,t,n,l,s),e.max=FS(e.max,t,n,l,s)}function US(e,t,[n,r,s],i,a){mH(e,t[n],t[r],t[s],t.scale,i,a)}const gH=["x","scaleX","originX"],yH=["y","scaleY","originY"];function $S(e,t,n,r){US(e.x,t,gH,n?n.x:void 0,r?r.x:void 0),US(e.y,t,yH,n?n.y:void 0,r?r.y:void 0)}function HS(e){return e.translate===0&&e.scale===1}function dM(e){return HS(e.x)&&HS(e.y)}function zS(e,t){return e.min===t.min&&e.max===t.max}function bH(e,t){return zS(e.x,t.x)&&zS(e.y,t.y)}function VS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fM(e,t){return VS(e.x,t.x)&&VS(e.y,t.y)}function KS(e){return _s(e.x)/_s(e.y)}function YS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EH{constructor(){this.members=[]}add(t){ev(this.members,t),t.scheduleRender()}remove(t){if(tv(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 xH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Do={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ed=typeof window<"u"&&window.MotionDebug!==void 0,Qy=["","X","Y","Z"],wH={visibility:"hidden"},WS=1e3;let vH=0;function Zy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=gL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_n,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hM(r)}function pM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=vH++,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,Ed&&(Do.totalNodes=Do.resolvedTargetDeltas=Do.recalculatedProjection=0),this.nodes.forEach(NH),this.nodes.forEach(IH),this.nodes.forEach(RH),this.nodes.forEach(SH),Ed&&window.MotionDebug.record(Do)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=uH(h,250),sm.hasAnimatedSinceResize&&(sm.hasAnimatedSinceResize=!1,this.nodes.forEach(qS))})}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 g=this.options.transition||d.getDefaultTransition()||DH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!fM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Jw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||qS(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,uo(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(OH),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&&hM(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;XS(f.x,a.x,k),XS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),MH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&bH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=qn()),Rs(x,this.relativeTarget)),g&&(this.animationValues=d,fH(d,u,this.latestValues,k,b,y)),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&&(uo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_n.update(()=>{sm.hasAnimatedSinceResize=!0,this.currentAnimation=aH(0,WS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(WS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&mM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||qn();const f=_s(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=_s(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Rs(l,c),fc(l,d),Ud(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new EH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Zy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(GS),this.root.sharedNodes.clear()}}}function _H(e){e.updateLayout()}function kH(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"?Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(h);h.min=r[f].min,h.max=h.min+p}):mM(i,n.layoutBox,r)&&Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=uc();Ud(l,r,n.layoutBox);const c=uc();a?Ud(c,e.applyTransform(s,!0),n.measuredBox):Ud(c,r,n.layoutBox);const u=!dM(l);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=qn();$d(m,n.layoutBox,h.layoutBox);const g=qn();$d(g,r,p.layoutBox),fM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function NH(e){Ed&&Do.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 SH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function TH(e){e.clearSnapshot()}function GS(e){e.clearMeasurements()}function AH(e){e.isLayoutDirty=!1}function CH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function IH(e){e.resolveTargetDelta()}function RH(e){e.calcProjection()}function OH(e){e.resetSkewAndRotation()}function LH(e){e.removeLeadSnapshot()}function XS(e,t,n){e.translate=Bn(t.translate,0,n),e.scale=Bn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QS(e,t,n,r){e.min=Bn(t.min,n.min,r),e.max=Bn(t.max,n.max,r)}function MH(e,t,n,r){QS(e.x,t.x,n.x,r),QS(e.y,t.y,n.y,r)}function jH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const DH={duration:.45,ease:[.4,0,.1,1]},ZS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JS=ZS("applewebkit/")&&!ZS("chrome/")?Math.round:Es;function eT(e){e.min=JS(e.min),e.max=JS(e.max)}function PH(e){eT(e.x),eT(e.y)}function mM(e,t,n){return e==="position"||e==="preserve-aspect"&&!U7(KS(t),KS(n),.2)}function BH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const FH=pM({attachResizeListener:(e,t)=>Af(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jy={current:void 0},gM=pM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Jy.current){const e=new FH({});e.mount(window),e.setOptions({layoutScroll:!0}),Jy.current=e}return Jy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),UH={pan:{Feature:nH},drag:{Feature:tH,ProjectionNode:gM,MeasureLayout:lM}};function $H(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 yM(e,t){const n=$H(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function tT(e){return t=>{t.pointerType==="touch"||ZL()||e(t)}}function HH(e,t,n={}){const[r,s,i]=yM(e,n),a=tT(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=tT(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function nT(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&&_n.postRender(()=>i(t,ih(t)))}class zH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=HH(t,n=>(nT(this.node,n,"Start"),r=>nT(this.node,r,"End"))))}unmount(){}}class VH extends go{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=sh(Af(this.node.current,"focus",()=>this.onFocus()),Af(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const bM=(e,t)=>t?e===t?!0:bM(e,t.parentElement):!1,KH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YH(e){return KH.has(e.tagName)||e.tabIndex!==-1}const xd=new WeakSet;function rT(e){return t=>{t.key==="Enter"&&e(t)}}function eb(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rT(()=>{if(xd.has(n))return;eb(n,"down");const s=rT(()=>{eb(n,"up")}),i=()=>eb(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 sT(e){return mv(e)&&!ZL()}function GH(e,t,n={}){const[r,s,i]=yM(e,n),a=l=>{const c=l.currentTarget;if(!sT(l)||xd.has(c))return;xd.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!sT(p)||!xd.has(c))&&(xd.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||bM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!YH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>WH(u,s),s)}),i}function iT(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&&_n.postRender(()=>i(t,ih(t)))}class qH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=GH(t,n=>(iT(this.node,n,"Start"),(r,{success:s})=>iT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const vE=new WeakMap,tb=new WeakMap,XH=e=>{const t=vE.get(e.target);t&&t(e)},QH=e=>{e.forEach(XH)};function ZH({root:e,...t}){const n=e||document;tb.has(n)||tb.set(n,{});const r=tb.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(QH,{root:e,...t})),r[s]}function JH(e,t,n){const r=ZH(t);return vE.set(e,n),r.observe(e),()=>{vE.delete(e),r.unobserve(e)}}const ez={some:0,all:1};class tz extends go{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:ez[s]},l=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 JH(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(nz(t,n))&&this.startObserver()}unmount(){}}function nz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rz={inView:{Feature:tz},tap:{Feature:qH},focus:{Feature:VH},hover:{Feature:zH}},sz={layout:{ProjectionNode:gM,MeasureLayout:lM}},_E={current:null},EM={current:!1};function iz(){if(EM.current=!0,!!Fw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_E.current=e.matches;e.addListener(t),t()}else _E.current=!1}const az=[...UL,Or,fo],oz=e=>az.find(FL(e)),aT=new WeakMap;function lz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Mr(s))e.addValue(r,s);else if(Mr(i))e.addValue(r,Sf(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,Sf(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class cz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=dv,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=$i.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),EM.current||iz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_E.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aT.delete(this.current),this.projection&&this.projection.unmount(),uo(this.notifyUpdate),uo(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=wl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&_n.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):qn()}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=Sf(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"&&(PL(s)||AL(s))?s=parseFloat(s):!oz(s)&&fo.test(n)&&(s=ML(t,n)),this.setBaseTarget(t,Mr(s)?s.get():s)),Mr(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=Kw(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&&!Mr(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 nv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class xM extends cz{constructor(){super(...arguments),this.KeyframeResolver=$L}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;Mr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function uz(e){return window.getComputedStyle(e)}class dz extends xM{constructor(){super(...arguments),this.type="html",this.renderInstance=oL}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}else{const r=uz(t),s=(sL(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return aM(t,n)}build(t,n,r){Gw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zw(t,n,r)}}class fz extends xM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}return n=lL.has(n)?n:Hw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return dL(t,n,r)}build(t,n,r){qw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){cL(t,n,r,s)}mount(t){this.isSVGTag=Qw(t.tagName),super.mount(t)}}const hz=(e,t)=>Vw(e)?new fz(t):new dz(t,{allowProjection:e!==E.Fragment}),pz=FU({...I7,...rz,...UH,...sz},hz),nn=eU(pz);function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Kl(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var mz=["container"];function gz(e){var t=e.container,n=t===void 0?document.body:t,r=c0(e,mz);return vs.createPortal(kt.createElement("div",fr({},r)),n)}function yz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 bz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 Ez(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function xz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function cT(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 Ha=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function nb(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Ha(e,i,n,innerWidth)[0],f=Ha(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function SE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function rb(e,t,n){var r=SE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function fp(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var vz={T:0,L:0,W:0,H:0,FIT:void 0},vM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},_z=["className"];function kz(e){var t=e.className,n=t===void 0?"":t,r=c0(e,_z);return kt.createElement("div",fr({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Nz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Sz(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=c0(e,Nz),u=vM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",fr({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(kz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var Tz={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 Az(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,T=e.expose,S=tg(Tz),R=S[0],I=S[1],j=E.useRef(0),F=vM(),Y=R.naturalWidth,L=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?l:U,M=R.width,O=M===void 0?i:M,D=R.height,A=D===void 0?l:D,H=R.loaded,W=H===void 0?!n:H,P=R.broken,te=R.x,X=R.y,ne=R.touched,ce=R.stopRaf,J=R.maskTouched,fe=R.rotate,ee=R.scale,Ee=R.CX,ge=R.CY,xe=R.lastX,we=R.lastY,Te=R.lastCX,Re=R.lastCY,Ye=R.lastScale,Le=R.touchTime,bt=R.touchLength,Ze=R.pause,ze=R.reach,le=Jo({onScale:function(pe){return ve(dp(pe))},onRotate:function(pe){fe!==pe&&(T({rotate:pe}),I(fr({rotate:pe},rb(L,C,pe))))}});function ve(pe,Je,at){ee!==pe&&(T({scale:pe}),I(fr({scale:pe},nb(te,X,O,A,ee,pe,Je,at),pe<=1&&{x:0,y:0})))}var ct=fp(function(pe,Je,at){if(at===void 0&&(at=0),(ne||J)&&N){var dn=SE(fe,O,A),an=dn[0],pt=dn[1];if(at===0&&j.current===0){var Lt=Math.abs(pe-Ee)<=20,on=Math.abs(Je-ge)<=20;if(Lt&&on)return void I({lastCX:pe,lastCY:Je});j.current=Lt?Je>ge?3:2:1}var On,lr=pe-Te,fn=Je-Re;if(at===0){var Bt=Ha(lr+xe,ee,an,innerWidth)[0],Kn=Ha(fn+we,ee,pt,innerHeight);On=function(Se,Ce,Qe,ot){return Ce&&Se===1||ot==="x"?"x":Qe&&Se>1||ot==="y"?"y":void 0}(j.current,Bt,Kn[0],ze),On!==void 0&&x(On,pe,Je,ee)}if(On==="x"||J)return void I({reach:"x"});var ue=dp(ee+(at-bt)/100/2*ee,L/O,.2);T({scale:ue}),I(fr({touchLength:at,reach:On,scale:ue},nb(te,X,O,A,ee,ue,pe,Je,lr,fn)))}},{maxWait:8});function ht(pe){return!ce&&!ne&&(F.current&&I(fr({},pe,{pause:u})),F.current)}var G,Z,he,De,qe,nt,Vt,Et,Pt=(qe=function(pe){return ht({x:pe})},nt=function(pe){return ht({y:pe})},Vt=function(pe){return F.current&&(T({scale:pe}),I({scale:pe})),!ne&&F.current},Et=Jo({X:function(pe){return qe(pe)},Y:function(pe){return nt(pe)},S:function(pe){return Vt(pe)}}),function(pe,Je,at,dn,an,pt,Lt,on,On,lr,fn){var Bt=SE(lr,an,pt),Kn=Bt[0],ue=Bt[1],Se=Ha(pe,on,Kn,innerWidth),Ce=Se[0],Qe=Se[1],ot=Ha(Je,on,ue,innerHeight),et=ot[0],Ct=ot[1],Yt=Date.now()-fn;if(Yt>=200||on!==Lt||Math.abs(On-Lt)>1){var oe=nb(pe,Je,an,pt,Lt,on),be=oe.x,ft=oe.y,Ve=Ce?Qe:be!==pe?be:null,Ke=et?Ct:ft!==Je?ft:null;return Ve!==null&&Fo(pe,Ve,Et.X),Ke!==null&&Fo(Je,Ke,Et.Y),void(on!==Lt&&Fo(Lt,on,Et.S))}var dt=(pe-at)/Yt,Wt=(Je-dn)/Yt,cr=Math.sqrt(Math.pow(dt,2)+Math.pow(Wt,2)),Yn=!1,hn=!1;(function(Ln,Gt){var Jt,Ot=Ln,kn=0,Nn=0,en=function(pr){Jt||(Jt=pr);var nr=pr-Jt,Si=Math.sign(Ln),Xs=-.001*Si,Zr=Math.sign(-Ot)*Math.pow(Ot,2)*2e-4,Ar=Ot*nr+(Xs+Zr)*Math.pow(nr,2)/2;kn+=Ar,Jt=pr,Si*(Ot+=(Xs+Zr)*nr)<=0?Wn():Gt(kn)?tr():Wn()};function tr(){Nn=requestAnimationFrame(en)}function Wn(){cancelAnimationFrame(Nn)}tr()})(cr,function(Ln){var Gt=pe+Ln*(dt/cr),Jt=Je+Ln*(Wt/cr),Ot=Ha(Gt,Lt,Kn,innerWidth),kn=Ot[0],Nn=Ot[1],en=Ha(Jt,Lt,ue,innerHeight),tr=en[0],Wn=en[1];if(kn&&!Yn&&(Yn=!0,Ce?Fo(Gt,Nn,Et.X):uT(Nn,Gt+(Gt-Nn),Et.X)),tr&&!hn&&(hn=!0,et?Fo(Jt,Wn,Et.Y):uT(Wn,Jt+(Jt-Wn),Et.Y)),Yn&&hn)return!1;var pr=Yn||Et.X(Nn),nr=hn||Et.Y(Wn);return pr&&nr})}),Kt=(G=y,Z=function(pe,Je){ze||ve(ee!==1?1:Math.max(2,L/O),pe,Je)},he=E.useRef(0),De=fp(function(){he.current=0,G.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var pe=[].slice.call(arguments);he.current+=1,De.apply(void 0,pe),he.current>=2&&(De.cancel(),he.current=0,Z.apply(void 0,pe))});function Nt(pe,Je){if(j.current=0,(ne||J)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var at=dp(ee,L/O);if(Pt(te,X,xe,we,O,A,ee,at,Ye,fe,Le),_(pe,Je),Ee===pe&&ge===Je){if(ne)return void Kt(pe,Je);J&&b(pe,Je)}}}function rn(pe,Je,at){at===void 0&&(at=0),I({touched:!0,CX:pe,CY:Je,lastCX:pe,lastCY:Je,lastX:te,lastY:X,lastScale:ee,touchLength:at,touchTime:Date.now()})}function sn(pe){I({maskTouched:!0,CX:pe.clientX,CY:pe.clientY,lastX:te,lastY:X})}Kl(na?void 0:"mousemove",function(pe){pe.preventDefault(),ct(pe.clientX,pe.clientY)}),Kl(na?void 0:"mouseup",function(pe){Nt(pe.clientX,pe.clientY)}),Kl(na?"touchmove":void 0,function(pe){pe.preventDefault();var Je=cT(pe);ct.apply(void 0,Je)},{passive:!1}),Kl(na?"touchend":void 0,function(pe){var Je=pe.changedTouches[0];Nt(Je.clientX,Je.clientY)},{passive:!1}),Kl("resize",fp(function(){W&&!ne&&(I(rb(L,C,fe)),k())},{maxWait:8})),NE(function(){N&&T(fr({scale:ee,rotate:fe},le))},[N]);var _t=function(pe,Je,at,dn,an,pt,Lt,on,On,lr){var fn=function(be,ft,Ve,Ke,dt){var Wt=E.useRef(!1),cr=tg({lead:!0,scale:Ve}),Yn=cr[0],hn=Yn.lead,Ln=Yn.scale,Gt=cr[1],Jt=fp(function(Ot){try{return dt(!0),Gt({lead:!1,scale:Ot}),Promise.resolve()}catch(kn){return Promise.reject(kn)}},{wait:Ke});return NE(function(){Wt.current?(dt(!1),Gt({lead:!0}),Jt(Ve)):Wt.current=!0},[Ve]),hn?[be*Ln,ft*Ln,Ve/Ln]:[be*Ve,ft*Ve,1]}(pt,Lt,on,On,lr),Bt=fn[0],Kn=fn[1],ue=fn[2],Se=function(be,ft,Ve,Ke,dt){var Wt=E.useState(vz),cr=Wt[0],Yn=Wt[1],hn=E.useState(0),Ln=hn[0],Gt=hn[1],Jt=E.useRef(),Ot=Jo({OK:function(){return be&&Gt(4)}});function kn(Nn){dt(!1),Gt(Nn)}return E.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Ve){if(function(Nn,en){var tr=Nn&&Nn.current;if(tr&&tr.nodeType===1){var Wn=tr.getBoundingClientRect();en({T:Wn.top,L:Wn.left,W:Wn.width,H:Wn.height,FIT:tr.tagName==="IMG"?getComputedStyle(tr).objectFit:void 0})}}(ft,Yn),be)return Date.now()-Jt.current<250?(Gt(1),requestAnimationFrame(function(){Gt(2),requestAnimationFrame(function(){return kn(3)})}),void setTimeout(Ot.OK,Ke)):void Gt(4);kn(5)}},[be,Ve]),[Ln,cr]}(pe,Je,at,On,lr),Ce=Se[0],Qe=Se[1],ot=Qe.W,et=Qe.FIT,Ct=innerWidth/2,Yt=innerHeight/2,oe=Ce<3||Ce>4;return[oe?ot?Qe.L:Ct:dn+(Ct-pt*on/2),oe?ot?Qe.T:Yt:an+(Yt-Lt*on/2),Bt,oe&&et?Bt*(Qe.H/ot):Kn,Ce===0?ue:oe?ot/(pt*on)||.01:ue,oe?et?1:0:1,Ce,et]}(u,c,W,te,X,O,A,ee,d,function(pe){return I({pause:pe})}),rt=_t[4],Oe=_t[6],gt="transform "+d+"ms "+f,Ae={className:p,onMouseDown:na?void 0:function(pe){pe.stopPropagation(),pe.button===0&&rn(pe.clientX,pe.clientY,0)},onTouchStart:na?function(pe){pe.stopPropagation(),rn.apply(void 0,cT(pe))}:void 0,onWheel:function(pe){if(!ze){var Je=dp(ee-pe.deltaY/100/2,L/O);I({stopRaf:!0}),ve(Je,pe.clientX,pe.clientY)}},style:{width:_t[2]+"px",height:_t[3]+"px",opacity:_t[5],objectFit:Oe===4?void 0:_t[7],transform:fe?"rotate("+fe+"deg)":void 0,transition:Oe>2?gt+", opacity "+d+"ms ease, height "+(Oe<4?d/2:Oe>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!na&&N?sn:void 0,onTouchStart:na&&N?function(pe){return sn(pe.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+rt+", 0, 0, "+rt+", "+_t[0]+", "+_t[1]+")",transition:ne||Ze?void 0:gt,willChange:N?"transform":void 0}},n?kt.createElement(Sz,fr({src:n,loaded:W,broken:P},Ae,{onPhotoLoad:function(pe){I(fr({},pe,pe.loaded&&rb(pe.naturalWidth||0,pe.naturalHeight||0,fe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:Ae,scale:rt,rotate:fe})))}var dT={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 Cz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,T=e.index,S=T===void 0?0:T,R=e.onIndexChange,I=e.visible,j=e.onClose,F=e.afterClose,Y=e.portalContainer,L=tg(dT),U=L[0],C=L[1],M=E.useState(0),O=M[0],D=M[1],A=U.x,H=U.touched,W=U.pause,P=U.lastCX,te=U.lastCY,X=U.bg,ne=X===void 0?u:X,ce=U.lastBg,J=U.overlay,fe=U.minimal,ee=U.scale,Ee=U.rotate,ge=U.onScale,xe=U.onRotate,we=e.hasOwnProperty("index"),Te=we?S:O,Re=we?R:D,Ye=E.useRef(Te),Le=N.length,bt=N[Te],Ze=typeof n=="boolean"?n:Le>n,ze=function(rt,Oe){var gt=E.useReducer(function(at){return!at},!1)[1],Ae=E.useRef(0),pe=function(at){var dn=E.useRef(at);function an(pt){dn.current=pt}return E.useMemo(function(){(function(pt){rt?(pt(rt),Ae.current=1):Ae.current=2})(an)},[at]),[dn.current,an]}(rt),Je=pe[1];return[pe[0],Ae.current,function(){gt(),Ae.current===2&&(Je(!1),Oe&&Oe()),Ae.current=0}]}(I,F),le=ze[0],ve=ze[1],ct=ze[2];NE(function(){if(le)return C({pause:!0,x:Te*-(innerWidth+Pl)}),void(Ye.current=Te);C(dT)},[le]);var ht=Jo({close:function(rt){xe&&xe(0),C({overlay:!0,lastBg:ne}),j(rt)},changeIndex:function(rt,Oe){Oe===void 0&&(Oe=!1);var gt=Ze?Ye.current+(rt-Te):rt,Ae=Le-1,pe=kE(gt,0,Ae),Je=Ze?gt:pe,at=innerWidth+Pl;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-at*Je,pause:Oe}),Ye.current=Je,Re&&Re(Ze?rt<0?Ae:rt>Ae?0:rt:pe)}}),G=ht.close,Z=ht.changeIndex;function he(rt){return rt?G():C({overlay:!J})}function De(){C({x:-(innerWidth+Pl)*Te,lastCX:void 0,lastCY:void 0,pause:!0}),Ye.current=Te}function qe(rt,Oe,gt,Ae){rt==="x"?function(pe){if(P!==void 0){var Je=pe-P,at=Je;!Ze&&(Te===0&&Je>0||Te===Le-1&&Je<0)&&(at=Je/2),C({touched:!0,lastCX:P,x:-(innerWidth+Pl)*Ye.current+at,pause:!1})}else C({touched:!0,lastCX:pe,x:A,pause:!1})}(Oe):rt==="y"&&function(pe,Je){if(te!==void 0){var at=u===null?null:kE(u,.01,u-Math.abs(pe-te)/100/4);C({touched:!0,lastCY:te,bg:Je===1?at:u,minimal:Je===1})}else C({touched:!0,lastCY:pe,bg:ne,minimal:!0})}(gt,Ae)}function nt(rt,Oe){var gt=rt-(P??rt),Ae=Oe-(te??Oe),pe=!1;if(gt<-40)Z(Te+1);else if(gt>40)Z(Te-1);else{var Je=-(innerWidth+Pl)*Ye.current;Math.abs(Ae)>100&&fe&&f&&(pe=!0,G()),C({touched:!1,x:Je,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!pe||J})}}Kl("keydown",function(rt){if(I)switch(rt.key){case"ArrowLeft":Z(Te-1,!0);break;case"ArrowRight":Z(Te+1,!0);break;case"Escape":G()}});var Vt=function(rt,Oe,gt){return E.useMemo(function(){var Ae=rt.length;return gt?rt.concat(rt).concat(rt).slice(Ae+Oe-1,Ae+Oe+2):rt.slice(Math.max(Oe-1,0),Math.min(Oe+2,Ae+1))},[rt,Oe,gt])}(N,Te,Ze);if(!le)return null;var Et=J&&!ve,Pt=I?ne:ce,Kt=ge&&xe&&{images:N,index:Te,visible:I,onClose:G,onIndexChange:Z,overlayVisible:Et,overlay:bt&&bt.overlay,scale:ee,rotate:Ee,onScale:ge,onRotate:xe},Nt=r?r(ve):400,rn=s?s(ve):lT,sn=r?r(3):600,_t=s?s(3):lT;return kt.createElement(gz,{className:"PhotoView-Portal"+(Et?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(rt){return rt.stopPropagation()},container:Y},I&&kt.createElement(xz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ve===1?" PhotoView-Slider__fadeIn":ve===2?" PhotoView-Slider__fadeOut":""),style:{background:Pt?"rgba(0, 0, 0, "+Pt+")":void 0,transitionTimingFunction:rn,transitionDuration:(H?0:Nt)+"ms",animationDuration:Nt+"ms"},onAnimationEnd:ct}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},Te+1," / ",Le),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&Kt&&g(Kt),kt.createElement(yz,{className:"PhotoView-Slider__toolbarIcon",onClick:G}))),Vt.map(function(rt,Oe){var gt=Ze||Te!==0?Ye.current-1+Oe:Te+Oe;return kt.createElement(Az,{key:Ze?rt.key+"/"+rt.src+"/"+gt:rt.key,item:rt,speed:Nt,easing:rn,visible:I,onReachMove:qe,onReachUp:nt,onPhotoTap:function(){return he(i)},onMaskTap:function(){return he(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Pl)*gt+"px",transform:"translate3d("+A+"px, 0px, 0)",transition:H||W?void 0:"transform "+sn+"ms "+_t},loadingElement:_,brokenElement:k,onPhotoResize:De,isActive:Ye.current===gt,expose:C})}),!na&&p&&kt.createElement(kt.Fragment,null,(Ze||Te!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Z(Te-1,!0)}},kt.createElement(bz,null)),(Ze||Te+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Jo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return fr({},a,h)},[a,h]);return kt.createElement(wM.Provider,{value:m},t,kt.createElement(Cz,fr({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var _M=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(wM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=Jo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,fr({},g,{ref:p}))):null};/** + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(V9,{isPresent:t,childRef:r,sizeRef:s,children:E.cloneElement(e,{ref:r})})}const Y9=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a})=>{const l=n0(W9),c=E.useId(),u=E.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;r&&r()},[l,r]),d=E.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),i?[Math.random(),u]:[n,u]);return E.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),E.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=o.jsx(K9,{isPresent:n,children:e})),o.jsx(r0.Provider,{value:d,children:e})};function W9(){return new Map}function KO(e=!0){const t=E.useContext(r0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=E.useId();E.useEffect(()=>{e&&s(i)},[e]);const a=E.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const op=e=>e.key||"";function WN(e){const t=[];return E.Children.forEach(e,n=>{E.isValidElement(n)&&t.push(n)}),t}const Fw=typeof window<"u",YO=Fw?E.useLayoutEffect:E.useEffect,di=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1})=>{const[l,c]=KO(a),u=E.useMemo(()=>WN(e),[e]),d=a&&!l?[]:u.map(op),f=E.useRef(!0),h=E.useRef(u),p=n0(()=>new Map),[m,g]=E.useState(u),[w,y]=E.useState(u);YO(()=>{f.current=!1,h.current=u;for(let _=0;_{const k=op(_),N=a&&!l?!1:u===w||d.includes(k),T=()=>{if(p.has(k))p.set(k,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(x==null||x(),y(h.current),a&&(c==null||c()),r&&r())};return o.jsx(Y9,{isPresent:N,initial:!f.current||n?void 0:!1,custom:N?void 0:t,presenceAffectsLayout:s,mode:i,onExitComplete:N?void 0:T,children:_},k)})})},Es=e=>e;let WO=Es;const G9={useManualTiming:!1};function q9(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 l(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(l),t.clear(),r=!1,s&&(s=!1,c.process(u))}};return c}const lp=["read","resolveKeyframes","update","preRender","render","postRender"],X9=40;function GO(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=lp.reduce((y,b)=>(y[b]=q9(i),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(y-s.timestamp,X9),1),s.timestamp=y,s.isProcessing=!0,l.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:lp.reduce((y,b)=>{const x=a[b];return y[b]=(_,k=!1,N=!1)=>(n||m(),x.schedule(_,k,N)),y},{}),cancel:y=>{for(let b=0;bGN[e].some(n=>!!t[n])};function Q9(e){for(const t in e)Wc[t]={...Wc[t],...e[t]}}const Z9=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")||Z9.has(e)}let XO=e=>!Gm(e);function QO(e){e&&(XO=t=>t.startsWith("on")?!Gm(t):e(t))}try{QO(require("@emotion/is-prop-valid").default)}catch{}function J9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(XO(s)||n===!0&&Gm(s)||!t&&!Gm(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function eU({children:e,isValidProp:t,...n}){t&&QO(t),n={...E.useContext(_f),...n},n.isStatic=n0(()=>n.isStatic);const r=E.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(_f.Provider,{value:r,children:e})}function tU(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 s0=E.createContext({});function kf(e){return typeof e=="string"||Array.isArray(e)}function i0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Uw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$w=["initial",...Uw];function a0(e){return i0(e.animate)||$w.some(t=>kf(e[t]))}function ZO(e){return!!(a0(e)||e.variants)}function nU(e,t){if(a0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kf(n)?n:void 0,animate:kf(r)?r:void 0}}return e.inherit!==!1?t:{}}function rU(e){const{initial:t,animate:n}=nU(e,E.useContext(s0));return E.useMemo(()=>({initial:t,animate:n}),[qN(t),qN(n)])}function qN(e){return Array.isArray(e)?e.join(" "):e}const sU=Symbol.for("motionComponentSymbol");function cc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iU(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):cc(n)&&(n.current=r))},[t])}const Hw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),aU="framerAppearId",JO="data-"+Hw(aU),{schedule:zw}=GO(queueMicrotask,!1),eL=E.createContext({});function oU(e,t,n,r,s){var i,a;const{visualElement:l}=E.useContext(s0),c=E.useContext(qO),u=E.useContext(r0),d=E.useContext(_f).reducedMotion,f=E.useRef(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=E.useContext(eL);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&lU(f.current,n,s,p);const m=E.useRef(!1);E.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const g=n[JO],w=E.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,g)));return YO(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),zw.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),E.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),w.current=!1))}),h}function lU(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tL(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&cc(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:u})}function tL(e){if(e)return e.options.allowProjection!==!1?e.projection:tL(e.parent)}function cU({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,a;e&&Q9(e);function l(u,d){let f;const h={...E.useContext(_f),...u,layoutId:uU(u)},{isStatic:p}=h,m=rU(u),g=r(u,p);if(!p&&Fw){dU();const w=fU(h);f=w.MeasureLayout,m.visualElement=oU(s,g,h,t,w.ProjectionNode)}return o.jsxs(s0.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(s,u,iU(g,m.visualElement,d),g,p,m.visualElement)]})}l.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=E.forwardRef(l);return c[sU]=s,c}function uU({layoutId:e}){const t=E.useContext(Bw).id;return t&&e!==void 0?t+"-"+e:e}function dU(e,t){E.useContext(qO).strict}function fU(e){const{drag:t,layout:n}=Wc;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 hU=["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 Vw(e){return typeof e!="string"||e.includes("-")?!1:!!(hU.indexOf(e)>-1||/[A-Z]/u.test(e))}function XN(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kw(e,t,n,r){if(typeof t=="function"){const[s,i]=XN(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]=XN(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const lE=e=>Array.isArray(e),pU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),mU=e=>lE(e)?e[e.length-1]||0:e,Mr=e=>!!(e&&e.getVelocity);function nm(e){const t=Mr(e)?e.get():e;return pU(t)?t.toValue():t}function gU({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const a={latestValues:yU(r,s,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const nL=e=>(t,n)=>{const r=E.useContext(s0),s=E.useContext(r0),i=()=>gU(e,t,r,s);return n?i():n0(i)};function yU(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=nm(i[h]);let{initial:a,animate:l}=e;const c=a0(e),u=ZO(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!i0(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),sL=rL("--"),bU=rL("var(--"),Yw=e=>bU(e)?EU.test(e.split("/*")[0].trim()):!1,EU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,iL=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ba=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Nf={...wu,transform:e=>ba(0,1,e)},cp={...wu,default:1},nh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pa=nh("deg"),Ui=nh("%"),lt=nh("px"),xU=nh("vh"),wU=nh("vw"),QN={...Ui,parse:e=>Ui.parse(e)/100,transform:e=>Ui.transform(e*100)},vU={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,backgroundPositionX:lt,backgroundPositionY:lt},_U={rotate:Pa,rotateX:Pa,rotateY:Pa,rotateZ:Pa,scale:cp,scaleX:cp,scaleY:cp,scaleZ:cp,skew:Pa,skewX:Pa,skewY:Pa,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:Nf,originX:QN,originY:QN,originZ:lt},ZN={...wu,transform:Math.round},Ww={...vU,..._U,zIndex:ZN,size:lt,fillOpacity:Nf,strokeOpacity:Nf,numOctaves:ZN},kU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NU=xu.length;function SU(e,t,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}}),aL=()=>({...Xw(),attrs:{}}),Qw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oL(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 lL=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 cL(e,t,n,r){oL(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(lL.has(s)?s:Hw(s),t.attrs[s])}const qm={};function RU(e){Object.assign(qm,e)}function uL(e,{layout:t,layoutId:n}){return wl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qm[e]||e==="opacity")}function Zw(e,t,n){var r;const{style:s}=e,i={};for(const a in s)(Mr(s[a])||t.style&&Mr(t.style[a])||uL(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 dL(e,t,n){const r=Zw(e,t,n);for(const s in e)if(Mr(e[s])||Mr(t[s])){const i=xu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}function OU(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 eS=["x","y","width","height","cx","cy","r"],LU={useVisualState:nL({scrapeMotionValuesFromProps:dL,createRenderState:aL,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(wl.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l{OU(n,r),_n.render(()=>{qw(r,s,Qw(n.tagName),e.transformTemplate),cL(n,r)})})}})},MU={useVisualState:nL({scrapeMotionValuesFromProps:Zw,createRenderState:Xw})};function fL(e,t,n){for(const r in t)!Mr(t[r])&&!uL(r,n)&&(e[r]=t[r])}function jU({transformTemplate:e},t){return E.useMemo(()=>{const n=Xw();return Gw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function DU(e,t){const n=e.style||{},r={};return fL(r,n,e),Object.assign(r,jU(e,t)),r}function PU(e,t){const n={},r=DU(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 BU(e,t,n,r){const s=E.useMemo(()=>{const i=aL();return qw(i,t,Qw(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};fL(i,e.style,e),s.style={...i,...s.style}}return s}function FU(e=!1){return(n,r,s,{latestValues:i},a)=>{const c=(Vw(n)?BU:PU)(r,i,a,n),u=J9(r,typeof n=="string",e),d=n!==E.Fragment?{...u,...c,ref:s}:{},{children:f}=r,h=E.useMemo(()=>Mr(f)?f.get():f,[f]);return E.createElement(n,{...d,children:h})}}function UU(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...Vw(r)?LU:MU,preloadedFeatures:e,useRender:FU(s),createVisualElement:t,Component:r};return cU(a)}}function hL(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(rm===void 0&&$i.set(kr.isProcessing||G9.useManualTiming?kr.timestamp:performance.now()),rm),set:e=>{rm=e,queueMicrotask($U)}};function ev(e,t){e.indexOf(t)===-1&&e.push(t)}function tv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class nv{constructor(){this.subscriptions=[]}add(t){return ev(this.subscriptions,t),()=>tv(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 zU{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=$i.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=$i.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=HU(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 nv);const r=this.events[t].add(n);return t==="change"?()=>{r(),_n.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=$i.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>tS)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tS);return mL(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 Sf(e,t){return new zU(e,t)}function VU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Sf(n))}function KU(e,t){const n=o0(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=mU(i[a]);VU(e,a,l)}}function YU(e){return!!(Mr(e)&&e.add)}function cE(e,t){const n=e.getValue("willChange");if(YU(n))return n.add(t)}function gL(e){return e.props[JO]}function rv(e){let t;return()=>(t===void 0&&(t=e()),t)}const WU=rv(()=>window.ScrollTimeline!==void 0);class GU{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(WU()&&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 qU extends GU{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const da=e=>e*1e3,fa=e=>e/1e3;function sv(e){return typeof e=="function"}function nS(e,t){e.timeline=t,e.onfinish=null}const iv=e=>Array.isArray(e)&&typeof e[0]=="number",XU={linearEasing:void 0};function QU(e,t){const n=rv(e);return()=>{var r;return(r=XU[t])!==null&&r!==void 0?r:n()}}const Xm=QU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Gc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yL=(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})`,uE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bd([0,.65,.55,1]),circOut:bd([.55,0,1,.45]),backIn:bd([.31,.01,.66,-.59]),backOut:bd([.33,1.53,.69,.99])};function EL(e,t){if(e)return typeof e=="function"&&Xm()?yL(e,t):iv(e)?bd(e):Array.isArray(e)?e.map(n=>EL(n,t)||uE.easeOut):uE[e]}const xL=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ZU=1e-7,JU=12;function e$(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=xL(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>ZU&&++le$(i,0,1,e,n);return i=>i===0||i===1?i:xL(s(i),t,r)}const wL=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vL=e=>t=>1-e(1-t),_L=rh(.33,1.53,.69,.99),av=vL(_L),kL=wL(av),NL=e=>(e*=2)<1?.5*av(e):.5*(2-Math.pow(2,-10*(e-1))),ov=e=>1-Math.sin(Math.acos(e)),SL=vL(ov),TL=wL(ov),AL=e=>/^0[^.\s]+$/u.test(e);function t$(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||AL(e):!0}const Bd=e=>Math.round(e*1e5)/1e5,lv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function n$(e){return e==null}const r$=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,cv=(e,t)=>n=>!!(typeof n=="string"&&r$.test(n)&&n.startsWith(e)||t&&!n$(n)&&Object.prototype.hasOwnProperty.call(n,t)),CL=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(lv);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},s$=e=>ba(0,255,e),Vy={...wu,transform:e=>Math.round(s$(e))},Ko={test:cv("rgb","red"),parse:CL("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Vy.transform(e)+", "+Vy.transform(t)+", "+Vy.transform(n)+", "+Bd(Nf.transform(r))+")"};function i$(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 dE={test:cv("#"),parse:i$,transform:Ko.transform},uc={test:cv("hsl","hue"),parse:CL("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ui.transform(Bd(t))+", "+Ui.transform(Bd(n))+", "+Bd(Nf.transform(r))+")"},Or={test:e=>Ko.test(e)||dE.test(e)||uc.test(e),parse:e=>Ko.test(e)?Ko.parse(e):uc.test(e)?uc.parse(e):dE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ko.transform(e):uc.transform(e)},a$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function o$(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(lv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(a$))===null||n===void 0?void 0:n.length)||0)>0}const IL="number",RL="color",l$="var",c$="var(",rS="${}",u$=/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 Tf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(u$,c=>(Or.test(c)?(r.color.push(i),s.push(RL),n.push(Or.parse(c))):c.startsWith(c$)?(r.var.push(i),s.push(l$),n.push(c)):(r.number.push(i),s.push(IL),n.push(parseFloat(c))),++i,rS)).split(rS);return{values:n,split:l,indexes:r,types:s}}function OL(e){return Tf(e).values}function LL(e){const{split:t,types:n}=Tf(e),r=t.length;return s=>{let i="";for(let a=0;atypeof e=="number"?0:e;function f$(e){const t=OL(e);return LL(e)(t.map(d$))}const fo={test:o$,parse:OL,createTransformer:LL,getAnimatableNone:f$},h$=new Set(["brightness","contrast","saturate","opacity"]);function p$(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(lv)||[];if(!r)return e;const s=n.replace(r,"");let i=h$.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const m$=/\b([a-z-]*)\(.*?\)/gu,fE={...fo,getAnimatableNone:e=>{const t=e.match(m$);return t?t.map(p$).join(" "):e}},g$={...Ww,color:Or,backgroundColor:Or,outlineColor:Or,fill:Or,stroke:Or,borderColor:Or,borderTopColor:Or,borderRightColor:Or,borderBottomColor:Or,borderLeftColor:Or,filter:fE,WebkitFilter:fE},uv=e=>g$[e];function ML(e,t){let n=uv(e);return n!==fE&&(n=fo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const y$=new Set(["auto","none","0"]);function b$(e,t,n){let r=0,s;for(;re===wu||e===lt,iS=(e,t)=>parseFloat(e.split(", ")[t]),aS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return iS(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?iS(i[1],e):0}},E$=new Set(["x","y","z"]),x$=xu.filter(e=>!E$.has(e));function w$(e){const t=[];return x$.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const qc={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:aS(4,13),y:aS(5,14)};qc.translateX=qc.x;qc.translateY=qc.y;const Zo=new Set;let hE=!1,pE=!1;function jL(){if(pE){const e=Array.from(Zo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=w$(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 l;(l=r.getValue(i))===null||l===void 0||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}pE=!1,hE=!1,Zo.forEach(e=>e.complete()),Zo.clear()}function DL(){Zo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(pE=!0)})}function v$(){DL(),jL()}class dv{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?(Zo.add(this),hE||(hE=!0,_n.read(DL),_n.resolveKeyframes(jL))):(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),_$=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function k$(e){const t=_$.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function BL(e,t,n=1){const[r,s]=k$(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return PL(a)?parseFloat(a):a}return Yw(s)?BL(s,t,n+1):s}const FL=e=>t=>t.test(e),N$={test:e=>e==="auto",parse:e=>e},UL=[wu,lt,Ui,Pa,wU,xU,N$],oS=e=>UL.find(FL(e));class $L extends dv{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 lS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fo.test(e)||e==="0")&&!e.startsWith("url("));function S$(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function l0(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(A$),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const C$=40;class HL{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$i.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>C$?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&v$(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=$i.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!T$(t,r,s,i))if(a)this.options.duration=0;else{c&&c(l0(t,this.options,n)),l&&l(),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 mE=2e4;function zL(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=mE?1/0:t}const Bn=(e,t,n)=>e+(t-e)*n;function Ky(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 I$({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 l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Ky(c,l,e+1/3),i=Ky(c,l,e),a=Ky(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Qm(e,t){return n=>n>0?t:e}const Yy=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},R$=[dE,Ko,uc],O$=e=>R$.find(t=>t.test(e));function cS(e){const t=O$(e);if(!t)return!1;let n=t.parse(e);return t===uc&&(n=I$(n)),n}const uS=(e,t)=>{const n=cS(e),r=cS(t);if(!n||!r)return Qm(e,t);const s={...n};return i=>(s.red=Yy(n.red,r.red,i),s.green=Yy(n.green,r.green,i),s.blue=Yy(n.blue,r.blue,i),s.alpha=Bn(n.alpha,r.alpha,i),Ko.transform(s))},L$=(e,t)=>n=>t(e(n)),sh=(...e)=>e.reduce(L$),gE=new Set(["none","hidden"]);function M$(e,t){return gE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function j$(e,t){return n=>Bn(e,t,n)}function fv(e){return typeof e=="number"?j$:typeof e=="string"?Yw(e)?Qm:Or.test(e)?uS:B$:Array.isArray(e)?VL:typeof e=="object"?Or.test(e)?uS:D$:Qm}function VL(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>fv(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function P$(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i{const n=fo.createTransformer(t),r=Tf(e),s=Tf(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?gE.has(e)&&!s.values.length||gE.has(t)&&!r.values.length?M$(e,t):sh(VL(P$(r,s),s.values),n):Qm(e,t)};function KL(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Bn(e,t,n):fv(e)(e,t)}const F$=5;function YL(e,t,n){const r=Math.max(t-F$,0);return mL(n-e(r),t-r)}const zn={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},Wy=.001;function U$({duration:e=zn.duration,bounce:t=zn.bounce,velocity:n=zn.velocity,mass:r=zn.mass}){let s,i,a=1-t;a=ba(zn.minDamping,zn.maxDamping,a),e=ba(zn.minDuration,zn.maxDuration,fa(e)),a<1?(s=u=>{const d=u*a,f=d*e,h=d-n,p=yE(u,a),m=Math.exp(-f);return Wy-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),g=yE(Math.pow(u,2),a);return(-s(u)+Wy>0?-1:1)*((h-p)*m)/g}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Wy+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=H$(s,i,l);if(e=da(e),isNaN(c))return{stiffness:zn.stiffness,damping:zn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const $$=12;function H$(e,t,n){let r=n;for(let s=1;s<$$;s++)r=r-e(r)/t(r);return r}function yE(e,t){return e*Math.sqrt(1-t*t)}const z$=["duration","bounce"],V$=["stiffness","damping","mass"];function dS(e,t){return t.some(n=>e[n]!==void 0)}function K$(e){let t={velocity:zn.velocity,stiffness:zn.stiffness,damping:zn.damping,mass:zn.mass,isResolvedFromDuration:!1,...e};if(!dS(e,V$)&&dS(e,z$))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ba(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:zn.mass,stiffness:s,damping:i}}else{const n=U$(e);t={...t,...n,mass:zn.mass},t.isResolvedFromDuration=!0}return t}function WL(e=zn.visualDuration,t=zn.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],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=K$({...n,velocity:-fa(n.velocity||0)}),m=h||0,g=u/(2*Math.sqrt(c*d)),w=a-i,y=fa(Math.sqrt(c/d)),b=Math.abs(w)<5;r||(r=b?zn.restSpeed.granular:zn.restSpeed.default),s||(s=b?zn.restDelta.granular:zn.restDelta.default);let x;if(g<1){const k=yE(y,g);x=N=>{const T=Math.exp(-g*y*N);return a-T*((m+g*y*w)/k*Math.sin(k*N)+w*Math.cos(k*N))}}else if(g===1)x=k=>a-Math.exp(-y*k)*(w+(m+y*w)*k);else{const k=y*Math.sqrt(g*g-1);x=N=>{const T=Math.exp(-g*y*N),S=Math.min(k*N,300);return a-T*((m+g*y*w)*Math.sinh(S)+k*w*Math.cosh(S))/k}}const _={calculatedDuration:p&&f||null,next:k=>{const N=x(k);if(p)l.done=k>=f;else{let T=0;g<1&&(T=k===0?da(m):YL(x,k,N));const S=Math.abs(T)<=r,R=Math.abs(a-N)<=s;l.done=S&&R}return l.value=l.done?a:N,l},toString:()=>{const k=Math.min(zL(_),mE),N=yL(T=>_.next(k*T).value,k,30);return k+"ms "+N}};return _}function fS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>l!==void 0&&Sc,m=S=>l===void 0?c:c===void 0||Math.abs(l-S)-g*Math.exp(-S/r),x=S=>y+b(S),_=S=>{const R=b(S),I=x(S);h.done=Math.abs(R)<=u,h.value=h.done?y:I};let k,N;const T=S=>{p(h.value)&&(k=S,N=WL({keyframes:[h.value,m(h.value)],velocity:YL(x,S,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:S=>{let R=!1;return!N&&k===void 0&&(R=!0,_(S),T(S)),k!==void 0&&S>=k?N.next(S-k):(!R&&_(S),h)}}}const Y$=rh(.42,0,1,1),W$=rh(0,0,.58,1),GL=rh(.42,0,.58,1),G$=e=>Array.isArray(e)&&typeof e[0]!="number",q$={linear:Es,easeIn:Y$,easeInOut:GL,easeOut:W$,circIn:ov,circInOut:TL,circOut:SL,backIn:av,backInOut:kL,backOut:_L,anticipate:NL},hS=e=>{if(iv(e)){WO(e.length===4);const[t,n,r,s]=e;return rh(t,n,r,s)}else if(typeof e=="string")return q$[e];return e};function X$(e,t,n){const r=[],s=n||KL,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 l=X$(t,r,s),c=l.length,u=d=>{if(a&&d1)for(;fu(ba(e[0],e[i-1],d)):u}function Z$(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Gc(0,t,r);e.push(Bn(n,1,s))}}function J$(e){const t=[0];return Z$(t,e.length-1),t}function e7(e,t){return e.map(n=>n*t)}function t7(e,t){return e.map(()=>t||GL).splice(0,e.length-1)}function Zm({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=G$(r)?r.map(hS):hS(r),i={done:!1,value:t[0]},a=e7(n&&n.length===t.length?n:J$(t),e),l=Q$(a,t,{ease:Array.isArray(s)?s:t7(t,s)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const n7=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_n.update(t,!0),stop:()=>uo(t),now:()=>kr.isProcessing?kr.timestamp:$i.now()}},r7={decay:fS,inertia:fS,tween:Zm,keyframes:Zm,spring:WL},s7=e=>e/100;class hv extends HL{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)||dv,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,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,l=sv(n)?n:r7[n]||Zm;let c,u;l!==Zm&&typeof t[0]!="number"&&(c=sh(s7,KL(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=zL(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:l,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:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,_=i;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,g&&(I-=g/f)):m==="mirror"&&(_=a)),x=ba(0,1,I)*f}const k=b?{done:!1,value:c[0]}:_.next(x);l&&(k.value=l(k.value));let{done:N}=k;!b&&u!==null&&(N=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return T&&s!==void 0&&(k.value=l0(c,this.options,s)),w&&w(k.value),T&&this.finish(),k}get duration(){const{resolved:t}=this;return t?fa(t.calculatedDuration):0}get time(){return fa(this.currentTime)}set time(t){t=da(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=fa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=n7,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 i7=new Set(["opacity","clipPath","filter","transform"]);function a7(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=EL(l,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 o7=rv(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jm=10,l7=2e4;function c7(e){return sv(e.type)||e.type==="spring"||!bL(e.ease)}function u7(e,t){const n=new hv({...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,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Xm()&&d7(i)&&(i=qL[i]),c7(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...g}=this.options,w=u7(t,g);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,a="keyframes"}const d=a7(l.owner.current,c,t,{...this.options,duration:r,times:s,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(nS(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(l0(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 fa(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return fa(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=da(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;nS(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:l}=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 hv({...p,keyframes:r,duration:s,type:i,ease:a,times:l,isGenerator:!0}),g=da(this.time);u.setWithVelocity(m.sample(g-Jm).value,m.sample(g).value,Jm)}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:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return o7()&&r&&i7.has(r)&&!c&&!u&&!s&&i!=="mirror"&&a!==0&&l!=="inertia"}}const f7={type:"spring",stiffness:500,damping:25,restSpeed:10},h7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),p7={type:"keyframes",duration:.8},m7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},g7=(e,{keyframes:t})=>t.length>2?p7:wl.has(e)?e.startsWith("scale")?h7(t[1]):f7:m7;function y7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const pv=(e,t,n,r={},s,i)=>a=>{const l=Jw(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-da(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};y7(l)||(d={...d,...g7(e,d)}),d.duration&&(d.duration=da(d.duration)),d.repeatDelay&&(d.repeatDelay=da(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=l0(d.keyframes,l);if(h!==void 0)return _n.update(()=>{d.onUpdate(h),d.onComplete()}),new qU([])}return!i&&pS.supports(d)?new pS(d):new hv(d)};function b7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function XL(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...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&&b7(d,f))continue;const m={delay:n,...Jw(a||{},f)};let g=!1;if(window.MotionHandoffAnimation){const y=gL(e);if(y){const b=window.MotionHandoffAnimation(y,f,_n);b!==null&&(m.startTime=b,g=!0)}}cE(e,f),h.start(pv(f,h,p,e.shouldReduceMotion&&pL.has(f)?{type:!1}:m,e,g));const w=h.animation;w&&u.push(w)}return l&&Promise.all(u).then(()=>{_n.update(()=>{l&&KU(e,l)})}),u}function bE(e,t,n={}){var r;const s=o0(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(XL(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=i;return E7(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function E7(e,t,n=0,r=0,s=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=s===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(x7).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(bE(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function x7(e,t){return e.sortNodePosition(t)}function w7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>bE(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=bE(e,t,n);else{const s=typeof t=="function"?o0(e,t,n.custom):t;r=Promise.all(XL(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const v7=$w.length;function QL(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?QL(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})=>w7(e,n,r)))}function S7(e){let t=N7(e),n=mS(),r=!0;const s=c=>(u,d)=>{var f;const h=o0(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=QL(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let w=0;wm&&_,R=!1;const I=Array.isArray(x)?x:[x];let j=I.reduce(s(y),{});k===!1&&(j={});const{prevResolvedValues:F={}}=b,Y={...F,...j},L=M=>{S=!0,h.has(M)&&(R=!0,h.delete(M)),b.needsAnimating[M]=!0;const O=e.getValue(M);O&&(O.liveStyle=!1)};for(const M in Y){const O=j[M],D=F[M];if(p.hasOwnProperty(M))continue;let A=!1;lE(O)&&lE(D)?A=!hL(O,D):A=O!==D,A?O!=null?L(M):h.add(M):O!==void 0&&h.has(M)?L(M):b.protectedKeys[M]=!0}b.prevProp=x,b.prevResolvedValues=j,b.isActive&&(p={...p,...j}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(N&&T)||R)&&f.push(...I.map(M=>({animation:M,options:{type:y}})))}if(h.size){const w={};h.forEach(y=>{const b=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),w[y]=b??null}),f.push({animation:w})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(f):Promise.resolve()}function l(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:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=mS(),r=!0}}}function T7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hL(t,e):!1}function Io(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mS(){return{animate:Io(!0),whileInView:Io(),whileHover:Io(),whileTap:Io(),whileDrag:Io(),whileFocus:Io(),exit:Io()}}class go{constructor(t){this.isMounted=!1,this.node=t}update(){}}class A7 extends go{constructor(t){super(t),t.animationState||(t.animationState=S7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();i0(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 C7=0;class I7 extends go{constructor(){super(...arguments),this.id=C7++}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 R7={animation:{Feature:A7},exit:{Feature:I7}},ai={x:!1,y:!1};function ZL(){return ai.x||ai.y}function O7(e){return e==="x"||e==="y"?ai[e]?null:(ai[e]=!0,()=>{ai[e]=!1}):ai.x||ai.y?null:(ai.x=ai.y=!0,()=>{ai.x=ai.y=!1})}const mv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Af(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ih(e){return{point:{x:e.pageX,y:e.pageY}}}const L7=e=>t=>mv(t)&&e(t,ih(t));function Fd(e,t,n,r){return Af(e,t,L7(n),r)}const gS=(e,t)=>Math.abs(e-t);function M7(e,t){const n=gS(e.x,t.x),r=gS(e.y,t.y);return Math.sqrt(n**2+r**2)}class JL{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=qy(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=M7(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:g}=kr;this.history.push({...m,timestamp:g});const{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Gy(h,this.transformPagePoint),_n.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qy(f.type==="pointercancel"?this.lastMoveEventInfo:Gy(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,w),m&&m(f,w)},!mv(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=ih(t),l=Gy(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=kr;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,qy(l,this.history)),this.removeListeners=sh(Fd(this.contextWindow,"pointermove",this.handlePointerMove),Fd(this.contextWindow,"pointerup",this.handlePointerUp),Fd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),uo(this.updatePoint)}}function Gy(e,t){return t?{point:t(e.point)}:e}function yS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qy({point:e},t){return{point:e,delta:yS(e,eM(t)),offset:yS(e,j7(t)),velocity:D7(t,.1)}}function j7(e){return e[0]}function eM(e){return e[e.length-1]}function D7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=eM(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>da(t)));)n--;if(!r)return{x:0,y:0};const i=fa(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 tM=1e-4,P7=1-tM,B7=1+tM,nM=.01,F7=0-nM,U7=0+nM;function _s(e){return e.max-e.min}function $7(e,t,n){return Math.abs(e-t)<=n}function bS(e,t,n,r=.5){e.origin=r,e.originPoint=Bn(t.min,t.max,e.origin),e.scale=_s(n)/_s(t),e.translate=Bn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=P7&&e.scale<=B7||isNaN(e.scale))&&(e.scale=1),(e.translate>=F7&&e.translate<=U7||isNaN(e.translate))&&(e.translate=0)}function Ud(e,t,n,r){bS(e.x,t.x,n.x,r?r.originX:void 0),bS(e.y,t.y,n.y,r?r.originY:void 0)}function ES(e,t,n){e.min=n.min+t.min,e.max=e.min+_s(t)}function H7(e,t,n){ES(e.x,t.x,n.x),ES(e.y,t.y,n.y)}function xS(e,t,n){e.min=t.min-n.min,e.max=e.min+_s(t)}function $d(e,t,n){xS(e.x,t.x,n.x),xS(e.y,t.y,n.y)}function z7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Bn(n,e,r.max):Math.min(e,n)),e}function wS(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 V7(e,{top:t,left:n,bottom:r,right:s}){return{x:wS(e.x,n,s),y:wS(e.y,t,r)}}function vS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Gc(t.min,t.max-r,e.min):r>s&&(n=Gc(e.min,e.max-s,t.min)),ba(0,1,n)}function W7(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 EE=.35;function G7(e=EE){return e===!1?e=0:e===!0&&(e=EE),{x:_S(e,"left","right"),y:_S(e,"top","bottom")}}function _S(e,t,n){return{min:kS(e,t),max:kS(e,n)}}function kS(e,t){return typeof e=="number"?e:e[t]||0}const NS=()=>({translate:0,scale:1,origin:0,originPoint:0}),dc=()=>({x:NS(),y:NS()}),SS=()=>({min:0,max:0}),qn=()=>({x:SS(),y:SS()});function Os(e){return[e("x"),e("y")]}function rM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function q7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function X7(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 Xy(e){return e===void 0||e===1}function xE({scale:e,scaleX:t,scaleY:n}){return!Xy(e)||!Xy(t)||!Xy(n)}function jo(e){return xE(e)||sM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sM(e){return TS(e.x)||TS(e.y)}function TS(e){return e&&e!=="0%"}function eg(e,t,n){const r=e-n,s=t*r;return n+s}function AS(e,t,n,r,s){return s!==void 0&&(e=eg(e,s,r)),eg(e,n,r)+t}function wE(e,t=0,n=1,r,s){e.min=AS(e.min,t,n,r,s),e.max=AS(e.max,t,n,r,s)}function iM(e,{x:t,y:n}){wE(e.x,t.translate,t.scale,t.originPoint),wE(e.y,n.translate,n.scale,n.originPoint)}const CS=.999999999999,IS=1.0000000000001;function Q7(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let l=0;lCS&&(t.x=1),t.yCS&&(t.y=1)}function fc(e,t){e.min=e.min+t,e.max=e.max+t}function RS(e,t,n,r,s=.5){const i=Bn(e.min,e.max,s);wE(e,t,n,i,r)}function hc(e,t){RS(e.x,t.x,t.scaleX,t.scale,t.originX),RS(e.y,t.y,t.scaleY,t.scale,t.originY)}function aM(e,t){return rM(X7(e.getBoundingClientRect(),t))}function Z7(e,t,n){const r=aM(e,n),{scroll:s}=t;return s&&(fc(r.x,s.offset.x),fc(r.y,s.offset.y)),r}const oM=({current:e})=>e?e.ownerDocument.defaultView:null,J7=new WeakMap;class eH{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=qn(),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(ih(d).point)},i=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=O7(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),Os(w=>{let y=this.getAxisMotionValue(w).get()||0;if(Ui.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[w];x&&(y=_s(x)*(parseFloat(y)/100))}}this.originPoint[w]=y}),m&&_n.postRender(()=>m(d,f)),cE(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(p&&this.currentDirection===null){this.currentDirection=tH(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),g&&g(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Os(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 JL(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:oM(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&&_n.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||!up(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=z7(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&&cc(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=V7(s.layoutBox,n):this.constraints=!1,this.elastic=G7(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Os(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=W7(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!cc(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=Z7(r,s.root,this.visualElement.getTransformPagePoint());let a=K7(s.layout.layoutBox,i);if(n){const l=n(q7(a));this.hasMutatedConstraints=!!l,l&&(a=rM(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Os(d=>{if(!up(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(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return cE(this.visualElement,t),r.start(pv(t,r,0,n,this.visualElement,!1))}stopAnimation(){Os(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Os(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){Os(n=>{const{drag:r}=this.getProps();if(!up(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n];i.set(t[n]-Bn(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!cc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Os(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=Y7({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(),Os(a=>{if(!up(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Bn(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;J7.set(this.visualElement,this);const t=this.visualElement.current,n=Fd(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();cc(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()),_n.read(r);const a=Af(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Os(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(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=EE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function up(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tH(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class nH extends go{constructor(t){super(t),this.removeGroupControls=Es,this.removeListeners=Es,this.controls=new eH(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 OS=e=>(t,n)=>{e&&_n.postRender(()=>e(t,n))};class rH extends go{constructor(){super(...arguments),this.removePointerDownListener=Es}onPointerDown(t){this.session=new JL(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:OS(t),onStart:OS(n),onMove:r,onEnd:(i,a)=>{delete this.session,s&&_n.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Fd(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 sm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function LS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ju={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(lt.test(e))e=parseFloat(e);else return e;const n=LS(e,t.target.x),r=LS(e,t.target.y);return`${n}% ${r}%`}},sH={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=fo.parse(e);if(s.length>5)return r;const i=fo.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=Bn(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}};class iH extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;RU(aH),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()})),sm.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()||_n.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zw.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 lM(e){const[t,n]=KO(),r=E.useContext(Bw);return o.jsx(iH,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(eL),isPresent:t,safeToRemove:n})}const aH={borderRadius:{...Ju,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ju,borderTopRightRadius:Ju,borderBottomLeftRadius:Ju,borderBottomRightRadius:Ju,boxShadow:sH};function oH(e,t,n){const r=Mr(e)?e:Sf(e);return r.start(pv("",r,t,n)),r.animation}function lH(e){return e instanceof SVGElement&&e.tagName!=="svg"}const cH=(e,t)=>e.depth-t.depth;class uH{constructor(){this.children=[],this.isDirty=!1}add(t){ev(this.children,t),this.isDirty=!0}remove(t){tv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(cH),this.isDirty=!1,this.children.forEach(t)}}function dH(e,t){const n=$i.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(uo(r),e(i-t))};return _n.read(r,!0),()=>uo(r)}const cM=["TopLeft","TopRight","BottomLeft","BottomRight"],fH=cM.length,MS=e=>typeof e=="string"?parseFloat(e):e,jS=e=>typeof e=="number"||lt.test(e);function hH(e,t,n,r,s,i){s?(e.opacity=Bn(0,n.opacity!==void 0?n.opacity:1,pH(r)),e.opacityExit=Bn(t.opacity!==void 0?t.opacity:1,0,mH(r))):i&&(e.opacity=Bn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Gc(e,t,r))}function PS(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){PS(e.x,t.x),PS(e.y,t.y)}function BS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function FS(e,t,n,r,s){return e-=t,e=eg(e,1/n,r),s!==void 0&&(e=eg(e,1/s,r)),e}function gH(e,t=0,n=1,r=.5,s,i=e,a=e){if(Ui.test(t)&&(t=parseFloat(t),t=Bn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Bn(i.min,i.max,r);e===i&&(l-=t),e.min=FS(e.min,t,n,l,s),e.max=FS(e.max,t,n,l,s)}function US(e,t,[n,r,s],i,a){gH(e,t[n],t[r],t[s],t.scale,i,a)}const yH=["x","scaleX","originX"],bH=["y","scaleY","originY"];function $S(e,t,n,r){US(e.x,t,yH,n?n.x:void 0,r?r.x:void 0),US(e.y,t,bH,n?n.y:void 0,r?r.y:void 0)}function HS(e){return e.translate===0&&e.scale===1}function dM(e){return HS(e.x)&&HS(e.y)}function zS(e,t){return e.min===t.min&&e.max===t.max}function EH(e,t){return zS(e.x,t.x)&&zS(e.y,t.y)}function VS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fM(e,t){return VS(e.x,t.x)&&VS(e.y,t.y)}function KS(e){return _s(e.x)/_s(e.y)}function YS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class xH{constructor(){this.members=[]}add(t){ev(this.members,t),t.scheduleRender()}remove(t){if(tv(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 wH(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 l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Do={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ed=typeof window<"u"&&window.MotionDebug!==void 0,Qy=["","X","Y","Z"],vH={visibility:"hidden"},WS=1e3;let _H=0;function Zy(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=gL(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_n,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hM(r)}function pM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=_H++,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,Ed&&(Do.totalNodes=Do.resolvedTargetDeltas=Do.recalculatedProjection=0),this.nodes.forEach(SH),this.nodes.forEach(RH),this.nodes.forEach(OH),this.nodes.forEach(TH),Ed&&window.MotionDebug.record(Do)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=dH(h,250),sm.hasAnimatedSinceResize&&(sm.hasAnimatedSinceResize=!1,this.nodes.forEach(qS))})}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 g=this.options.transition||d.getDefaultTransition()||PH,{onLayoutAnimationStart:w,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!fM(this.targetLayout,m)||p,x=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const _={...Jw(g,"layout"),onPlay:w,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||qS(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,uo(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(LH),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&&hM(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;XS(f.x,a.x,k),XS(f.y,a.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jH(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&EH(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=qn()),Rs(x,this.relativeTarget)),g&&(this.animationValues=d,hH(d,u,this.latestValues,k,b,y)),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&&(uo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_n.update(()=>{sm.hasAnimatedSinceResize=!0,this.currentAnimation=oH(0,WS,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},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(WS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&mM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||qn();const f=_s(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=_s(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Rs(l,c),hc(l,d),Ud(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new xH),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(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:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Zy("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(GS),this.root.sharedNodes.clear()}}}function kH(e){e.updateLayout()}function NH(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"?Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(h);h.min=r[f].min,h.max=h.min+p}):mM(i,n.layoutBox,r)&&Os(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=_s(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=dc();Ud(l,r,n.layoutBox);const c=dc();a?Ud(c,e.applyTransform(s,!0),n.measuredBox):Ud(c,r,n.layoutBox);const u=!dM(l);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=qn();$d(m,n.layoutBox,h.layoutBox);const g=qn();$d(g,r,p.layoutBox),fM(m,g)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function SH(e){Ed&&Do.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 TH(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AH(e){e.clearSnapshot()}function GS(e){e.clearMeasurements()}function CH(e){e.isLayoutDirty=!1}function IH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function RH(e){e.resolveTargetDelta()}function OH(e){e.calcProjection()}function LH(e){e.resetSkewAndRotation()}function MH(e){e.removeLeadSnapshot()}function XS(e,t,n){e.translate=Bn(t.translate,0,n),e.scale=Bn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QS(e,t,n,r){e.min=Bn(t.min,n.min,r),e.max=Bn(t.max,n.max,r)}function jH(e,t,n,r){QS(e.x,t.x,n.x,r),QS(e.y,t.y,n.y,r)}function DH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const PH={duration:.45,ease:[.4,0,.1,1]},ZS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JS=ZS("applewebkit/")&&!ZS("chrome/")?Math.round:Es;function eT(e){e.min=JS(e.min),e.max=JS(e.max)}function BH(e){eT(e.x),eT(e.y)}function mM(e,t,n){return e==="position"||e==="preserve-aspect"&&!$7(KS(t),KS(n),.2)}function FH(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const UH=pM({attachResizeListener:(e,t)=>Af(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jy={current:void 0},gM=pM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Jy.current){const e=new UH({});e.mount(window),e.setOptions({layoutScroll:!0}),Jy.current=e}return Jy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),$H={pan:{Feature:rH},drag:{Feature:nH,ProjectionNode:gM,MeasureLayout:lM}};function HH(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 yM(e,t){const n=HH(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function tT(e){return t=>{t.pointerType==="touch"||ZL()||e(t)}}function zH(e,t,n={}){const[r,s,i]=yM(e,n),a=tT(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=tT(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,s)});return r.forEach(l=>{l.addEventListener("pointerenter",a,s)}),i}function nT(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&&_n.postRender(()=>i(t,ih(t)))}class VH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=zH(t,n=>(nT(this.node,n,"Start"),r=>nT(this.node,r,"End"))))}unmount(){}}class KH extends go{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=sh(Af(this.node.current,"focus",()=>this.onFocus()),Af(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const bM=(e,t)=>t?e===t?!0:bM(e,t.parentElement):!1,YH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WH(e){return YH.has(e.tagName)||e.tabIndex!==-1}const xd=new WeakSet;function rT(e){return t=>{t.key==="Enter"&&e(t)}}function eb(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const GH=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=rT(()=>{if(xd.has(n))return;eb(n,"down");const s=rT(()=>{eb(n,"up")}),i=()=>eb(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 sT(e){return mv(e)&&!ZL()}function qH(e,t,n={}){const[r,s,i]=yM(e,n),a=l=>{const c=l.currentTarget;if(!sT(l)||xd.has(c))return;xd.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!sT(p)||!xd.has(c))&&(xd.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||bM(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(l=>{!WH(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),l.addEventListener("focus",u=>GH(u,s),s)}),i}function iT(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&&_n.postRender(()=>i(t,ih(t)))}class XH extends go{mount(){const{current:t}=this.node;t&&(this.unmount=qH(t,n=>(iT(this.node,n,"Start"),(r,{success:s})=>iT(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const vE=new WeakMap,tb=new WeakMap,QH=e=>{const t=vE.get(e.target);t&&t(e)},ZH=e=>{e.forEach(QH)};function JH({root:e,...t}){const n=e||document;tb.has(n)||tb.set(n,{});const r=tb.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(ZH,{root:e,...t})),r[s]}function ez(e,t,n){const r=JH(t);return vE.set(e,n),r.observe(e),()=>{vE.delete(e),r.unobserve(e)}}const tz={some:0,all:1};class nz extends go{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:tz[s]},l=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 ez(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(rz(t,n))&&this.startObserver()}unmount(){}}function rz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sz={inView:{Feature:nz},tap:{Feature:XH},focus:{Feature:KH},hover:{Feature:VH}},iz={layout:{ProjectionNode:gM,MeasureLayout:lM}},_E={current:null},EM={current:!1};function az(){if(EM.current=!0,!!Fw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_E.current=e.matches;e.addListener(t),t()}else _E.current=!1}const oz=[...UL,Or,fo],lz=e=>oz.find(FL(e)),aT=new WeakMap;function cz(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Mr(s))e.addValue(r,s);else if(Mr(i))e.addValue(r,Sf(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,Sf(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uz{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=dv,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=$i.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),EM.current||az(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_E.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aT.delete(this.current),this.projection&&this.projection.unmount(),uo(this.notifyUpdate),uo(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=wl.has(t),s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&_n.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 Wc){const n=Wc[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):qn()}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=Sf(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"&&(PL(s)||AL(s))?s=parseFloat(s):!lz(s)&&fo.test(n)&&(s=ML(t,n)),this.setBaseTarget(t,Mr(s)?s.get():s)),Mr(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=Kw(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&&!Mr(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 nv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class xM extends uz{constructor(){super(...arguments),this.KeyframeResolver=$L}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;Mr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dz(e){return window.getComputedStyle(e)}class fz extends xM{constructor(){super(...arguments),this.type="html",this.renderInstance=oL}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}else{const r=dz(t),s=(sL(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return aM(t,n)}build(t,n,r){Gw(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zw(t,n,r)}}class hz extends xM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wl.has(n)){const r=uv(n);return r&&r.default||0}return n=lL.has(n)?n:Hw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return dL(t,n,r)}build(t,n,r){qw(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){cL(t,n,r,s)}mount(t){this.isSVGTag=Qw(t.tagName),super.mount(t)}}const pz=(e,t)=>Vw(e)?new hz(t):new fz(t,{allowProjection:e!==E.Fragment}),mz=UU({...R7,...sz,...$H,...iz},pz),nn=tU(mz);function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?E.useEffect:E.useLayoutEffect;function Kl(e,t,n){var r=E.useRef(t);r.current=t,E.useEffect(function(){function s(i){r.current(i)}return e&&window.addEventListener(e,s,n),function(){e&&window.removeEventListener(e,s)}},[e])}var gz=["container"];function yz(e){var t=e.container,n=t===void 0?document.body:t,r=c0(e,gz);return vs.createPortal(kt.createElement("div",fr({},r)),n)}function bz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 Ez(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.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 xz(e){return kt.createElement("svg",fr({width:"44",height:"44",viewBox:"0 0 768 768"},e),kt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function wz(){return E.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function cT(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 Ha=function(e,t,n,r){var s,i=n*t,a=(i-r)/2,l=e;return i<=r?(s=1,l=0):e>0&&a-e<=0?(s=2,l=a):e<0&&a+e<=0&&(s=3,l=-a),[s,l]};function nb(e,t,n,r,s,i,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Ha(e,i,n,innerWidth)[0],f=Ha(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:l-i/s*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function SE(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function rb(e,t,n){var r=SE(n,innerWidth,innerHeight),s=r[0],i=r[1],a=0,l=s,c=i,u=e/t*i,d=t/e*s;return e=i?l=u:e>=s&&ts/i?c=d:t/e>=3&&!r[2]?a=((c=d)-i)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function fp(e,t){var n=t.leading,r=n!==void 0&&n,s=t.maxWait,i=t.wait,a=i===void 0?s||0:i,l=E.useRef(e);l.current=e;var c=E.useRef(0),u=E.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=E.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var g=c.current,w=p-g;if(g===0&&(r&&m(),c.current=p),s!==void 0){if(w>s)return void m()}else w=1&&i&&i())};d()}function d(){c=requestAnimationFrame(u)}}var _z={T:0,L:0,W:0,H:0,FIT:void 0},vM=function(){var e=E.useRef(!1);return E.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},kz=["className"];function Nz(e){var t=e.className,n=t===void 0?"":t,r=c0(e,kz);return kt.createElement("div",fr({className:"PhotoView__Spinner "+n},r),kt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},kt.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"}),kt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var Sz=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Tz(e){var t=e.src,n=e.loaded,r=e.broken,s=e.className,i=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=c0(e,Sz),u=vM();return t&&!r?kt.createElement(kt.Fragment,null,kt.createElement("img",fr({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?kt.createElement("span",{className:"PhotoView__icon"},a):kt.createElement(Nz,{className:"PhotoView__icon"}))):l?kt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var Az={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 Cz(e){var t=e.item,n=t.src,r=t.render,s=t.width,i=s===void 0?0:s,a=t.height,l=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,g=e.loadingElement,w=e.brokenElement,y=e.onPhotoTap,b=e.onMaskTap,x=e.onReachMove,_=e.onReachUp,k=e.onPhotoResize,N=e.isActive,T=e.expose,S=tg(Az),R=S[0],I=S[1],j=E.useRef(0),F=vM(),Y=R.naturalWidth,L=Y===void 0?i:Y,U=R.naturalHeight,C=U===void 0?l:U,M=R.width,O=M===void 0?i:M,D=R.height,A=D===void 0?l:D,H=R.loaded,W=H===void 0?!n:H,P=R.broken,te=R.x,X=R.y,ne=R.touched,ce=R.stopRaf,J=R.maskTouched,fe=R.rotate,ee=R.scale,Ee=R.CX,ge=R.CY,xe=R.lastX,we=R.lastY,Ae=R.lastCX,Re=R.lastCY,Ye=R.lastScale,Le=R.touchTime,bt=R.touchLength,Ze=R.pause,ze=R.reach,le=Jo({onScale:function(pe){return ve(dp(pe))},onRotate:function(pe){fe!==pe&&(T({rotate:pe}),I(fr({rotate:pe},rb(L,C,pe))))}});function ve(pe,Je,at){ee!==pe&&(T({scale:pe}),I(fr({scale:pe},nb(te,X,O,A,ee,pe,Je,at),pe<=1&&{x:0,y:0})))}var ct=fp(function(pe,Je,at){if(at===void 0&&(at=0),(ne||J)&&N){var dn=SE(fe,O,A),an=dn[0],pt=dn[1];if(at===0&&j.current===0){var Lt=Math.abs(pe-Ee)<=20,on=Math.abs(Je-ge)<=20;if(Lt&&on)return void I({lastCX:pe,lastCY:Je});j.current=Lt?Je>ge?3:2:1}var On,lr=pe-Ae,fn=Je-Re;if(at===0){var Bt=Ha(lr+xe,ee,an,innerWidth)[0],Kn=Ha(fn+we,ee,pt,innerHeight);On=function(Te,Ce,Qe,ot){return Ce&&Te===1||ot==="x"?"x":Qe&&Te>1||ot==="y"?"y":void 0}(j.current,Bt,Kn[0],ze),On!==void 0&&x(On,pe,Je,ee)}if(On==="x"||J)return void I({reach:"x"});var ue=dp(ee+(at-bt)/100/2*ee,L/O,.2);T({scale:ue}),I(fr({touchLength:at,reach:On,scale:ue},nb(te,X,O,A,ee,ue,pe,Je,lr,fn)))}},{maxWait:8});function ht(pe){return!ce&&!ne&&(F.current&&I(fr({},pe,{pause:u})),F.current)}var G,Z,he,De,qe,nt,Kt,Et,Pt=(qe=function(pe){return ht({x:pe})},nt=function(pe){return ht({y:pe})},Kt=function(pe){return F.current&&(T({scale:pe}),I({scale:pe})),!ne&&F.current},Et=Jo({X:function(pe){return qe(pe)},Y:function(pe){return nt(pe)},S:function(pe){return Kt(pe)}}),function(pe,Je,at,dn,an,pt,Lt,on,On,lr,fn){var Bt=SE(lr,an,pt),Kn=Bt[0],ue=Bt[1],Te=Ha(pe,on,Kn,innerWidth),Ce=Te[0],Qe=Te[1],ot=Ha(Je,on,ue,innerHeight),et=ot[0],Ct=ot[1],Wt=Date.now()-fn;if(Wt>=200||on!==Lt||Math.abs(On-Lt)>1){var oe=nb(pe,Je,an,pt,Lt,on),be=oe.x,dt=oe.y,Ve=Ce?Qe:be!==pe?be:null,Ke=et?Ct:dt!==Je?dt:null;return Ve!==null&&Fo(pe,Ve,Et.X),Ke!==null&&Fo(Je,Ke,Et.Y),void(on!==Lt&&Fo(Lt,on,Et.S))}var ft=(pe-at)/Wt,Gt=(Je-dn)/Wt,cr=Math.sqrt(Math.pow(ft,2)+Math.pow(Gt,2)),Yn=!1,hn=!1;(function(Ln,Ht){var Jt,Ot=Ln,kn=0,Nn=0,en=function(pr){Jt||(Jt=pr);var nr=pr-Jt,Si=Math.sign(Ln),Xs=-.001*Si,Zr=Math.sign(-Ot)*Math.pow(Ot,2)*2e-4,wr=Ot*nr+(Xs+Zr)*Math.pow(nr,2)/2;kn+=wr,Jt=pr,Si*(Ot+=(Xs+Zr)*nr)<=0?Wn():Ht(kn)?tr():Wn()};function tr(){Nn=requestAnimationFrame(en)}function Wn(){cancelAnimationFrame(Nn)}tr()})(cr,function(Ln){var Ht=pe+Ln*(ft/cr),Jt=Je+Ln*(Gt/cr),Ot=Ha(Ht,Lt,Kn,innerWidth),kn=Ot[0],Nn=Ot[1],en=Ha(Jt,Lt,ue,innerHeight),tr=en[0],Wn=en[1];if(kn&&!Yn&&(Yn=!0,Ce?Fo(Ht,Nn,Et.X):uT(Nn,Ht+(Ht-Nn),Et.X)),tr&&!hn&&(hn=!0,et?Fo(Jt,Wn,Et.Y):uT(Wn,Jt+(Jt-Wn),Et.Y)),Yn&&hn)return!1;var pr=Yn||Et.X(Nn),nr=hn||Et.Y(Wn);return pr&&nr})}),Yt=(G=y,Z=function(pe,Je){ze||ve(ee!==1?1:Math.max(2,L/O),pe,Je)},he=E.useRef(0),De=fp(function(){he.current=0,G.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var pe=[].slice.call(arguments);he.current+=1,De.apply(void 0,pe),he.current>=2&&(De.cancel(),he.current=0,Z.apply(void 0,pe))});function Nt(pe,Je){if(j.current=0,(ne||J)&&N){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var at=dp(ee,L/O);if(Pt(te,X,xe,we,O,A,ee,at,Ye,fe,Le),_(pe,Je),Ee===pe&&ge===Je){if(ne)return void Yt(pe,Je);J&&b(pe,Je)}}}function rn(pe,Je,at){at===void 0&&(at=0),I({touched:!0,CX:pe,CY:Je,lastCX:pe,lastCY:Je,lastX:te,lastY:X,lastScale:ee,touchLength:at,touchTime:Date.now()})}function sn(pe){I({maskTouched:!0,CX:pe.clientX,CY:pe.clientY,lastX:te,lastY:X})}Kl(na?void 0:"mousemove",function(pe){pe.preventDefault(),ct(pe.clientX,pe.clientY)}),Kl(na?void 0:"mouseup",function(pe){Nt(pe.clientX,pe.clientY)}),Kl(na?"touchmove":void 0,function(pe){pe.preventDefault();var Je=cT(pe);ct.apply(void 0,Je)},{passive:!1}),Kl(na?"touchend":void 0,function(pe){var Je=pe.changedTouches[0];Nt(Je.clientX,Je.clientY)},{passive:!1}),Kl("resize",fp(function(){W&&!ne&&(I(rb(L,C,fe)),k())},{maxWait:8})),NE(function(){N&&T(fr({scale:ee,rotate:fe},le))},[N]);var _t=function(pe,Je,at,dn,an,pt,Lt,on,On,lr){var fn=function(be,dt,Ve,Ke,ft){var Gt=E.useRef(!1),cr=tg({lead:!0,scale:Ve}),Yn=cr[0],hn=Yn.lead,Ln=Yn.scale,Ht=cr[1],Jt=fp(function(Ot){try{return ft(!0),Ht({lead:!1,scale:Ot}),Promise.resolve()}catch(kn){return Promise.reject(kn)}},{wait:Ke});return NE(function(){Gt.current?(ft(!1),Ht({lead:!0}),Jt(Ve)):Gt.current=!0},[Ve]),hn?[be*Ln,dt*Ln,Ve/Ln]:[be*Ve,dt*Ve,1]}(pt,Lt,on,On,lr),Bt=fn[0],Kn=fn[1],ue=fn[2],Te=function(be,dt,Ve,Ke,ft){var Gt=E.useState(_z),cr=Gt[0],Yn=Gt[1],hn=E.useState(0),Ln=hn[0],Ht=hn[1],Jt=E.useRef(),Ot=Jo({OK:function(){return be&&Ht(4)}});function kn(Nn){ft(!1),Ht(Nn)}return E.useEffect(function(){if(Jt.current||(Jt.current=Date.now()),Ve){if(function(Nn,en){var tr=Nn&&Nn.current;if(tr&&tr.nodeType===1){var Wn=tr.getBoundingClientRect();en({T:Wn.top,L:Wn.left,W:Wn.width,H:Wn.height,FIT:tr.tagName==="IMG"?getComputedStyle(tr).objectFit:void 0})}}(dt,Yn),be)return Date.now()-Jt.current<250?(Ht(1),requestAnimationFrame(function(){Ht(2),requestAnimationFrame(function(){return kn(3)})}),void setTimeout(Ot.OK,Ke)):void Ht(4);kn(5)}},[be,Ve]),[Ln,cr]}(pe,Je,at,On,lr),Ce=Te[0],Qe=Te[1],ot=Qe.W,et=Qe.FIT,Ct=innerWidth/2,Wt=innerHeight/2,oe=Ce<3||Ce>4;return[oe?ot?Qe.L:Ct:dn+(Ct-pt*on/2),oe?ot?Qe.T:Wt:an+(Wt-Lt*on/2),Bt,oe&&et?Bt*(Qe.H/ot):Kn,Ce===0?ue:oe?ot/(pt*on)||.01:ue,oe?et?1:0:1,Ce,et]}(u,c,W,te,X,O,A,ee,d,function(pe){return I({pause:pe})}),rt=_t[4],Oe=_t[6],gt="transform "+d+"ms "+f,Se={className:p,onMouseDown:na?void 0:function(pe){pe.stopPropagation(),pe.button===0&&rn(pe.clientX,pe.clientY,0)},onTouchStart:na?function(pe){pe.stopPropagation(),rn.apply(void 0,cT(pe))}:void 0,onWheel:function(pe){if(!ze){var Je=dp(ee-pe.deltaY/100/2,L/O);I({stopRaf:!0}),ve(Je,pe.clientX,pe.clientY)}},style:{width:_t[2]+"px",height:_t[3]+"px",opacity:_t[5],objectFit:Oe===4?void 0:_t[7],transform:fe?"rotate("+fe+"deg)":void 0,transition:Oe>2?gt+", opacity "+d+"ms ease, height "+(Oe<4?d/2:Oe>4?d:0)+"ms "+f:void 0}};return kt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!na&&N?sn:void 0,onTouchStart:na&&N?function(pe){return sn(pe.touches[0])}:void 0},kt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+rt+", 0, 0, "+rt+", "+_t[0]+", "+_t[1]+")",transition:ne||Ze?void 0:gt,willChange:N?"transform":void 0}},n?kt.createElement(Tz,fr({src:n,loaded:W,broken:P},Se,{onPhotoLoad:function(pe){I(fr({},pe,pe.loaded&&rb(pe.naturalWidth||0,pe.naturalHeight||0,fe)))},loadingElement:g,brokenElement:w})):r&&r({attrs:Se,scale:rt,rotate:fe})))}var dT={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 Iz(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,s=e.easing,i=e.photoClosable,a=e.maskClosable,l=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,g=e.toolbarRender,w=e.className,y=e.maskClassName,b=e.photoClassName,x=e.photoWrapClassName,_=e.loadingElement,k=e.brokenElement,N=e.images,T=e.index,S=T===void 0?0:T,R=e.onIndexChange,I=e.visible,j=e.onClose,F=e.afterClose,Y=e.portalContainer,L=tg(dT),U=L[0],C=L[1],M=E.useState(0),O=M[0],D=M[1],A=U.x,H=U.touched,W=U.pause,P=U.lastCX,te=U.lastCY,X=U.bg,ne=X===void 0?u:X,ce=U.lastBg,J=U.overlay,fe=U.minimal,ee=U.scale,Ee=U.rotate,ge=U.onScale,xe=U.onRotate,we=e.hasOwnProperty("index"),Ae=we?S:O,Re=we?R:D,Ye=E.useRef(Ae),Le=N.length,bt=N[Ae],Ze=typeof n=="boolean"?n:Le>n,ze=function(rt,Oe){var gt=E.useReducer(function(at){return!at},!1)[1],Se=E.useRef(0),pe=function(at){var dn=E.useRef(at);function an(pt){dn.current=pt}return E.useMemo(function(){(function(pt){rt?(pt(rt),Se.current=1):Se.current=2})(an)},[at]),[dn.current,an]}(rt),Je=pe[1];return[pe[0],Se.current,function(){gt(),Se.current===2&&(Je(!1),Oe&&Oe()),Se.current=0}]}(I,F),le=ze[0],ve=ze[1],ct=ze[2];NE(function(){if(le)return C({pause:!0,x:Ae*-(innerWidth+Pl)}),void(Ye.current=Ae);C(dT)},[le]);var ht=Jo({close:function(rt){xe&&xe(0),C({overlay:!0,lastBg:ne}),j(rt)},changeIndex:function(rt,Oe){Oe===void 0&&(Oe=!1);var gt=Ze?Ye.current+(rt-Ae):rt,Se=Le-1,pe=kE(gt,0,Se),Je=Ze?gt:pe,at=innerWidth+Pl;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-at*Je,pause:Oe}),Ye.current=Je,Re&&Re(Ze?rt<0?Se:rt>Se?0:rt:pe)}}),G=ht.close,Z=ht.changeIndex;function he(rt){return rt?G():C({overlay:!J})}function De(){C({x:-(innerWidth+Pl)*Ae,lastCX:void 0,lastCY:void 0,pause:!0}),Ye.current=Ae}function qe(rt,Oe,gt,Se){rt==="x"?function(pe){if(P!==void 0){var Je=pe-P,at=Je;!Ze&&(Ae===0&&Je>0||Ae===Le-1&&Je<0)&&(at=Je/2),C({touched:!0,lastCX:P,x:-(innerWidth+Pl)*Ye.current+at,pause:!1})}else C({touched:!0,lastCX:pe,x:A,pause:!1})}(Oe):rt==="y"&&function(pe,Je){if(te!==void 0){var at=u===null?null:kE(u,.01,u-Math.abs(pe-te)/100/4);C({touched:!0,lastCY:te,bg:Je===1?at:u,minimal:Je===1})}else C({touched:!0,lastCY:pe,bg:ne,minimal:!0})}(gt,Se)}function nt(rt,Oe){var gt=rt-(P??rt),Se=Oe-(te??Oe),pe=!1;if(gt<-40)Z(Ae+1);else if(gt>40)Z(Ae-1);else{var Je=-(innerWidth+Pl)*Ye.current;Math.abs(Se)>100&&fe&&f&&(pe=!0,G()),C({touched:!1,x:Je,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!pe||J})}}Kl("keydown",function(rt){if(I)switch(rt.key){case"ArrowLeft":Z(Ae-1,!0);break;case"ArrowRight":Z(Ae+1,!0);break;case"Escape":G()}});var Kt=function(rt,Oe,gt){return E.useMemo(function(){var Se=rt.length;return gt?rt.concat(rt).concat(rt).slice(Se+Oe-1,Se+Oe+2):rt.slice(Math.max(Oe-1,0),Math.min(Oe+2,Se+1))},[rt,Oe,gt])}(N,Ae,Ze);if(!le)return null;var Et=J&&!ve,Pt=I?ne:ce,Yt=ge&&xe&&{images:N,index:Ae,visible:I,onClose:G,onIndexChange:Z,overlayVisible:Et,overlay:bt&&bt.overlay,scale:ee,rotate:Ee,onScale:ge,onRotate:xe},Nt=r?r(ve):400,rn=s?s(ve):lT,sn=r?r(3):600,_t=s?s(3):lT;return kt.createElement(yz,{className:"PhotoView-Portal"+(Et?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(w?" "+w:""),role:"dialog",onClick:function(rt){return rt.stopPropagation()},container:Y},I&&kt.createElement(wz,null),kt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(ve===1?" PhotoView-Slider__fadeIn":ve===2?" PhotoView-Slider__fadeOut":""),style:{background:Pt?"rgba(0, 0, 0, "+Pt+")":void 0,transitionTimingFunction:rn,transitionDuration:(H?0:Nt)+"ms",animationDuration:Nt+"ms"},onAnimationEnd:ct}),p&&kt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},kt.createElement("div",{className:"PhotoView-Slider__Counter"},Ae+1," / ",Le),kt.createElement("div",{className:"PhotoView-Slider__BannerRight"},g&&Yt&&g(Yt),kt.createElement(bz,{className:"PhotoView-Slider__toolbarIcon",onClick:G}))),Kt.map(function(rt,Oe){var gt=Ze||Ae!==0?Ye.current-1+Oe:Ae+Oe;return kt.createElement(Cz,{key:Ze?rt.key+"/"+rt.src+"/"+gt:rt.key,item:rt,speed:Nt,easing:rn,visible:I,onReachMove:qe,onReachUp:nt,onPhotoTap:function(){return he(i)},onMaskTap:function(){return he(l)},wrapClassName:x,className:b,style:{left:(innerWidth+Pl)*gt+"px",transform:"translate3d("+A+"px, 0px, 0)",transition:H||W?void 0:"transform "+sn+"ms "+_t},loadingElement:_,brokenElement:k,onPhotoResize:De,isActive:Ye.current===gt,expose:C})}),!na&&p&&kt.createElement(kt.Fragment,null,(Ze||Ae!==0)&&kt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return Z(Ae-1,!0)}},kt.createElement(Ez,null)),(Ze||Ae+1-1){var y=u.slice();return y.splice(w,1,g),void l({images:y})}l(function(b){return{images:b.images.concat(g)}})},remove:function(g){l(function(w){var y=w.images.filter(function(b){return b.key!==g});return{images:y,index:Math.min(y.length-1,f)}})},show:function(g){var w=u.findIndex(function(y){return y.key===g});l({visible:!0,index:w}),r&&r(!0,w,a)}}),p=Jo({close:function(){l({visible:!1}),r&&r(!1,f,a)},changeIndex:function(g){l({index:g}),n&&n(g,a)}}),m=E.useMemo(function(){return fr({},a,h)},[a,h]);return kt.createElement(wM.Provider,{value:m},t,kt.createElement(Iz,fr({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},s)))}var _M=function(e){var t,n,r=e.src,s=e.render,i=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=E.useContext(wM),h=(t=function(){return f.nextId()},(n=E.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=E.useRef(null);E.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),E.useEffect(function(){return function(){f.remove(h)}},[]);var m=Jo({render:function(w){return s&&s(w)},show:function(w,y){f.show(h),function(b,x){if(d){var _=d.props[b];_&&_(x)}}(w,y)}}),g=E.useMemo(function(){var w={};return u.forEach(function(y){w[y]=m.show.bind(null,y)}),w},[]);return E.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:i,width:a,height:l})},[r]),d?E.Children.only(E.cloneElement(d,fr({},g,{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 Lz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const Mz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kM=(...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 Mz={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var jz={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 jz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...Mz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kM("lucide",s),...l},[...a.map(([u,d])=>E.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** + */const Dz=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>E.createElement("svg",{ref:c,...jz,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kM("lucide",s),...l},[...a.map(([u,d])=>E.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 Pe=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(jz,{ref:i,iconNode:t,className:kM(`lucide-${Lz(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + */const Pe=(e,t)=>{const n=E.forwardRef(({className:r,...s},i)=>E.createElement(Dz,{ref:i,iconNode:t,className:kM(`lucide-${Mz(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 Dz=Pe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const Pz=Pe("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 Pz=Pe("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** + */const Bz=Pe("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -106,7 +106,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bz=Pe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const Fz=Pe("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. @@ -121,12 +121,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fz=Pe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const Uz=Pe("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 Uz=Pe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const $z=Pe("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. @@ -141,7 +141,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $z=Pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const Hz=Pe("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. @@ -166,7 +166,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hz=Pe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const zz=Pe("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. @@ -181,12 +181,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zz=Pe("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const Vz=Pe("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 Vz=Pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const Kz=Pe("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. @@ -201,7 +201,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kz=Pe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const Yz=Pe("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. @@ -211,7 +211,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yz=Pe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const Wz=Pe("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. @@ -221,7 +221,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wz=Pe("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"}]]);/** + */const Gz=Pe("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. @@ -231,12 +231,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gz=Pe("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const qz=Pe("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 qz=Pe("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const Xz=Pe("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. @@ -246,7 +246,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xz=Pe("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const Qz=Pe("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. @@ -256,17 +256,17 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qz=Pe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const Zz=Pe("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 Zz=Pe("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"}]]);/** + */const Jz=Pe("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 Jz=Pe("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/** + */const eV=Pe("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. @@ -281,12 +281,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eV=Pe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const tV=Pe("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 tV=Pe("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const nV=Pe("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. @@ -296,12 +296,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nV=Pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + */const rV=Pe("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 rV=Pe("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** + */const sV=Pe("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. @@ -316,7 +316,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sV=Pe("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** + */const iV=Pe("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. @@ -326,7 +326,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iV=Pe("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** + */const aV=Pe("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. @@ -336,7 +336,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aV=Pe("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + */const oV=Pe("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. @@ -346,22 +346,22 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oV=Pe("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const lV=Pe("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 lV=Pe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const cV=Pe("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 Ac=Pe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const Cc=Pe("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 cV=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const uV=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -371,22 +371,22 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uV=Pe("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const dV=Pe("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 dV=Pe("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/** + */const fV=Pe("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 fV=Pe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const hV=Pe("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 hV=Pe("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + */const pV=Pe("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -396,27 +396,27 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pV=Pe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** + */const mV=Pe("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 mV=Pe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** + */const gV=Pe("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 gV=Pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const yV=Pe("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 yV=Pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const bV=Pe("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 kr=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const Nr=Pe("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. @@ -431,12 +431,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bV=Pe("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + */const EV=Pe("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 EV=Pe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const xV=Pe("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. @@ -446,12 +446,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xV=Pe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + */const wV=Pe("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 wV=Pe("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const vV=Pe("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. @@ -466,7 +466,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vV=Pe("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const _V=Pe("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. @@ -476,27 +476,27 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _V=Pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const kV=Pe("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 kV=Pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const NV=Pe("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 NV=Pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + */const SV=Pe("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 SV=Pe("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** + */const TV=Pe("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 TV=Pe("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** + */const AV=Pe("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. @@ -506,52 +506,52 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tr=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pT="veadk_auth_qs";let Ju=null;function AV(){if(Ju!==null)return Ju;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(pT,t),Ju=t):Ju=sessionStorage.getItem(pT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Ju}function Hi(e){const t=AV();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 wu=3e4,ah=12e4,BM=1e4;function bi(e,t=wu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const ng="veadk_local_user",rg="veadk_local_user_tab",CV=/^[A-Za-z0-9]{1,16}$/;function FM(){try{const e=sessionStorage.getItem(rg);if(e)return e;const t=localStorage.getItem(ng);return t&&sessionStorage.setItem(rg,t),t}catch{try{return localStorage.getItem(ng)}catch{return null}}}function mT(e){try{sessionStorage.setItem(rg,e)}catch{}try{localStorage.setItem(ng,e)}catch{}}function IV(){try{sessionStorage.removeItem(rg)}catch{}try{localStorage.removeItem(ng)}catch{}}function p0(e){const t=new Headers(e),n=FM();return n&&t.set("X-VeADK-Local-User",n),t}async function UM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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 RV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function OV(){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 LV(){const[e,t]=await Promise.all([AE(),UM()]);return e.status==="unauthenticated"&&t.length>0}function MV(){window.location.assign("/oauth2/logout")}async function AE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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=FM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function jV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function DV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const CE="veadk:authentication-required";let zd=null,wd=null;function PV(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 BV(e){zd||(zd=new Promise(n=>{wd=n}),window.dispatchEvent(new Event(CE)));const t=zd;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 FV(){return zd!==null}function UV(){wd==null||wd(),wd=null,zd=null}async function m0(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 $V=/\brun_sse\s*failed\s*:\s*404\b/i,HV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,gT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function hp(e){const t=String(e);return HV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!$V.test(t)||t.includes(gT)?t:`${t} + */const Ar=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pT="veadk_auth_qs";let ed=null;function CV(){if(ed!==null)return ed;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(pT,t),ed=t):ed=sessionStorage.getItem(pT)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),ed}function Hi(e){const t=CV();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 vu=3e4,ah=12e4,BM=1e4;function bi(e,t=vu){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const ng="veadk_local_user",rg="veadk_local_user_tab",IV=/^[A-Za-z0-9]{1,16}$/;function FM(){try{const e=sessionStorage.getItem(rg);if(e)return e;const t=localStorage.getItem(ng);return t&&sessionStorage.setItem(rg,t),t}catch{try{return localStorage.getItem(ng)}catch{return null}}}function mT(e){try{sessionStorage.setItem(rg,e)}catch{}try{localStorage.setItem(ng,e)}catch{}}function RV(){try{sessionStorage.removeItem(rg)}catch{}try{localStorage.removeItem(ng)}catch{}}function p0(e){const t=new Headers(e),n=FM();return n&&t.set("X-VeADK-Local-User",n),t}async function UM(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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 OV(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function LV(){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 MV(){const[e,t]=await Promise.all([AE(),UM()]);return e.status==="unauthenticated"&&t.length>0}function jV(){window.location.assign("/oauth2/logout")}async function AE(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:bi(void 0,BM)})}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=FM();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function DV(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function PV(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const CE="veadk:authentication-required";let zd=null,wd=null;function BV(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 FV(e){zd||(zd=new Promise(n=>{wd=n}),window.dispatchEvent(new Event(CE)));const t=zd;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 UV(){return zd!==null}function $V(){wd==null||wd(),wd=null,zd=null}async function m0(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 HV=/\brun_sse\s*failed\s*:\s*404\b/i,zV=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,gT="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function hp(e){const t=String(e);return zV.test(t)?"模型生成的工具参数格式不完整,请重新发送一次。":!HV.test(t)||t.includes(gT)?t:`${t} ${gT}`}async function*Nv(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 l=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const c=l.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 zV=255,VV=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function KV(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let r=0,s="";for(const i of t){if(!VV.test(i))continue;const a=n.encode(i).byteLength;if(r+a>zV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const Sv="veadk.messageFeedback.v1";function Tv(e,t,n,r){return[e,t,n,r].join(":")}function Av(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(Sv)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function YV(e,t,n){if(typeof window>"u")return;const r=Av();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(Sv,JSON.stringify(r))}function $M(e){if(typeof window>"u")return;const t=Tv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Av(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(Sv,JSON.stringify(n))}}const am="",Cv=new Map;function HM(e,t){Cv.set(e,t)}function zM(){Cv.clear()}function ar(e){const t=Cv.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 mt(e,t={},n={},r=wu){const s={...t,headers:p0(t.headers)},i=()=>{const c={...s,signal:bi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Hi(`${am}/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(Hi(`${am}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Hi(`${am}${e}`),c)},a=async c=>{if(PV(c))return!0;if(c.status!==401)return!1;try{return await LV()}catch{return!1}};let l=await i();for(;await a(l);)await BV(t.signal),l=await i();return l}function WV(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 En(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return WV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function VM(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class oh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class qa extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const GV="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",qV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",XV=3e4,IE=new Map;function KM(e,t){return`${t}:${e}`}async function QV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function g0(e,t,n){const r=await mt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await QV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new oh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new qa(GV);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new qa(qV);if(n!=null&&n.runtimeId&&r.status===404)throw new qa("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new qa("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await En(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&IE.set(KM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+XV}),i}async function sg(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,l=await En(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Iv(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function ig(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/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 l=Tv(s.runtimeId,r,t,n);a.state={...Av()[l]??{},...a.state??{}}}return a}async function YM(e){const{app:t,ep:n}=ar(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},ah);if(!r.ok)throw new Error(await En(r,"提交反馈失败"));const s=await r.json(),i=Tv(n.runtimeId,t,e.userId,e.sessionId);return YV(i,e.eventId,s),s}async function WM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await mt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await En(n,"读取评测集失败"));return n.json()}async function GM(e){const t=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},ah);if(!t.ok)throw new Error(await En(t,"删除评测案例失败"));return t.json()}async function RE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}function ZV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function XM(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await mt(c,{},a,ah);if(!u.ok)throw new Error(await En(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=ZV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function QM(e,t,n,r,s){const{blob:i}=await XM(e,t,n,r,s);return URL.createObjectURL(i)}async function JV(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await En(t,"media capabilities failed"));return t.json()}async function ZM(e,t,n,r){const{app:s}=ar(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 mt("/web/media",{method:"POST",body:i},{},ah);if(!a.ok)throw new Error(await En(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function OE(e,t,n){const{app:r}=ar(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await mt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await En(i,"media cleanup failed"))}function JM(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 om(e,t){const n=JM(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await mt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await En(r,"media cleanup failed"))}function ej(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=JM(t);if(!n)return t;const r=`${n}/content`;return Hi(`${am}${r}`)}async function tj(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Rv(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 Ov(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function LE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(Ov(r,t,n),{},s);if(!i.ok)throw new Error(await En(i,"读取会话能力失败"));return Rv(await i.json())}async function Lv(e){const{ep:t}=ar(e),n=await mt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await En(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function eK(e){const{ep:t}=ar(e),n=await mt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await En(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function tK(e,t,n){const{ep:r}=ar(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await mt(i,{},r);if(!a.ok)throw new Error(await En(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function nj(e,t,n=1,r=20){const{ep:s}=ar(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await mt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await En(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function ME(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=await mt(Ov(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(!l.ok)throw new Error(await En(l,"添加会话能力失败"));return Rv(await l.json())}async function rj(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=`${Ov(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await mt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await En(c,"移除会话能力失败"));return Rv(await c.json())}async function sj(e,t,n=!0){const r=await mt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await mt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Mv(e){const{app:t,ep:n}=ar(e);return sj(t,n,!1)}async function jv(e,t,n){const r={runtimeId:e,region:t},s=KM(e,t),i=IE.get(s);i&&i.expiresAt<=Date.now()&&IE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await g0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return sj(a,r)}async function ij(e,t,n,r){const{app:s,ep:i}=ar(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await mt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await En(l,"Agent 检索失败"));return l.json()}async function aj(e,t){const{app:n}=ar(e),r=await mt(`/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*If({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=ar(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,veadkInvocation:h}}}const m=await mt(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:l},d,0);if(!m.ok)throw new Error(hp(`run_sse failed: ${m.status}`));for await(const g of Nv(m)){const w=g;typeof w.error=="string"&&(w.error=hp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=hp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=hp(w.error_message)),yield w}}const Vd=new Map;async function y0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Vd.set(s,i);const a=()=>{s&&Vd.get(s)===i&&Vd.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await mt("/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:KV((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of Nv(l)){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 oj(e){var n;const t=await mt("/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=Vd.get(e))==null||n.abort(),Vd.delete(e)}async function nK(e="cn-beijing"){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Rf={title:"VeADK Studio",logoUrl:""},sb={studio:!1,version:"",branding:Rf,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function lj(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return sb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Rf.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:Rf.title,logoUrl:s?Hi(s):""},features:{...sb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return sb}}const cj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function uj(){var n,r,s;const e=await mt("/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 dj(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 mt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function fj(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},ah);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 Cc(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 mt(`/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 hj(e,t){try{return await g0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof oh||n instanceof qa)throw n;return null}}async function pj(e,t){const n=await mt("/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 Dv(e,t){const n=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载 Runtime 详情失败"));return n.json()}async function Pv(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"生成项目失败"));return t.json()}const rK=19e4;async function mj(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},rK);if(!t.ok)throw new Error(await En(t,"生成 Agent 配置失败"));return m0(t,"生成 Agent 配置失败")}async function gj(e){const t=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"创建调试运行失败"));return m0(t,"创建调试运行失败")}async function yj(e,t){const n=await mt(`/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 En(n,"创建调试会话失败"));return(await m0(n,"创建调试会话失败")).id}async function bj(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载调试调用链路失败"));const r=await m0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*Ej({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await mt(`/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 En(a,"调试运行失败"));for await(const l of Nv(a))yield l}async function Yl(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await En(t,"清理调试运行失败"))}const sK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Rf,DEFAULT_STUDIO_ACCESS:cj,RuntimeAccessDeniedError:oh,RuntimeProbeError:qa,addSessionCapability:ME,cancelAgentkitDeployment:oj,clearMessageFeedbackCache:$M,clearRemoteApps:zM,componentSearch:ij,createGeneratedAgentTestRun:gj,createGeneratedAgentTestSession:yj,createSession:sg,deleteAgentFeedbackCases:GM,deleteGeneratedAgentTestRun:Yl,deleteMedia:om,deleteRuntime:pj,deleteSession:RE,deleteSessionMedia:OE,deployAgentkitProject:y0,downloadArtifact:qM,fetchRemoteApps:g0,generateAgentDraftFromRequirement:mj,generateAgentProject:Pv,getAgentFeedbackCases:WM,getAgentInfo:Mv,getGeneratedAgentTestTrace:bj,getMediaCapabilities:JV,getMyRuntimes:nK,getRuntimeAgentInfo:jv,getRuntimeDetail:Dv,getRuntimes:Cc,getSession:ig,getSessionCapabilities:LE,getSessionTrace:tj,getStudioAccess:uj,getStudioUpdateStatus:dj,getUiConfig:lj,listApps:VM,listSessionBuiltinTools:Lv,listSessionSkillSpaces:eK,listSessionSkillsInSpace:tK,listSessions:Iv,mediaContentUrl:ej,previewArtifact:QM,probeRuntimeApps:hj,registerRemoteApp:HM,removeSessionCapability:rj,runGeneratedAgentTestSSE:Ej,runSSE:If,searchSessionPublicSkills:nj,startStudioUpdate:fj,submitMessageFeedback:YM,uploadMedia:ZM,webSearch:aj},Symbol.toStringTag,{value:"Module"})),iK="send_a2ui_json_to_client",aK="validated_a2ui_json",jE="adk_request_credential",yT="transfer_to_agent";function oK(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 hi(){return{blocks:[],liveStart:0}}const bT=e=>e.functionCall??e.function_call,DE=e=>e.functionResponse??e.function_response;function lK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function cK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function xj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:cK(l.data),name:l.displayName??l.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 PE(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 uK=new Set(["llm","sequential","parallel","loop","a2a"]);function dK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&uK.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 fK(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 hK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function ET(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 pp(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function qc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>bT(p)||DE(p));if(t.partial&&!i){for(const p of s){const m=PE(p);typeof m=="string"&&m&&ET(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=bT(p),g=DE(p),w=xj([p]),y=PE(p);if(typeof y=="string"&&y)ET(n,p.thought?"thinking":"text",y);else if(w.length)pp(n),fK(n,w);else if(m)if(pp(n),m.name===yT){const b=lK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===jE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:oK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(pp(n),g.name===yT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===jE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===iK){const b=((d=g.response)==null?void 0:d[aK])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&hK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),pp(n),r=n.length,{blocks:n,liveStart:r}}function pK(e,t={}){var s,i;const n=[];let r=hi();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=DE(p))==null?void 0:m.name)===jE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(PE).filter(p=>!!p).join(""),d=xj(c),f=dK(c);if(!u&&!d.length&&!f){r=hi();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=hi()}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=hi()),r=qc(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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function mK(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 gK=50,xT=48;function yK(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 bK(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 EK(e,t,n){const r=Math.max(0,t-xT),s=Math.min(e.length,t+n+xT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await ig(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of yK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:bK(l),snippet:EK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,gK)}async function wK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await aj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function vK(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await ij(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function _K(e,t,n){return e==="session"?{results:await xK(n.userId,n.appId,t)}:e==="web"?wK(n.appId,t):vK(e,n.appId,n.userId,t)}function wj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function kK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function NK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(wj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function SK(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 ag(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 wT(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 TK({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=SK(t,n,r),T=N.find(M=>M.id===a),S=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function M(O){var D;(D=k.current)!=null&&D.contains(O.target)||x(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[b]);async function R(M,O){var W;const D=M.trim();if(!D||!((W=N.find(P=>P.id===O))!=null&&W.ready))return;const A=++_.current;g(!0),y(!0);let H;try{H=await _K(O,D,{userId:e,appId:t})}catch(P){const te=P instanceof Error?P.message:String(P);H={results:[],note:`搜索失败:${te}`}}A===_.current&&(f(H.results),p(H.note),g(!1))}function I(M){_.current+=1,u(M),f([]),p(void 0),y(!1),g(!1)}function j(M){_.current+=1,l(M),x(!1),f([]),p(void 0),y(!1),g(!1)}const F=!!(T!=null&&T.ready),Y=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?ag(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(M=>!M),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(kK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(M=>{var A,H;const O=M.id==="knowledge"?(A=n==null?void 0:n.components)==null?void 0:A.find(W=>W.source==="knowledgebase"||W.kind==="knowledgebase"):M.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(W=>W.source==="long_term_memory"||W.kind==="memory"):void 0,D=O?[O.name,O.backend?ag(O.backend):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===M.id,disabled:!M.ready,onClick:()=>j(M.id),children:[o.jsx("span",{children:M.label}),D&&o.jsx("small",{children:D})]},M.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:M=>I(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),R(c,a))},placeholder:Y,disabled:!F,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx($t,{className:"icon spin"}):o.jsx(wj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:F?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((M,O)=>o.jsx(AK,{result:M,agentLabel:s,onOpen:i},O)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function AK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(MM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(h0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(Ev,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:"",e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function vT({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 Bv="/assets/volcengine-DM14a-L-.svg",_T="(max-width: 860px)";function CK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function IK(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 RK={admin:"管理员",developer:"开发者",user:"普通用户"};function kT({role:e}){const t=RK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function OK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),vs.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(Tr,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function LK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=jV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=IK(d||f||h),m=DV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} -${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(yo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(lV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(OK,{version:n,onClose:()=>l(!1)}):null]})}function MK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(_T).matches),[k,N]=E.useState(_.current),T=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(_T),I=j=>{j.matches?N(F=>F||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(mV,{className:"icon"}):o.jsx(pV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(kr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(CK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(NK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(kr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[T.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),T.map(R=>{const I=mK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(j=>j===R.id?null:R.id),children:o.jsx(Kz,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(Vi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(LK,{access:s,userInfo:m,version:g,onLogout:w})]})}const vj="veadk_agentkit_connections";function Ls(){try{const e=localStorage.getItem(vj);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function b0(e){try{localStorage.setItem(vj,JSON.stringify(e))}catch{}}function bo(e,t){return`agentkit:${e}:${t}`}function _j(e){try{return new URL(e).host}catch{return e}}function vu(e){zM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)HM(bo(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function kj(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=Ls(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,b0(l),vu(l),a}async function og(e,t,n,r){let s;try{s=await hj(e,n)}catch(l){throw l instanceof oh&&lg(e),l}if(!s||s.length===0)throw lg(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=kj(e,t,n,s,i,r);return bo(a.id,s[0])}async function Nj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await g0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||_j(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...Ls().filter(c=>c.base!==s),a];return b0(l),vu(l),a}function jK(e){const t=Ls().filter(n=>n.id!==e);return b0(t),vu(t),t}function lg(e){const t=Ls().filter(n=>n.runtimeId!==e);return b0(t),vu(t),t}function Sj(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:bo(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:_j(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const NT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:Nj,addRuntimeConnection:kj,buildAgentEntries:Sj,connectRuntime:og,loadConnections:Ls,registerConnections:vu,remoteAppId:bo,removeConnection:jK,removeRuntimeConnection:lg},Symbol.toStringTag,{value:"Module"}));function Xc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 BE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function DK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function Tj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const ST=15,PK=1e4,BK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function FK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function Aj(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 ib(e,t=PK){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 UK({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,T]=E.useState(!1),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(null),[L,U]=E.useState(new Set),[C,M]=E.useState(),[O,D]=E.useState("agent"),A=E.useRef(!1);function H(ee){M(Ee=>(Ee==null?void 0:Ee.runtimeId)===ee.runtimeId?void 0:{runtimeId:ee.runtimeId,name:ee.name,region:ee.region})}const W=E.useCallback(async ee=>{if(d[ee]){g(ee);return}const Ee=h[ee];if(Ee!==void 0){T(!0),R("");try{const ge=await ib(Cc({nextToken:Ee,pageSize:ST,region:_,scope:"all"}));f(xe=>{const we=[...xe];return we[ee]=ge.runtimes,we}),p(xe=>{const we=[...xe];return ge.nextToken&&(we[ee+1]=ge.nextToken),we}),g(ee)}catch(ge){R(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[h,d,_]),P=E.useCallback(async()=>{T(!0),R("");try{const ee=[];let Ee="";do{const ge=await ib(Cc({scope:"mine",nextToken:Ee,pageSize:100,region:_}));ee.push(...ge.runtimes),Ee=ge.nextToken}while(Ee&&ee.length<2e3);x(ee)}catch(ee){R(ee instanceof Error?ee.message:String(ee))}finally{T(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),A.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!A.current&&(A.current=!0,W(0))},[e,s,w,W]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&P()},[w,b,s,P]),E.useEffect(()=>{e&&(M(void 0),D("agent"))},[e]);function te(){U(new Set),w?(x(null),P()):(f([]),p([""]),g(0),A.current=!0,T(!0),R(""),ib(Cc({nextToken:"",pageSize:ST,region:_,scope:"all"})).then(ee=>{f([ee.runtimes]),p(ee.nextToken?["",ee.nextToken]:[""])}).catch(ee=>R(ee instanceof Error?ee.message:String(ee))).finally(()=>T(!1)))}function X(ee){ee!==_&&(k(ee),f([]),p([""]),g(0),x(null),U(new Set),A.current=!1)}const ne=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function ce(ee){Y(ee.runtimeId),og(ee.runtimeId,ee.name,ee.region).then(async Ee=>{await u(Ee),t()}).catch(Ee=>{if(Ee instanceof oh){R(Ee.message);return}if(Ee instanceof qa){Ee.unsupported&&U(ge=>new Set(ge).add(ee.runtimeId)),R(Ee.message);return}U(ge=>new Set(ge).add(ee.runtimeId))}).finally(()=>Y(null))}if(!e)return null;const fe=(w?b??[]:d[m]??[]).filter(ee=>I?ee.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Xc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:te,title:"刷新",disabled:N,children:o.jsx(DM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(Tr,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(ee=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${ee===a?"active":""}`,onClick:()=>{u(ee),t()},children:[o.jsx(Xc,{}),o.jsx("span",{className:"agentsel-item-name",children:ee})]})},ee))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(Cf,{className:"icon"}),o.jsx("input",{value:I,onChange:ee=>j(ee.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:BK.map(ee=>o.jsx("button",{type:"button",className:_===ee.value?"active":"","aria-pressed":_===ee.value,onClick:()=>X(ee.value),children:ee.label},ee.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:ee=>y(ee.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[fe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:fe.map(ee=>{const Ee=L.has(ee.runtimeId),ge=F===ee.runtimeId,xe=(l==null?void 0:l.runtimeId)===ee.runtimeId,we=(C==null?void 0:C.runtimeId)===ee.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${xe?"active":""} ${we?"is-previewed":""}`,title:ee.runtimeId,children:[o.jsx(Tj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:ee.name,children:ee.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${Ee?"bad":WK(ee.status)}`,children:Ee?"不支持":Cj(ee.status)}),ee.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||xe,onClick:()=>ce(ee),children:ge?"连接中…":xe?"已连接":Ee?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${we?"active":""}`,"aria-label":`查看 ${ee.name} 信息`,"aria-pressed":we,title:"查看信息",onClick:()=>H(ee),children:o.jsx(yo,{className:"icon"})}):null]})]})},ee.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx($t,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void W(m-1),"aria-label":"上一页",children:o.jsx($z,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!ne||N,onClick:()=>void W(m+1),"aria-label":"下一页",children:o.jsx($s,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(VK,{runtime:C,tab:O,onTabChange:D})]})]})}const $K={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function HK(e){return $K[e.toLowerCase()]??e}function zK(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 VK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx(KK,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(YK,{runtime:e})})]})}function KK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),jv(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(Aj(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx($t,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Xc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(TT,{icon:o.jsx(jM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(TT,{icon:o.jsx(BE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(DK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(AM,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[HK(d.kind),d.backend?` · ${zK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function TT({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function YK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Dv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(Aj(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",Cj(t.status)]),t.region&&u.push(["区域",FK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(Tj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx($t,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function WK(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 GK={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function Cj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return GK[t]??(e||"-")}function qK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx($s,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(XK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function XK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Pz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(yv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx(UK,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function lh(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Ij(){return(await lh("/web/skill-spaces?region=all")).items||[]}async function QK(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),lh(`/web/skill-spaces?${t.toString()}`)}async function Rj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function ZK(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),lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function JK(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 lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function eY(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 tY(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const nY="https://ark.cn-beijing.volces.com/api/v3/",lm=[{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:nY}],Qc=[],ed=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],Ei={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Oj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:Ei.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:Ei.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:Ei.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],dl=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Qc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Qc},{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"}]}],FE=[{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}]}],UE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:lm,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},...lm],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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Qc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Zc="viking",$E=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Qc},{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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Qc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],HE=[{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:[...Qc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],rY={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function zE(e){const t=dl.find(n=>n.id===e||n.toolNames.includes(e));return rY[e]??(t==null?void 0:t.label)??e}function AT(e){const t=dl.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function sY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function iY(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function CT(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Lj({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),vs.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(sY,{})})]}),i]})]}),document.body)}function cm({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(iY,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function aY({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${zE(m)} ${m} ${AT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Lj,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(BE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(cm,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(BE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:zE(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:AT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function oY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,T]=E.useState([]),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(!0),[L,U]=E.useState(!1),[C,M]=E.useState(""),[O,D]=E.useState(""),A=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let X=!0;const ne=window.setTimeout(()=>{g(!0),y(""),nj(e,c.trim()).then(ce=>{X&&(f(ce.items),p(ce.totalCount))}).catch(ce=>{X&&(f([]),p(0),y(ce instanceof Error?ce.message:"搜索 Skill Hub 失败"))}).finally(()=>{X&&g(!1)})},250);return()=>{X=!1,window.clearTimeout(ne)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let X=!0;return Y(!0),M(""),Ij().then(ne=>{X&&(x(ne),k(ne[0]??null))}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取 Skill Space 失败")}).finally(()=>{X&&Y(!1)}),()=>{X=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){T([]);return}let X=!0;return U(!0),M(""),Rj(_.id,_.region).then(ne=>{X&&T(ne)}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取技能失败")}).finally(()=>{X&&U(!1)}),()=>{X=!1}},[_,a]);const H=E.useMemo(()=>{const X=S.trim().toLowerCase();return X?b.filter(ne=>`${ne.name} ${ne.id} ${ne.description}`.toLowerCase().includes(X)):b},[S,b]),W=E.useMemo(()=>{const X=I.trim().toLowerCase();return X?N.filter(ne=>`${ne.skillName} ${ne.skillDescription}`.toLowerCase().includes(X)):N},[I,N]),P=async X=>{if(!_)return;D(X.skillId);const ne=await s({kind:"skill",name:X.skillName,skillSourceId:_.id,description:X.skillDescription,version:X.version});D(""),ne&&i()},te=async X=>{D(X.slug);const ne=await s({kind:"skill",name:X.name,skillSourceId:`findskill:${X.slug}`,description:X.description,version:X.version||X.updatedAt});D(""),ne&&i()};return o.jsx(Lj,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(cm,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(X=>{const ne=A.has(X.name),ce=O===X.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.name}),o.jsx("span",{children:X.description||"暂无描述"}),o.jsxs("small",{children:[X.sourceRepo||X.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),X.downloadCount.toLocaleString()," 次下载",X.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),X.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void te(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},X.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(cm,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:F?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):H.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):H.map(X=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===X.id?" is-active":""}`,onClick:()=>{k(X),j("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:X.name||X.id}),o.jsx("small",{children:X.description||X.id}),o.jsxs("em",{children:[X.skillCount??0," 个技能"]})]})},`${X.projectName??"default"}:${X.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(cm,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:j})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):W.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):W.map(X=>{const ne=A.has(X.skillName),ce=O===X.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.skillName}),o.jsx("span",{children:X.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",X.version||"—"]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void P(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},`${X.skillId}:${X.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function Ea({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const lY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Mj(e){return 1+e.children.reduce((t,n)=>t+Mj(n),0)}function Jc(e){return e.id||e.name}function cY(e,t){const n=Jc(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 jj(e,t=!0){return{...e,id:Jc(e),name:cY(e,t),children:e.children.map(n=>jj(n,!1))}}function Dj(e,t){t.set(Jc(e),e.name||Jc(e)),e.children.forEach(n=>Dj(n,t))}function uY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function dY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Pj({node:e,activeAgent:t,seen:n,path:r}){const s=Jc(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Xc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:lY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Pj,{node:c,activeAgent:t,seen:n,path:r},Jc(c)))})]})}function ab({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function Bj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(Ea,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=jj(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:[]}),w=(l==null?void 0:l.tools)??uY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??dY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Dj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(ab,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:zE(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(ab,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(ab,{title:"拓扑",count:Mj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Pj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(aY,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(oY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function fY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function hY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(fY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(Bj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function W1e(){}function IT(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 Fj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pY=/[$_\p{ID_Start}]/u,mY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,gY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,yY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uj={};function G1e(e){return e?pY.test(String.fromCodePoint(e)):!1}function q1e(e,t){const r=(t||Uj).jsx?gY:mY;return e?r.test(String.fromCodePoint(e)):!1}function RT(e,t){return(Uj.jsx?bY:yY).test(e)}const EY=/[ \t\n\f\r]/g;function xY(e){return typeof e=="object"?e.type==="text"?OT(e.value):!1:OT(e)}function OT(e){return e.replace(EY,"")===""}let ch=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function $j(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ch(n,r,t)}function Of(e){return e.toLowerCase()}class cs{constructor(t,n){this.attribute=n,this.property=t}}cs.prototype.attribute="";cs.prototype.booleanish=!1;cs.prototype.boolean=!1;cs.prototype.commaOrSpaceSeparated=!1;cs.prototype.commaSeparated=!1;cs.prototype.defined=!1;cs.prototype.mustUseProperty=!1;cs.prototype.number=!1;cs.prototype.overloadedBoolean=!1;cs.prototype.property="";cs.prototype.spaceSeparated=!1;cs.prototype.space=void 0;let wY=0;const wt=vl(),sr=vl(),VE=vl(),je=vl(),gn=vl(),Ic=vl(),ps=vl();function vl(){return 2**++wY}const KE=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:sr,commaOrSpaceSeparated:ps,commaSeparated:Ic,number:je,overloadedBoolean:VE,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),ob=Object.keys(KE);class Fv extends cs{constructor(t,n,r,s){let i=-1;if(super(t,n),LT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&SY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(MT,AY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!MT.test(i)){let a=i.replace(NY,TY);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Fv}return new s(r,t)}function TY(e){return"-"+e.toLowerCase()}function AY(e){return e.charAt(1).toUpperCase()}const uh=$j([Hj,vY,Kj,Yj,Wj],"html"),Eo=$j([Hj,_Y,Kj,Yj,Wj],"svg");function jT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Gj(e){return e.join(" ").trim()}var Uv={},DT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,CY=/\n/g,IY=/^\s*/,RY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,OY=/^:\s*/,LY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,MY=/^[;\s]*/,jY=/^\s+|\s+$/g,DY=` -`,PT="/",BT="*",Uo="",PY="comment",BY="declaration";function FY(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 g=m.match(CY);g&&(n+=g.length);var w=m.lastIndexOf(DY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(IY)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(PT!=e.charAt(0)||BT!=e.charAt(1))){for(var g=2;Uo!=e.charAt(g)&&(BT!=e.charAt(g)||PT!=e.charAt(g+1));)++g;if(g+=2,Uo===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:PY,comment:w})}}function h(){var m=i(),g=c(RY);if(g){if(f(),!c(OY))return l("property missing ':'");var w=c(LY),y=m({type:BY,property:FT(g[0].replace(DT,Uo)),value:w?FT(w[0].replace(DT,Uo)):Uo});return c(MY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function FT(e){return e?e.replace(jY,Uo):Uo}var UY=FY,$Y=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.default=zY;const HY=$Y(UY);function zY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,HY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var x0={};Object.defineProperty(x0,"__esModule",{value:!0});x0.camelCase=void 0;var VY=/^--[a-zA-Z0-9_-]+$/,KY=/-([a-z])/g,YY=/^[^-]+$/,WY=/^-(webkit|moz|ms|o|khtml)-/,GY=/^-(ms)-/,qY=function(e){return!e||YY.test(e)||VY.test(e)},XY=function(e,t){return t.toUpperCase()},UT=function(e,t){return"".concat(t,"-")},QY=function(e,t){return t===void 0&&(t={}),qY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(GY,UT):e=e.replace(WY,UT),e.replace(KY,XY))};x0.camelCase=QY;var ZY=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},JY=ZY(Uv),eW=x0;function YE(e,t){var n={};return!e||typeof e!="string"||(0,JY.default)(e,function(r,s){r&&s&&(n[(0,eW.camelCase)(r,t)]=s)}),n}YE.default=YE;var tW=YE;const nW=Xf(tW),w0=qj("end"),Yi=qj("start");function qj(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 rW(e){const t=Yi(e),n=w0(e);if(t&&n)return{start:t,end:n}}function Kd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$T(e.position):"start"in e||"end"in e?$T(e):"line"in e||"column"in e?WE(e):""}function WE(e){return HT(e&&e.line)+":"+HT(e&&e.column)}function $T(e){return WE(e&&e.start)+"-"+WE(e&&e.end)}function HT(e){return e&&typeof e=="number"?e:1}class Br 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Kd(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}}Br.prototype.file="";Br.prototype.name="";Br.prototype.reason="";Br.prototype.message="";Br.prototype.stack="";Br.prototype.column=void 0;Br.prototype.line=void 0;Br.prototype.ancestors=void 0;Br.prototype.cause=void 0;Br.prototype.fatal=void 0;Br.prototype.place=void 0;Br.prototype.ruleId=void 0;Br.prototype.source=void 0;const $v={}.hasOwnProperty,sW=new Map,iW=/[A-Z]/g,aW=new Set(["table","tbody","thead","tfoot","tr"]),oW=new Set(["td","th"]),Xj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lW(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=gW(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=mW(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"?Eo:uh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Qj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Qj(e,t,n){if(t.type==="element")return cW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fW(e,t,n);if(t.type==="mdxjsEsm")return dW(e,t);if(t.type==="root")return hW(e,t,n);if(t.type==="text")return pW(e,t)}function cW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=Jj(e,t.tagName,!1),a=yW(e,t);let l=zv(e,t);return aW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!xY(c):!0})),Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function uW(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)}Lf(e,t.position)}function dW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lf(e,t.position)}function fW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Jj(e,t.name,!0),a=bW(e,t),l=zv(e,t);return Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function hW(e,t,n){const r={};return Hv(r,zv(e,t)),e.create(t,e.Fragment,r,n)}function pW(e,t){return t.value}function Zj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function gW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=Yi(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function yW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&$v.call(t.properties,s)){const i=EW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&oW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Lf(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else Lf(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function zv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:sW;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?(xs(e,e.length,0,t),e):t}const KT={}.hasOwnProperty;function t3(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 xi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yr=xo(/[A-Za-z]/),jr=xo(/[\dA-Za-z]/),AW=xo(/[#-'*+\--9=?A-Z^-~]/);function cg(e){return e!==null&&(e<32||e===127)}const GE=xo(/\d/),CW=xo(/[\dA-Fa-f]/),IW=xo(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function Tt(e){return e===-2||e===-1||e===32}const v0=xo(new RegExp("\\p{P}|\\p{S}","u")),fl=xo(/\s/);function xo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ku(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),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 Mt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return Tt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Tt(c)&&i++a))return;const T=t.events.length;let S=T,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=T;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function jW(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function eu(e){if(e===null||un(e)||fl(e))return 1;if(v0(e))return 2}function _0(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};WT(f,-c),WT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ds(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ds(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Ds(u,_0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ds(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Ds(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,xs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&Tt(N)?Mt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||it(N)?e.check(GT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||it(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,T,S){let R=0;return I;function I(U){return N.enter("lineEnding"),N.consume(U),N.exit("lineEnding"),j}function j(U){return N.enter("codeFencedFence"),Tt(U)?Mt(N,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===l?(N.enter("codeFencedFenceSequence"),Y(U)):S(U)}function Y(U){return U===l?(R++,N.consume(U),Y):R>=a?(N.exit("codeFencedFenceSequence"),Tt(U)?Mt(N,L,"whitespace")(U):L(U)):S(U)}function L(U){return U===null||it(U)?(N.exit("codeFencedFence"),T(U)):S(U)}}}function WW(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 cb={name:"codeIndented",tokenize:qW},GW={partial:!0,tokenize:XW};function qW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Mt(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):it(u)?e.attempt(GW,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||it(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function XW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Mt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):it(a)?s(a):n(a)}}const QW={name:"codeText",previous:JW,resolve:ZW,tokenize:eG};function ZW(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&&td(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),td(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),td(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 o3(e,t,n,r,s,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||cg(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||it(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||un(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):it(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||it(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Tt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function c3(e,t,n,r,s,i){let a;return l;function l(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):it(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Mt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||it(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 Yd(e,t){let n;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Tt(s)?Mt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const lG={name:"definition",tokenize:uG},cG={partial:!0,tokenize:dG};function uG(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return l3.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=xi(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 un(p)?Yd(e,u)(p):u(p)}function u(p){return o3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(cG,f,f)(p)}function f(p){return Tt(p)?Mt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||it(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function dG(e,t,n){return r;function r(l){return un(l)?Yd(e,s)(l):n(l)}function s(l){return c3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return Tt(l)?Mt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||it(l)?t(l):n(l)}}const fG={name:"hardBreakEscape",tokenize:hG};function hG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const pG={name:"headingAtx",resolve:mG,tokenize:gG};function mG(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"},xs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function gG(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||un(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||it(d)?(e.exit("atxHeading"),t(d)):Tt(d)?Mt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||un(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const yG=["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"],XT=["pre","script","style","textarea"],bG={concrete:!0,name:"htmlFlow",resolveTo:wG,tokenize:vG},EG={partial:!0,tokenize:kG},xG={partial:!0,tokenize:_G};function wG(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 vG(e,t,n){const r=this;let s,i,a,l,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,g):P===63?(e.consume(P),s=3,r.interrupt?t:A):Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,l=0,m):Yr(P)?(e.consume(P),s=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function m(P){const te="CDATA[";return P===te.charCodeAt(l++)?(e.consume(P),l===te.length?r.interrupt?t:F:m):n(P)}function g(P){return Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function w(P){if(P===null||P===47||P===62||un(P)){const te=P===47,X=a.toLowerCase();return!te&&!i&&XT.includes(X)?(s=1,r.interrupt?t(P):F(P)):yG.includes(a.toLowerCase())?(s=6,te?(e.consume(P),y):r.interrupt?t(P):F(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?b(P):x(P))}return P===45||jr(P)?(e.consume(P),a+=String.fromCharCode(P),w):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function b(P){return Tt(P)?(e.consume(P),b):I(P)}function x(P){return P===47?(e.consume(P),I):P===58||P===95||Yr(P)?(e.consume(P),_):Tt(P)?(e.consume(P),x):I(P)}function _(P){return P===45||P===46||P===58||P===95||jr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):Tt(P)?(e.consume(P),k):x(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,T):Tt(P)?(e.consume(P),N):S(P)}function T(P){return P===c?(e.consume(P),c=null,R):P===null||it(P)?n(P):(e.consume(P),T)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||un(P)?k(P):(e.consume(P),S)}function R(P){return P===47||P===62||Tt(P)?x(P):n(P)}function I(P){return P===62?(e.consume(P),j):n(P)}function j(P){return P===null||it(P)?F(P):Tt(P)?(e.consume(P),j):n(P)}function F(P){return P===45&&s===2?(e.consume(P),C):P===60&&s===1?(e.consume(P),M):P===62&&s===4?(e.consume(P),H):P===63&&s===3?(e.consume(P),A):P===93&&s===5?(e.consume(P),D):it(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(EG,W,Y)(P)):P===null||it(P)?(e.exit("htmlFlowData"),Y(P)):(e.consume(P),F)}function Y(P){return e.check(xG,L,W)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return P===null||it(P)?Y(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),A):F(P)}function M(P){return P===47?(e.consume(P),a="",O):F(P)}function O(P){if(P===62){const te=a.toLowerCase();return XT.includes(te)?(e.consume(P),H):F(P)}return Yr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),O):F(P)}function D(P){return P===93?(e.consume(P),A):F(P)}function A(P){return P===62?(e.consume(P),H):P===45&&s===2?(e.consume(P),A):F(P)}function H(P){return P===null||it(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),H)}function W(P){return e.exit("htmlFlow"),t(P)}}function _G(e,t,n){const r=this;return s;function s(a){return it(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 kG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(dh,t,n)}}const NG={name:"htmlText",tokenize:SG};function SG(e,t,n){const r=this;let s,i,a;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),k):A===63?(e.consume(A),x):Yr(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,m):Yr(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):it(A)?(a=f,M(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?C(A):A===45?h(A):f(A)}function m(A){const H="CDATA[";return A===H.charCodeAt(i++)?(e.consume(A),i===H.length?g:m):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),w):it(A)?(a=g,M(A)):(e.consume(A),g)}function w(A){return A===93?(e.consume(A),y):g(A)}function y(A){return A===62?C(A):A===93?(e.consume(A),y):g(A)}function b(A){return A===null||A===62?C(A):it(A)?(a=b,M(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),_):it(A)?(a=x,M(A)):(e.consume(A),x)}function _(A){return A===62?C(A):x(A)}function k(A){return Yr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||jr(A)?(e.consume(A),N):T(A)}function T(A){return it(A)?(a=T,M(A)):Tt(A)?(e.consume(A),T):C(A)}function S(A){return A===45||jr(A)?(e.consume(A),S):A===47||A===62||un(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),C):A===58||A===95||Yr(A)?(e.consume(A),I):it(A)?(a=R,M(A)):Tt(A)?(e.consume(A),R):C(A)}function I(A){return A===45||A===46||A===58||A===95||jr(A)?(e.consume(A),I):j(A)}function j(A){return A===61?(e.consume(A),F):it(A)?(a=j,M(A)):Tt(A)?(e.consume(A),j):R(A)}function F(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,Y):it(A)?(a=F,M(A)):Tt(A)?(e.consume(A),F):(e.consume(A),L)}function Y(A){return A===s?(e.consume(A),s=void 0,U):A===null?n(A):it(A)?(a=Y,M(A)):(e.consume(A),Y)}function L(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||un(A)?R(A):(e.consume(A),L)}function U(A){return A===47||A===62||un(A)?R(A):n(A)}function C(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function M(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Tt(A)?Mt(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):D(A)}function D(A){return e.enter("htmlTextData"),a(A)}}const Yv={name:"labelEnd",resolveAll:IG,resolveTo:RG,tokenize:OG},TG={tokenize:LG},AG={tokenize:MG},CG={tokenize:jG};function IG(e){let t=-1;const n=[];for(;++t=3&&(u===null||it(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Tt(u)?Mt(e,l,"whitespace")(u):l(u))}}const ts={continuation:{tokenize:KG},exit:WG,name:"list",tokenize:VG},HG={partial:!0,tokenize:GG},zG={partial:!0,tokenize:YG};function VG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:GE(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(um,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 GE(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(dh,r.interrupt?n:d,e.attempt(HG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return Tt(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 KG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dh,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!Tt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function YG(e,t,n){const r=this;return Mt(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 WG(e){e.exit(this.containerState.type)}function GG(e,t,n){const r=this;return Mt(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!Tt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const QT={name:"setextUnderline",resolveTo:qG,tokenize:XG};function qG(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 XG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Tt(u)?Mt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||it(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const QG={tokenize:ZG};function ZG(e){const t=this,n=e.attempt(dh,r,e.attempt(this.parser.constructs.flowInitial,s,Mt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(rG,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 JG={resolveAll:d3()},eq=u3("string"),tq=u3("text");function u3(e){return{resolveAll:d3(e==="text"?nq:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function mq(e,t){let n=-1;const r=[];let s;for(;++nVV)break;s+=i,r+=a}return s.replace(/ +/g," ").trimEnd()}const Sv="veadk.messageFeedback.v1";function Tv(e,t,n,r){return[e,t,n,r].join(":")}function Av(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(Sv)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function WV(e,t,n){if(typeof window>"u")return;const r=Av();r[e]={...r[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(Sv,JSON.stringify(r))}function $M(e){if(typeof window>"u")return;const t=Tv(e.runtimeId,e.appName,e.userId,e.sessionId),n=Av(),r=n[t];if(r){for(const s of e.eventIds)delete r[`veadk_feedback:${s}`];Object.keys(r).length===0?delete n[t]:n[t]=r,localStorage.setItem(Sv,JSON.stringify(n))}}const am="",Cv=new Map;function HM(e,t){Cv.set(e,t)}function zM(){Cv.clear()}function ar(e){const t=Cv.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 mt(e,t={},n={},r=vu){const s={...t,headers:p0(t.headers)},i=()=>{const c={...s,signal:bi(t.signal,r)};if(n.runtimeId){const u=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Hi(`${am}/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(Hi(`${am}/agentkit-proxy${e}`),{...c,headers:u})}return fetch(Hi(`${am}${e}`),c)},a=async c=>{if(BV(c))return!0;if(c.status!==401)return!1;try{return await MV()}catch{return!1}};let l=await i();for(;await a(l);)await FV(t.signal),l=await i();return l}function GV(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 En(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return GV(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function VM(){const e=await mt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class oh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class qa extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const qV="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",XV="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",QV=3e4,IE=new Map;function KM(e,t){return`${t}:${e}`}async function ZV(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function g0(e,t,n){const r=await mt("/list-apps",{},n??{base:e,apiKey:t}),s=n!=null&&n.runtimeId?await ZV(r):"";if(n!=null&&n.runtimeId&&s==="runtime_access_denied")throw new oh;if(n!=null&&n.runtimeId&&s==="runtime_private_endpoint_unreachable")throw new qa(qV);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(s))throw new qa(XV);if(n!=null&&n.runtimeId&&r.status===404)throw new qa("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(r.status===401||r.status===403))throw new qa("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!r.ok)throw new Error(await En(r,"读取 Agent 列表失败"));const i=await r.json();return n!=null&&n.runtimeId&&IE.set(KM(n.runtimeId,n.region??""),{apps:i,expiresAt:Date.now()+QV}),i}async function sg(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!s.ok){const a=`创建会话失败 (${s.status})`,l=await En(s,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await s.json()).id}async function Iv(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!s.ok)throw new Error(`list sessions failed: ${s.status}`);return s.json()}async function ig(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/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 l=Tv(s.runtimeId,r,t,n);a.state={...Av()[l]??{},...a.state??{}}}return a}async function YM(e){const{app:t,ep:n}=ar(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const r=await mt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},ah);if(!r.ok)throw new Error(await En(r,"提交反馈失败"));const s=await r.json(),i=Tv(n.runtimeId,t,e.userId,e.sessionId);return WV(i,e.eventId,s),s}async function WM(e){const t=new URLSearchParams({runtimeId:e.runtimeId,region:e.region,appName:e.appName,page_size:String(e.pageSize??100)}),n=await mt(`/web/evaluation/feedback-cases?${t.toString()}`);if(!n.ok)throw new Error(await En(n,"读取评测集失败"));return n.json()}async function GM(e){const t=await mt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:e.region,appName:e.appName,itemIds:e.itemIds})},{},ah);if(!t.ok)throw new Error(await En(t,"删除评测案例失败"));return t.json()}async function RE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},s);if(!i.ok&&i.status!==404)throw new Error(`delete session failed: ${i.status}`)}function JV(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),r=window.atob(n),s=new Uint8Array(r.length);for(let i=0;iURL.revokeObjectURL(l),0)}async function XM(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=s==null?"":`?version=${encodeURIComponent(s)}`,c=`/apps/${encodeURIComponent(i)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(r)}${l}`,u=await mt(c,{},a,ah);if(!u.ok)throw new Error(await En(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=JV(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??r}}async function QM(e,t,n,r,s){const{blob:i}=await XM(e,t,n,r,s);return URL.createObjectURL(i)}async function eK(e){const t=await mt("/web/media/capabilities");if(!t.ok)throw new Error(await En(t,"media capabilities failed"));return t.json()}async function ZM(e,t,n,r){const{app:s}=ar(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 mt("/web/media",{method:"POST",body:i},{},ah);if(!a.ok)throw new Error(await En(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function OE(e,t,n){const{app:r}=ar(e),s=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,i=await mt(s,{method:"DELETE"});if(!i.ok&&i.status!==404)throw new Error(await En(i,"media cleanup failed"))}function JM(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 om(e,t){const n=JM(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await mt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await En(r,"media cleanup failed"))}function ej(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=JM(t);if(!n)return t;const r=`${n}/content`;return Hi(`${am}${r}`)}async function tj(e,t){const{app:n,ep:r}=ar(e),s=await mt(`/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 l=i.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${l}),请检查 Studio API 代理配置`)}const a=await s.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}function Rv(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 Ov(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function LE(e,t,n){const{app:r,ep:s}=ar(e),i=await mt(Ov(r,t,n),{},s);if(!i.ok)throw new Error(await En(i,"读取会话能力失败"));return Rv(await i.json())}async function Lv(e){const{ep:t}=ar(e),n=await mt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await En(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(s=>{var i;return((i=s.name)==null?void 0:i.trim())??""}).filter(Boolean)}async function tK(e){const{ep:t}=ar(e),n=await mt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await En(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function nK(e,t,n){const{ep:r}=ar(e),s=new URLSearchParams({region:n||"cn-beijing"}),i=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${s.toString()}`,a=await mt(i,{},r);if(!a.ok)throw new Error(await En(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function nj(e,t,n=1,r=20){const{ep:s}=ar(e),i=new URLSearchParams({query:t,page_number:String(n),page_size:String(r)}),a=await mt(`/harness/skills/findskill?${i.toString()}`,{},s);if(!a.ok)throw new Error(await En(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function ME(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=await mt(Ov(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(!l.ok)throw new Error(await En(l,"添加会话能力失败"));return Rv(await l.json())}async function rj(e,t,n,r,s){const{app:i,ep:a}=ar(e),l=`${Ov(i,t,n)}/${encodeURIComponent(r)}?expected_revision=${s}`,c=await mt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await En(c,"移除会话能力失败"));return Rv(await c.json())}async function sj(e,t,n=!0){const r=await mt(`/web/agent-info/${e}`,{},t);if(!r.ok)throw new Error(`agent-info failed: ${r.status}`);const s=await r.json();if(n&&!s.draft)try{const i=await mt(`/web/agent-draft/${e}`,{},t);if(i.ok){const a=await i.json();s.draft=a.draft}}catch{}return{name:s.name??e,description:s.description??"",type:s.type,model:s.model??"",tools:s.tools??[],skillsPreviewSupported:Array.isArray(s.skills),skills:s.skills??[],subAgents:s.subAgents??[],components:s.components??[],searchSources:s.searchSources??[],graph:s.graph,draft:s.draft}}async function Mv(e){const{app:t,ep:n}=ar(e);return sj(t,n,!1)}async function jv(e,t,n){const r={runtimeId:e,region:t},s=KM(e,t),i=IE.get(s);i&&i.expiresAt<=Date.now()&&IE.delete(s);const a=n||(i==null?void 0:i.apps[0])||(await g0("","",r))[0];if(!a)throw new Error("该 Runtime 未提供可预览的 Agent。");return sj(a,r)}async function ij(e,t,n,r){const{app:s,ep:i}=ar(e),a=new URLSearchParams({source:t,app_name:s,q:n,user_id:r}),l=await mt(`/web/search?${a.toString()}`,{},i);if(!l.ok)throw new Error(await En(l,"Agent 检索失败"));return l.json()}async function aj(e,t){const{app:n}=ar(e),r=await mt(`/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*If({appName:e,userId:t,sessionId:n,text:r,attachments:s=[],invocation:i,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=ar(e),f=s.flatMap(g=>g.status&&g.status!=="ready"?[]:g.uri?[{fileData:{mimeType:g.mimeType,fileUri:g.uri,displayName:g.name},partMetadata:{veadkMedia:{id:g.id,uri:g.uri,name:g.name,mimeType:g.mimeType,sizeBytes:g.sizeBytes}}}]:g.data?[{inlineData:{mimeType:g.mimeType,data:g.data,displayName:g.name}}]:[]),h=i&&(i.skills.length>0||i.targetAgent)?i:void 0,p=[...f,...a.map(g=>({functionResponse:{id:g.id,name:g.name,response:g.response}})),...r.trim()?[{text:r}]:[]];if(h&&p.length>0){const g=p[0],w=g.partMetadata;p[0]={...g,partMetadata:{...w,veadkInvocation:h}}}const m=await mt(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:l},d,0);if(!m.ok)throw new Error(hp(`run_sse failed: ${m.status}`));for await(const g of Nv(m)){const w=g;typeof w.error=="string"&&(w.error=hp(w.error)),typeof w.errorMessage=="string"&&(w.errorMessage=hp(w.errorMessage)),typeof w.error_message=="string"&&(w.error_message=hp(w.error_message)),yield w}}const Vd=new Map;async function y0(e,t,n,r){var u,d,f;const s=r==null?void 0:r.taskId,i=s?new AbortController:void 0;s&&i&&Vd.set(s,i);const a=()=>{s&&Vd.get(s)===i&&Vd.delete(s)};let l;try{(u=r==null?void 0:r.onStage)==null||u.call(r,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await mt("/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:YV((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(!l.ok){const h=await l.text().catch(()=>"");throw a(),new Error(h||`部署失败 (${l.status})`)}let c=null;try{for await(const h of Nv(l)){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 oj(e){var n;const t=await mt("/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=Vd.get(e))==null||n.abort(),Vd.delete(e)}async function rK(e="cn-beijing"){const t=await mt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Rf={title:"VeADK Studio",logoUrl:""},sb={studio:!1,version:"",branding:Rf,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function lj(){var e,t;try{const n=await mt("/web/ui-config");if(!n.ok)return sb;const r=await n.json(),s=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Rf.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:Rf.title,logoUrl:s?Hi(s):""},features:{...sb.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return sb}}const cj={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function uj(){var n,r,s;const e=await mt("/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 dj(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 mt(`/web/studio-update${r}`);if(!s.ok)throw new Error(`检查 Studio 更新失败 (${s.status})`);return await s.json()}async function fj(e){const t=await mt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},ah);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 Ic(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 mt(`/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 hj(e,t){try{return await g0("","",{runtimeId:e,region:t})}catch(n){if(n instanceof oh||n instanceof qa)throw n;return null}}async function pj(e,t){const n=await mt("/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 Dv(e,t){const n=await mt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载 Runtime 详情失败"));return n.json()}async function Pv(e){const t=await mt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"生成项目失败"));return t.json()}const sK=19e4;async function mj(e){const t=await mt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},sK);if(!t.ok)throw new Error(await En(t,"生成 Agent 配置失败"));return m0(t,"生成 Agent 配置失败")}async function gj(e){const t=await mt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await En(t,"创建调试运行失败"));return m0(t,"创建调试运行失败")}async function yj(e,t){const n=await mt(`/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 En(n,"创建调试会话失败"));return(await m0(n,"创建调试会话失败")).id}async function bj(e,t){const n=await mt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await En(n,"加载调试调用链路失败"));const r=await m0(n,"加载调试调用链路失败");if(!Array.isArray(r))throw new Error("加载调试调用链路失败:返回格式无效");return r}async function*Ej({runId:e,userId:t,sessionId:n,text:r,signal:s}){const i=r.trim()?[{text:r}]:[],a=await mt(`/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 En(a,"调试运行失败"));for await(const l of Nv(a))yield l}async function Yl(e){const t=await mt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await En(t,"清理调试运行失败"))}const iK=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Rf,DEFAULT_STUDIO_ACCESS:cj,RuntimeAccessDeniedError:oh,RuntimeProbeError:qa,addSessionCapability:ME,cancelAgentkitDeployment:oj,clearMessageFeedbackCache:$M,clearRemoteApps:zM,componentSearch:ij,createGeneratedAgentTestRun:gj,createGeneratedAgentTestSession:yj,createSession:sg,deleteAgentFeedbackCases:GM,deleteGeneratedAgentTestRun:Yl,deleteMedia:om,deleteRuntime:pj,deleteSession:RE,deleteSessionMedia:OE,deployAgentkitProject:y0,downloadArtifact:qM,fetchRemoteApps:g0,generateAgentDraftFromRequirement:mj,generateAgentProject:Pv,getAgentFeedbackCases:WM,getAgentInfo:Mv,getGeneratedAgentTestTrace:bj,getMediaCapabilities:eK,getMyRuntimes:rK,getRuntimeAgentInfo:jv,getRuntimeDetail:Dv,getRuntimes:Ic,getSession:ig,getSessionCapabilities:LE,getSessionTrace:tj,getStudioAccess:uj,getStudioUpdateStatus:dj,getUiConfig:lj,listApps:VM,listSessionBuiltinTools:Lv,listSessionSkillSpaces:tK,listSessionSkillsInSpace:nK,listSessions:Iv,mediaContentUrl:ej,previewArtifact:QM,probeRuntimeApps:hj,registerRemoteApp:HM,removeSessionCapability:rj,runGeneratedAgentTestSSE:Ej,runSSE:If,searchSessionPublicSkills:nj,startStudioUpdate:fj,submitMessageFeedback:YM,uploadMedia:ZM,webSearch:aj},Symbol.toStringTag,{value:"Module"})),aK="send_a2ui_json_to_client",oK="validated_a2ui_json",jE="adk_request_credential",yT="transfer_to_agent";function lK(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 hi(){return{blocks:[],liveStart:0}}const bT=e=>e.functionCall??e.function_call,DE=e=>e.functionResponse??e.function_response;function cK(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function uK(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function xj(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 l=r.inlineData??r.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:uK(l.data),name:l.displayName??l.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 PE(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 dK=new Set(["llm","sequential","parallel","loop","a2a"]);function fK(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 l=s.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&dK.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 hK(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 pK(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const r of t)n.files.some(s=>s.filename===r.filename&&s.version===r.version)||n.files.push(r);return}e.push({kind:"artifact",files:t})}function ET(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 pp(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Xc(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let r=e.liveStart;const s=((l=t.content)==null?void 0:l.parts)??[],i=s.some(p=>bT(p)||DE(p));if(t.partial&&!i){for(const p of s){const m=PE(p);typeof m=="string"&&m&&ET(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:r}}n.length=r;for(const p of s){const m=bT(p),g=DE(p),w=xj([p]),y=PE(p);if(typeof y=="string"&&y)ET(n,p.thought?"thinking":"text",y);else if(w.length)pp(n),hK(n,w);else if(m)if(pp(n),m.name===yT){const b=cK(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:b,done:!1})}else if(m.name===jE){const b=m.args??{},x=b.authConfig??b.auth_config??b,k=String(b.functionCallId??b.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:k,authUri:lK(x),authConfig:x,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(g){if(pp(n),g.name===yT)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="agent-transfer"&&!x.done){x.done=!0;break}}if(g.name===jE)for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="auth"&&!x.done){x.done=!0;break}}for(let b=n.length-1;b>=0;b--){const x=n[b];if(x.kind==="tool"&&!x.done&&x.name===g.name){x.done=!0,x.response=g.response;break}}if(g.name===aK){const b=((d=g.response)==null?void 0:d[oK])??[];if(b.length){const x=n[n.length-1];x&&x.kind==="a2ui"?x.messages.push(...b):n.push({kind:"a2ui",messages:b})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&pK(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),pp(n),r=n.length,{blocks:n,liveStart:r}}function mK(e,t={}){var s,i;const n=[];let r=hi();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=DE(p))==null?void 0:m.name)===jE})){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 g=n[p].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const u=c.map(PE).filter(p=>!!p).join(""),d=xj(c),f=fK(c);if(!u&&!d.length&&!f){r=hi();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=hi()}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=hi()),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 l=a.meta,c=l==null?void 0:l.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"||(l.feedback=u)}return n}function gK(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 yK=50,xT=48;function bK(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 EK(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 xK(e,t,n){const r=Math.max(0,t-xT),s=Math.min(e.length,t+n+xT);return(r>0?"…":"")+e.slice(r,s).trim()+(s{var c;if((c=l.events)!=null&&c.length)return l;try{return await ig(t,e,l.id)}catch{return l}})),a=[];for(const l of i)for(const{text:c,role:u,ts:d}of bK(l)){const f=c.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:EK(l),snippet:xK(c,f,r.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,yK)}async function vK(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await aj(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:r,results:s,error:i}=n;return r?i?{results:[],note:i}:{results:s.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function _K(e,t,n,r){if(!t||!r.trim())return{results:[]};const s=await ij(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,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:i,sourceType:s.sourceType}:{type:"memory",index:l,content:a.content,sourceName:i,sourceType:s.sourceType,author:a.author,ts:a.timestamp})}}async function kK(e,t,n){return e==="session"?{results:await wK(n.userId,n.appId,t)}:e==="web"?vK(n.appId,t):_K(e,n.appId,n.userId,t)}function wj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function NK({open:e}){return o.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:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function SK({onClick:e}){return o.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"搜索",title:"搜索",children:[o.jsx(wj,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function TK(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 ag(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 wT(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 AK({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:s,onOpenSession:i}){var U,C;const[a,l]=E.useState("session"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(!1),_=E.useRef(0),k=E.useRef(null),N=TK(t,n,r),T=N.find(M=>M.id===a),S=a==="knowledge"?(U=n==null?void 0:n.components)==null?void 0:U.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;E.useEffect(()=>{_.current+=1,l("session"),f([]),p(void 0),y(!1),g(!1),x(!1)},[t]),E.useEffect(()=>{if(!b)return;function M(O){var D;(D=k.current)!=null&&D.contains(O.target)||x(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[b]);async function R(M,O){var W;const D=M.trim();if(!D||!((W=N.find(P=>P.id===O))!=null&&W.ready))return;const A=++_.current;g(!0),y(!0);let H;try{H=await kK(O,D,{userId:e,appId:t})}catch(P){const te=P instanceof Error?P.message:String(P);H={results:[],note:`搜索失败:${te}`}}A===_.current&&(f(H.results),p(H.note),g(!1))}function I(M){_.current+=1,u(M),f([]),p(void 0),y(!1),g(!1)}function j(M){_.current+=1,l(M),x(!1),f([]),p(void 0),y(!1),g(!1)}const F=!!(T!=null&&T.ready),Y=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?ag(S.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:k,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>x(M=>!M),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(NK,{open:b})]}),b&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:N.map(M=>{var A,H;const O=M.id==="knowledge"?(A=n==null?void 0:n.components)==null?void 0:A.find(W=>W.source==="knowledgebase"||W.kind==="knowledgebase"):M.id==="memory"?(H=n==null?void 0:n.components)==null?void 0:H.find(W=>W.source==="long_term_memory"||W.kind==="memory"):void 0,D=O?[O.name,O.backend?ag(O.backend):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===M.id,disabled:!M.ready,onClick:()=>j(M.id),children:[o.jsx("span",{children:M.label}),D&&o.jsx("small",{children:D})]},M.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:M=>I(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),R(c,a))},placeholder:Y,disabled:!F,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void R(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx($t,{className:"icon spin"}):o.jsx(wj,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:F?w?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&w?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((M,O)=>o.jsx(CK,{result:M,agentLabel:s,onOpen:i},O)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function CK({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(MM,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(h0,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(Ev,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(vT,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${ag(e.sourceType)}`:"",e.ts?` · ${wT(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function vT({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.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 Bv="/assets/volcengine-DM14a-L-.svg",_T="(max-width: 860px)";function IK(){return o.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:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--left",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye sidebar-agent-face__eye--right",d:"M15.5 10.7v2"})]})}function RK(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 OK={admin:"管理员",developer:"开发者",user:"普通用户"};function kT({role:e}){const t=OK[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function LK({version:e,onClose:t}){return E.useEffect(()=>{const n=r=>{r.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),vs.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(Ar,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function MK({access:e,userInfo:t,version:n,onLogout:r}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState("");if(!t)return null;const d=DV(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=RK(d||f||h),m=PV(t),g=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(w=>!w),title:f?`${d} +${f}`:d,children:[o.jsxs("span",{className:`account-avatar${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${g?" has-image":""}`,style:p,children:[h,g?o.jsx("img",{className:"account-avatar-image",src:g,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(g)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(kT,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),l(!0)},children:[o.jsx(yo,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{i(!1),r()},children:[o.jsx(cV,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(LK,{version:n,onClose:()=>l(!1)}):null]})}function jK({branding:e,sessions:t,currentSessionId:n,features:r,access:s,streamingSids:i,onNewChat:a,onSearch:l,onQuickCreate:c,onSkillCenter:u,onAddAgent:d,onMyAgents:f,onPickSession:h,onDeleteSession:p,userInfo:m,version:g,onLogout:w}){const y=R=>(r==null?void 0:r[R])!==!1,[b,x]=E.useState(null),_=E.useRef(typeof window<"u"&&window.matchMedia(_T).matches),[k,N]=E.useState(_.current),T=[...t].sort((R,I)=>(I.lastUpdateTime??0)-(R.lastUpdateTime??0)),S=()=>{_.current=!1,N(R=>!R),x(null)};return E.useEffect(()=>{const R=window.matchMedia(_T),I=j=>{j.matches?N(F=>F||(_.current=!0,!0)):_.current&&(_.current=!1,N(!1))};return R.addEventListener("change",I),()=>R.removeEventListener("change",I)},[]),o.jsxs("aside",{className:`sidebar ${k?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:a,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:S,"aria-label":k?"展开侧边栏":"收起侧边栏",title:k?"展开侧边栏":"收起侧边栏",children:k?o.jsx(gV,{className:"icon"}):o.jsx(mV,{className:"icon"})})]}),y("newChat")&&o.jsxs("button",{className:"new-chat new-chat--conversation",onClick:a,"aria-label":"新会话",title:"新会话",children:[o.jsx(Nr,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:"new-chat new-chat--agents",onClick:f,"aria-label":"智能体",title:"智能体",children:[o.jsx(IK,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),y("search")&&o.jsx(SK,{onClick:l})]}),y("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),y("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:a,"aria-label":"新建会话",title:"新建会话",children:o.jsx(Nr,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[T.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),T.map(R=>{const I=gK(R.events);return o.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>h(R.id),title:I,children:[(i==null?void 0:i.has(R.id))&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:I})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>x(j=>j===R.id?null:R.id),children:o.jsx(Yz,{className:"icon"})}),b===R.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>x(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{x(null),p(R.id)},children:[o.jsx(Vi,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),o.jsx(MK,{access:s,userInfo:m,version:g,onLogout:w})]})}const vj="veadk_agentkit_connections";function Ls(){try{const e=localStorage.getItem(vj);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function b0(e){try{localStorage.setItem(vj,JSON.stringify(e))}catch{}}function bo(e,t){return`agentkit:${e}:${t}`}function _j(e){try{return new URL(e).host}catch{return e}}function _u(e){zM();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)HM(bo(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function kj(e,t,n,r,s,i){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:s,currentVersion:i},l=Ls(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,b0(l),_u(l),a}async function og(e,t,n,r){let s;try{s=await hj(e,n)}catch(l){throw l instanceof oh&&lg(e),l}if(!s||s.length===0)throw lg(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(s.map(l=>[l,t])),a=kj(e,t,n,s,i,r);return bo(a.id,s[0])}async function Nj(e,t,n,r){const s=t.trim().replace(/\/+$/,""),i=await g0(s,n.trim()),a={id:Date.now().toString(36),name:e.trim()||_j(s),base:s,apiKey:n.trim(),apps:i,appLabels:r&&i.length>0?{[i[0]]:r}:void 0},l=[...Ls().filter(c=>c.base!==s),a];return b0(l),_u(l),a}function DK(e){const t=Ls().filter(n=>n.id!==e);return b0(t),_u(t),t}function lg(e){const t=Ls().filter(n=>n.runtimeId!==e);return b0(t),_u(t),t}function Sj(e,t){const n=e.map(s=>({id:s,label:s,app:s,remote:!1})),r=t.flatMap(s=>s.apps.map(i=>{var l;const a=((l=s.appLabels)==null?void 0:l[i])??i;return{id:bo(s.id,i),label:a,app:i,remote:!0,host:s.runtimeId?s.name:_j(s.base??""),runtimeId:s.runtimeId,region:s.region,currentVersion:s.currentVersion}}));return[...n,...r]}const NT=Object.freeze(Object.defineProperty({__proto__:null,addConnection:Nj,addRuntimeConnection:kj,buildAgentEntries:Sj,connectRuntime:og,loadConnections:Ls,registerConnections:_u,remoteAppId:bo,removeConnection:DK,removeRuntimeConnection:lg},Symbol.toStringTag,{value:"Module"}));function Qc({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.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 BE({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function PK({className:e="icon"}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsxs("g",{transform:"translate(0 2)",children:[o.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"}),o.jsx("path",{d:"M18.7 3.8v3.4M20.4 5.5H17"})]})})}function Tj({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),o.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),o.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),o.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),o.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const ST=15,BK=1e4,FK=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function UK(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function Aj(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 ib(e,t=BK){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 $K({open:e,onClose:t,variant:n="drawer",anchorTop:r=0,agentsSource:s,localApps:i,currentId:a,currentRuntime:l,runtimeScope:c,onSelect:u}){const[d,f]=E.useState([]),[h,p]=E.useState([""]),[m,g]=E.useState(0),[w,y]=E.useState(c==="mine"),[b,x]=E.useState(null),[_,k]=E.useState("cn-beijing"),[N,T]=E.useState(!1),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(null),[L,U]=E.useState(new Set),[C,M]=E.useState(),[O,D]=E.useState("agent"),A=E.useRef(!1);function H(ee){M(Ee=>(Ee==null?void 0:Ee.runtimeId)===ee.runtimeId?void 0:{runtimeId:ee.runtimeId,name:ee.name,region:ee.region})}const W=E.useCallback(async ee=>{if(d[ee]){g(ee);return}const Ee=h[ee];if(Ee!==void 0){T(!0),R("");try{const ge=await ib(Ic({nextToken:Ee,pageSize:ST,region:_,scope:"all"}));f(xe=>{const we=[...xe];return we[ee]=ge.runtimes,we}),p(xe=>{const we=[...xe];return ge.nextToken&&(we[ee+1]=ge.nextToken),we}),g(ee)}catch(ge){R(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[h,d,_]),P=E.useCallback(async()=>{T(!0),R("");try{const ee=[];let Ee="";do{const ge=await ib(Ic({scope:"mine",nextToken:Ee,pageSize:100,region:_}));ee.push(...ge.runtimes),Ee=ge.nextToken}while(Ee&&ee.length<2e3);x(ee)}catch(ee){R(ee instanceof Error?ee.message:String(ee))}finally{T(!1)}},[_]);E.useEffect(()=>{y(c==="mine"),f([]),p([""]),g(0),x(null),A.current=!1},[c]),E.useEffect(()=>{e&&s==="cloud"&&!w&&!A.current&&(A.current=!0,W(0))},[e,s,w,W]),E.useEffect(()=>{w&&b===null&&s==="cloud"&&P()},[w,b,s,P]),E.useEffect(()=>{e&&(M(void 0),D("agent"))},[e]);function te(){U(new Set),w?(x(null),P()):(f([]),p([""]),g(0),A.current=!0,T(!0),R(""),ib(Ic({nextToken:"",pageSize:ST,region:_,scope:"all"})).then(ee=>{f([ee.runtimes]),p(ee.nextToken?["",ee.nextToken]:[""])}).catch(ee=>R(ee instanceof Error?ee.message:String(ee))).finally(()=>T(!1)))}function X(ee){ee!==_&&(k(ee),f([]),p([""]),g(0),x(null),U(new Set),A.current=!1)}const ne=!w&&(d[m+1]!==void 0||h[m+1]!==void 0);function ce(ee){Y(ee.runtimeId),og(ee.runtimeId,ee.name,ee.region).then(async Ee=>{await u(Ee),t()}).catch(Ee=>{if(Ee instanceof oh){R(Ee.message);return}if(Ee instanceof qa){Ee.unsupported&&U(ge=>new Set(ge).add(ee.runtimeId)),R(Ee.message);return}U(ge=>new Set(ge).add(ee.runtimeId))}).finally(()=>Y(null))}if(!e)return null;const fe=(w?b??[]:d[m]??[]).filter(ee=>I?ee.name.toLowerCase().includes(I.toLowerCase()):!0);return o.jsxs(o.Fragment,{children:[n==="drawer"?o.jsx("div",{className:"menu-scrim",onClick:t}):null,o.jsxs("div",{className:`agentsel agentsel--${n}${C&&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:[o.jsxs("div",{className:"agentsel-main",children:[o.jsxs("div",{className:"agentsel-head",children:[o.jsxs("span",{className:"agentsel-title",children:[o.jsx(Qc,{})," 选择 Agent"]}),o.jsxs("div",{className:"agentsel-head-actions",children:[s==="cloud"&&o.jsx("button",{className:"agentsel-refresh",onClick:te,title:"刷新",disabled:N,children:o.jsx(DM,{className:`icon ${N?"spin":""}`})}),o.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:o.jsx(Ar,{className:"icon"})})]})]}),s==="local"?o.jsx("div",{className:"agentsel-body",children:i.length===0?o.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):o.jsx("ul",{className:"agentsel-list",children:i.map(ee=>o.jsx("li",{children:o.jsxs("button",{className:`agentsel-item ${ee===a?"active":""}`,onClick:()=>{u(ee),t()},children:[o.jsx(Qc,{}),o.jsx("span",{className:"agentsel-item-name",children:ee})]})},ee))})}):o.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[o.jsxs("div",{className:"agentsel-tools",children:[o.jsxs("div",{className:"agentsel-search",children:[o.jsx(Cf,{className:"icon"}),o.jsx("input",{value:I,onChange:ee=>j(ee.target.value),placeholder:"搜索 Runtime 名称"})]}),o.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:FK.map(ee=>o.jsx("button",{type:"button",className:_===ee.value?"active":"","aria-pressed":_===ee.value,onClick:()=>X(ee.value),children:ee.label},ee.value))}),c==="all"&&o.jsxs("label",{className:"agentsel-mine",children:[o.jsx("input",{type:"checkbox",checked:w,onChange:ee=>y(ee.target.checked)}),"只看我创建的"]})]}),S&&o.jsx("div",{className:"agentsel-error",children:S}),o.jsxs("div",{className:"agentsel-listwrap",children:[fe.length===0&&!N?o.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):o.jsx("ul",{className:"agentsel-list",children:fe.map(ee=>{const Ee=L.has(ee.runtimeId),ge=F===ee.runtimeId,xe=(l==null?void 0:l.runtimeId)===ee.runtimeId,we=(C==null?void 0:C.runtimeId)===ee.runtimeId;return o.jsx("li",{children:o.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${xe?"active":""} ${we?"is-previewed":""}`,title:ee.runtimeId,children:[o.jsx(Tj,{}),o.jsxs("div",{className:"agentsel-item-main",children:[o.jsx("span",{className:"agentsel-item-name",title:ee.name,children:ee.name}),o.jsxs("div",{className:"agentsel-item-meta",children:[o.jsx("span",{className:`agentsel-status is-${Ee?"bad":GK(ee.status)}`,children:Ee?"不支持":Cj(ee.status)}),ee.isMine&&o.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),o.jsxs("div",{className:"agentsel-item-actions",children:[o.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||xe,onClick:()=>ce(ee),children:ge?"连接中…":xe?"已连接":Ee?"重试":"连接"}),n==="drawer"?o.jsx("button",{type:"button",className:`agentsel-info ${we?"active":""}`,"aria-label":`查看 ${ee.name} 信息`,"aria-pressed":we,title:"查看信息",onClick:()=>H(ee),children:o.jsx(yo,{className:"icon"})}):null]})]})},ee.runtimeId)})}),N&&o.jsxs("div",{className:"agentsel-loading",children:[o.jsx($t,{className:"icon spin"})," 加载中…"]})]}),o.jsxs("div",{className:"agentsel-pager",children:[o.jsx("button",{disabled:w||m===0||N,onClick:()=>void W(m-1),"aria-label":"上一页",children:o.jsx(Hz,{className:"icon"})}),o.jsx("span",{className:"agentsel-pager-label",children:w?1:m+1}),o.jsx("button",{disabled:w||!ne||N,onClick:()=>void W(m+1),"aria-label":"下一页",children:o.jsx($s,{className:"icon"})})]})]})]}),n==="drawer"&&s==="cloud"&&C&&o.jsx(KK,{runtime:C,tab:O,onTabChange:D})]})]})}const HK={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function zK(e){return HK[e.toLowerCase()]??e}function VK(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 KK({runtime:e,tab:t,onTabChange:n}){return o.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[o.jsx("div",{className:"agentsel-head agentsel-preview-head",children:o.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[o.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),o.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),o.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),o.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:o.jsx(YK,{runtime:e})}),o.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:o.jsx(WK,{runtime:e})})]})}function YK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return n(null),s(!0),a(""),jv(l,c).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(Aj(h))}).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=(t==null?void 0:t.components)??[];return o.jsx("div",{className:"agentsel-detail-body",children:r?o.jsxs("div",{className:"agentsel-panel-state",children:[o.jsx($t,{className:"icon spin"})," 读取 Agent 信息…"]}):i?o.jsxs("div",{className:"agentsel-panel-empty",children:[o.jsx("span",{children:"暂时无法读取 Agent 信息"}),o.jsx("small",{title:i,children:i})]}):t?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"agentsel-identity",children:[o.jsx(Qc,{className:"agentsel-identity-icon"}),o.jsxs("div",{className:"agentsel-identity-copy",children:[o.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsx("h3",{children:"描述"}),o.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&o.jsx(TT,{icon:o.jsx(jM,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&o.jsx(TT,{icon:o.jsx(BE,{}),title:"工具",values:t.tools}),o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(PK,{})," 技能"]}),t.skillsPreviewSupported?t.skills.length>0?o.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>o.jsxs("div",{className:"agentsel-info-list-item",children:[o.jsx("strong",{title:d.name,children:d.name}),d.description&&o.jsx("span",{title:d.description,children:d.description})]},d.name))}):o.jsx("div",{className:"agentsel-info-empty",children:"未配置"}):o.jsx("div",{className:"agentsel-info-empty",children:"暂不支持预览"})]}),u.length>0&&o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[o.jsx(AM,{className:"icon"})," 挂载组件"]}),o.jsx("div",{className:"agentsel-info-list",children:u.map((d,f)=>o.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[o.jsxs("div",{className:"agentsel-component-head",children:[o.jsx("strong",{title:d.name,children:d.name}),o.jsxs("span",{children:[zK(d.kind),d.backend?` · ${VK(d.backend)}`:""]})]}),d.description&&o.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&&o.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function TT({icon:e,title:t,values:n}){return o.jsxs("section",{className:"agentsel-info-section",children:[o.jsxs("h3",{children:[e,t]}),o.jsx("div",{className:"agentsel-chips",children:n.map((r,s)=>o.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${s}`))})]})}function WK({runtime:e}){const[t,n]=E.useState(null),[r,s]=E.useState(!0),[i,a]=E.useState(""),l=e.runtimeId,c=e.region;E.useEffect(()=>{let d=!0;return s(!0),a(""),n(null),Dv(l,c).then(f=>d&&n(f)).catch(f=>d&&a(Aj(f instanceof Error?f.message:String(f)))).finally(()=>d&&s(!1)),()=>{d=!1}},[l,c]);const u=[];if(t){t.model&&u.push(["模型",t.model]),t.description&&u.push(["描述",t.description]),t.status&&u.push(["状态",Cj(t.status)]),t.region&&u.push(["区域",UK(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 o.jsxs("div",{className:"agentsel-detail-body",children:[o.jsxs("div",{className:"agentsel-runtime-identity",children:[o.jsx(Tj,{}),o.jsxs("div",{children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?o.jsxs("div",{className:"agentsel-apps-note",children:[o.jsx($t,{className:"icon spin"})," 读取详情…"]}):i?o.jsx("div",{className:"agentsel-error",children:i}):t?o.jsxs(o.Fragment,{children:[o.jsx("dl",{className:"agentsel-kv",children:u.map(([d,f])=>o.jsxs("div",{className:"agentsel-kv-row",children:[o.jsx("dt",{children:d}),o.jsx("dd",{children:f})]},d))}),t.envs.length>0&&o.jsxs("div",{className:"agentsel-envs",children:[o.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>o.jsxs("div",{className:"agentsel-env",children:[o.jsx("span",{className:"agentsel-env-k",children:d.key}),o.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function GK(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 qK={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function Cj(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return qK[t]??(e||"-")}function XK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l,title:c,titleLeading:u,crumbs:d,rightContent:f}){return o.jsxs("div",{className:"navbar",children:[o.jsxs("div",{className:"navbar-left",children:[o.jsx("div",{className:"navbar-default",children:d&&d.length>0?o.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:d.map((h,p)=>o.jsxs(E.Fragment,{children:[p>0&&o.jsx($s,{className:"crumb-sep"}),h.onClick?o.jsx("button",{className:"crumb crumb-link",onClick:h.onClick,children:h.label}):o.jsx("span",{className:"crumb crumb-current",children:h.label})]},p))}):c?o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx("div",{className:"navbar-title",title:c,children:c})]}):o.jsxs("div",{className:"navbar-title-group",children:[u,o.jsx(QK,{appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l})]})}),o.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),o.jsxs("div",{className:"navbar-right",children:[o.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),f]})]})}function QK({appName:e,onAppChange:t,agentLabel:n,agentsSource:r,localApps:s,currentRuntime:i,runtimeScope:a,onBrowseAgents:l}){const[c,u]=E.useState(!1),d=h=>n?n(h):h;if(r==="cloud")return o.jsxs("div",{className:"agent-switch",children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),e&&l?o.jsx("button",{type:"button",className:"agent-switch-action","aria-label":"切换智能体",title:"切换智能体",onClick:l,children:o.jsx(Bz,{"aria-hidden":"true"})}):null]});function f(){u(!1)}return o.jsxs("div",{className:"agent-dd",children:[o.jsxs("button",{className:"agent-dd-trigger",onClick:()=>u(h=>!h),children:[o.jsx("span",{className:"agent-dd-current",children:e?d(e):"选择 Agent"}),o.jsx(yv,{className:`agent-dd-chev ${c?"open":""}`})]}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:f}),o.jsx($K,{open:!0,variant:"navbar",agentsSource:r,localApps:s,currentId:e,currentRuntime:i,runtimeScope:a,onSelect:async h=>{await t(h),f()},onClose:f})]})]})}async function lh(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,vu)});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 Ij(){return(await lh("/web/skill-spaces?region=all")).items||[]}async function ZK(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),lh(`/web/skill-spaces?${t.toString()}`)}async function Rj(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function JK(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),lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function eY(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 lh(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function tY(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 nY(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}const rY="https://ark.cn-beijing.volces.com/api/v3/",lm=[{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:rY}],Zc=[],td=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],Ei={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},Oj=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:Ei.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:Ei.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:Ei.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],dl=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Zc},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Zc},{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"}]}],FE=[{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}]}],UE=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:lm,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},...lm],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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:Zc},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],Jc="viking",$E=[{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:Zc},{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},...lm],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Zc,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],HE=[{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:[...Zc,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],sY={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function zE(e){const t=dl.find(n=>n.id===e||n.toolNames.includes(e));return sY[e]??(t==null?void 0:t.label)??e}function AT(e){const t=dl.find(r=>r.id===e||r.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function iY(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function aY(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function CT(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Lj({title:e,description:t,icon:n,wide:r=!1,onClose:s,children:i}){const a=E.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return E.useEffect(()=>{const l=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=l}},[s]),vs.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:s}),o.jsxs("section",{className:`session-capability-dialog${r?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:s,children:o.jsx(iY,{})})]}),i]})]}),document.body)}function cm({value:e,placeholder:t,label:n,onChange:r,autoFocus:s=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(aY,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:s,onChange:i=>r(i.target.value)})]})}function oY({agentName:e,tools:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState(""),[c,u]=E.useState(""),d=E.useMemo(()=>new Set(n),[n]),f=E.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${zE(m)} ${m} ${AT(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await s({kind:"tool",name:p});u(""),m&&i()};return o.jsx(Lj,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(BE,{}),onClose:i,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(cm,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),g=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(BE,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:zE(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:AT(p)})]}),o.jsx("button",{type:"button",disabled:m||r||!!c,onClick:()=>void h(p),children:m?"已添加":g?"添加中…":"添加"})]},p)})})]})})}function lY({appName:e,agentName:t,selectedNames:n,mutating:r,onAdd:s,onClose:i}){const[a,l]=E.useState("public"),[c,u]=E.useState(""),[d,f]=E.useState([]),[h,p]=E.useState(0),[m,g]=E.useState(!0),[w,y]=E.useState(""),[b,x]=E.useState([]),[_,k]=E.useState(null),[N,T]=E.useState([]),[S,R]=E.useState(""),[I,j]=E.useState(""),[F,Y]=E.useState(!0),[L,U]=E.useState(!1),[C,M]=E.useState(""),[O,D]=E.useState(""),A=E.useMemo(()=>new Set(n),[n]);E.useEffect(()=>{if(a!=="public")return;let X=!0;const ne=window.setTimeout(()=>{g(!0),y(""),nj(e,c.trim()).then(ce=>{X&&(f(ce.items),p(ce.totalCount))}).catch(ce=>{X&&(f([]),p(0),y(ce instanceof Error?ce.message:"搜索 Skill Hub 失败"))}).finally(()=>{X&&g(!1)})},250);return()=>{X=!1,window.clearTimeout(ne)}},[e,c,a]),E.useEffect(()=>{if(a!=="agentkit")return;let X=!0;return Y(!0),M(""),Ij().then(ne=>{X&&(x(ne),k(ne[0]??null))}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取 Skill Space 失败")}).finally(()=>{X&&Y(!1)}),()=>{X=!1}},[a]),E.useEffect(()=>{if(a!=="agentkit")return;if(!_){T([]);return}let X=!0;return U(!0),M(""),Rj(_.id,_.region).then(ne=>{X&&T(ne)}).catch(ne=>{X&&M(ne instanceof Error?ne.message:"读取技能失败")}).finally(()=>{X&&U(!1)}),()=>{X=!1}},[_,a]);const H=E.useMemo(()=>{const X=S.trim().toLowerCase();return X?b.filter(ne=>`${ne.name} ${ne.id} ${ne.description}`.toLowerCase().includes(X)):b},[S,b]),W=E.useMemo(()=>{const X=I.trim().toLowerCase();return X?N.filter(ne=>`${ne.skillName} ${ne.skillDescription}`.toLowerCase().includes(X)):N},[I,N]),P=async X=>{if(!_)return;D(X.skillId);const ne=await s({kind:"skill",name:X.skillName,skillSourceId:_.id,description:X.skillDescription,version:X.version});D(""),ne&&i()},te=async X=>{D(X.slug);const ne=await s({kind:"skill",name:X.name,skillSourceId:`findskill:${X.slug}`,description:X.description,version:X.version||X.updatedAt});D(""),ne&&i()};return o.jsx(Lj,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:i,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(cm,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:w?o.jsx("div",{className:"session-capability-error",children:w}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(X=>{const ne=A.has(X.name),ce=O===X.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.name}),o.jsx("span",{children:X.description||"暂无描述"}),o.jsxs("small",{children:[X.sourceRepo||X.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),X.downloadCount.toLocaleString()," 次下载",X.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),X.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void te(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},X.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:b.length})]}),o.jsx(cm,{value:S,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:R,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:F?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):H.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):H.map(X=>o.jsx("button",{type:"button",className:`session-skill-space${(_==null?void 0:_.id)===X.id?" is-active":""}`,onClick:()=>{k(X),j("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:X.name||X.id}),o.jsx("small",{children:X.description||X.id}),o.jsxs("em",{children:[X.skillCount??0," 个技能"]})]})},`${X.projectName??"default"}:${X.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:_==null?void 0:_.name,children:(_==null?void 0:_.name)||"选择 Skill Space"}),o.jsx("span",{children:N.length})]}),o.jsx(cm,{value:I,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:j})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):_?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):W.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):W.map(X=>{const ne=A.has(X.skillName),ce=O===X.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:X.skillName}),o.jsx("span",{children:X.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",X.version||"—"]})]}),o.jsx("button",{type:"button",disabled:ne||r||!!O,onClick:()=>void P(X),children:ne?"已添加":ce?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(CT,{}),"添加"]})})]},`${X.skillId}:${X.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function Ea({as:e="span",className:t="",duration:n=4,spread:r=20,children:s,style:i,...a}){const l=Math.min(Math.max(r,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...i,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:s})}const cY={llm:"LLM",sequential:"顺序",parallel:"并行",loop:"循环",a2a:"A2A"};function Mj(e){return 1+e.children.reduce((t,n)=>t+Mj(n),0)}function eu(e){return e.id||e.name}function uY(e,t){const n=eu(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 jj(e,t=!0){return{...e,id:eu(e),name:uY(e,t),children:e.children.map(n=>jj(n,!1))}}function Dj(e,t){t.set(eu(e),e.name||eu(e)),e.children.forEach(n=>Dj(n,t))}function dY(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function fY(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function Pj({node:e,activeAgent:t,seen:n,path:r}){const s=eu(e),i=!!s&&s===t,a=!!s&&!i&&r.has(s),l=!!s&&!i&&!a&&n.has(s);return o.jsxs("div",{className:"topo-branch",children:[o.jsxs("div",{className:`topo-node topo-type-${e.type} ${i?"is-active":""} ${a?"is-onpath":""} ${l?"is-done":""}`,title:e.description||e.name,children:[o.jsx(Qc,{className:"topo-icon"}),o.jsx("span",{className:"topo-name",children:e.name||"未命名 Agent"}),o.jsx("span",{className:"topo-badge",children:cY[e.type]??"Agent"})]}),i&&e.type==="a2a"&&o.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&o.jsx("div",{className:"topo-children",children:e.children.map(c=>o.jsx(Pj,{node:c,activeAgent:t,seen:n,path:r},eu(c)))})]})}function ab({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function Bj({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i=[],variant:a="rail",capabilities:l=null,capabilityLoading:c=!1,capabilityMutating:u=!1,builtinTools:d=[],onAddCapability:f,onRemoveCapability:h}){const[p,m]=E.useState(null);if(n&&!t)return o.jsx("aside",{className:`topo is-loading${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(Ea,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const g=jj(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:[]}),w=(l==null?void 0:l.tools)??dY(t.tools).map(k=>({id:`base:tool:${k}`,kind:"tool",name:k,custom:!1})),y=(l==null?void 0:l.skills)??fY(t.skills).map(k=>({id:`base:skill:${k.name}`,kind:"skill",name:k.name,description:k.description,custom:!1})),b=!!(l&&f&&h),x=new Set(i),_=new Map;return Dj(g,_),o.jsxs("aside",{className:`topo${a==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(ab,{title:"工具",count:w.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:w.length>0?o.jsx("div",{className:"topo-tool-list",children:w.map(k=>o.jsxs("div",{className:"topo-tool",title:k.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:zE(k.name)}),o.jsx("code",{children:k.name})]}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),k.custom&&o.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))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:c||u,onClick:()=>m("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(ab,{title:"技能",count:t.skillsPreviewSupported?y.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?y.length>0?o.jsx("div",{className:"topo-skill-list",children:y.map(k=>o.jsxs("div",{className:"topo-skill",title:k.description||k.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:k.name}),k.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),k.custom&&o.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&&o.jsx("span",{className:"topo-skill-description",children:k.description})]},`${k.name}:${k.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),b&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:c||u,onClick:()=>m("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 拓扑",children:[o.jsx(ab,{title:"拓扑",count:Mj(g)}),o.jsxs("div",{className:"topo-module-scroll topo-topology-scroll",role:"region","aria-label":"Agent 拓扑列表",tabIndex:0,children:[i.length>1&&o.jsx("div",{className:"topo-path","aria-label":"执行路径",children:i.map((k,N)=>o.jsx("span",{className:"topo-path-seg",children:o.jsx("span",{className:N===i.length-1?"topo-path-name is-current":"topo-path-name",children:_.get(k)??k})},`${k}-${N}`))}),o.jsx("div",{className:"topo-tree",children:o.jsx(Pj,{node:g,activeAgent:r,seen:s,path:x})})]})]})]}),p==="tool"&&f&&o.jsx(oY,{agentName:t.name,tools:d,selectedNames:w.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)}),p==="skill"&&f&&o.jsx(lY,{appName:e,agentName:t.name,selectedNames:y.map(k=>k.name),mutating:u,onAdd:f,onClose:()=>m(null)})]})}function hY(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:o.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function pY({appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,onClose:h,returnFocusRef:p}){return E.useEffect(()=>{const m=document.body.style.overflow;document.body.style.overflow="hidden";const g=w=>{w.key==="Escape"&&h()};return document.addEventListener("keydown",g),()=>{var w;document.removeEventListener("keydown",g),document.body.style.overflow=m,(w=p.current)==null||w.focus()}},[h,p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim agent-info-scrim",onClick:h}),o.jsxs("aside",{className:"drawer drawer--agent-info",role:"dialog","aria-modal":"true","aria-labelledby":"agent-info-drawer-title",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{id:"agent-info-drawer-title",className:"drawer-title",children:"Agent 信息"}),o.jsx("div",{className:"drawer-sub",children:"能力与协作拓扑"})]}),o.jsx("button",{type:"button",className:"drawer-close",onClick:h,"aria-label":"关闭 Agent 信息",autoFocus:!0,children:o.jsx(hY,{})})]}),o.jsx("div",{className:"agent-info-drawer-body",children:t||n?o.jsx(Bj,{appName:e,info:t,loading:n,activeAgent:r,seenAgents:s,execPath:i,capabilities:a,capabilityLoading:l,capabilityMutating:c,builtinTools:u,onAddCapability:d,onRemoveCapability:f,variant:"drawer"}):o.jsx("div",{className:"drawer-empty",children:"暂时无法读取 Agent 信息。"})})]})]})}function q1e(){}function IT(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 Fj(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mY=/[$_\p{ID_Start}]/u,gY=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,yY=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,bY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uj={};function X1e(e){return e?mY.test(String.fromCodePoint(e)):!1}function Q1e(e,t){const r=(t||Uj).jsx?yY:gY;return e?r.test(String.fromCodePoint(e)):!1}function RT(e,t){return(Uj.jsx?EY:bY).test(e)}const xY=/[ \t\n\f\r]/g;function wY(e){return typeof e=="object"?e.type==="text"?OT(e.value):!1:OT(e)}function OT(e){return e.replace(xY,"")===""}let ch=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ch.prototype.normal={};ch.prototype.property={};ch.prototype.space=void 0;function $j(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new ch(n,r,t)}function Of(e){return e.toLowerCase()}class cs{constructor(t,n){this.attribute=n,this.property=t}}cs.prototype.attribute="";cs.prototype.booleanish=!1;cs.prototype.boolean=!1;cs.prototype.commaOrSpaceSeparated=!1;cs.prototype.commaSeparated=!1;cs.prototype.defined=!1;cs.prototype.mustUseProperty=!1;cs.prototype.number=!1;cs.prototype.overloadedBoolean=!1;cs.prototype.property="";cs.prototype.spaceSeparated=!1;cs.prototype.space=void 0;let vY=0;const wt=vl(),sr=vl(),VE=vl(),je=vl(),gn=vl(),Rc=vl(),ps=vl();function vl(){return 2**++vY}const KE=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:sr,commaOrSpaceSeparated:ps,commaSeparated:Rc,number:je,overloadedBoolean:VE,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),ob=Object.keys(KE);class Fv extends cs{constructor(t,n,r,s){let i=-1;if(super(t,n),LT(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&TY.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(MT,CY);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!MT.test(i)){let a=i.replace(SY,AY);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Fv}return new s(r,t)}function AY(e){return"-"+e.toLowerCase()}function CY(e){return e.charAt(1).toUpperCase()}const uh=$j([Hj,_Y,Kj,Yj,Wj],"html"),Eo=$j([Hj,kY,Kj,Yj,Wj],"svg");function jT(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Gj(e){return e.join(" ").trim()}var Uv={},DT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,IY=/\n/g,RY=/^\s*/,OY=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LY=/^:\s*/,MY=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jY=/^[;\s]*/,DY=/^\s+|\s+$/g,PY=` +`,PT="/",BT="*",Uo="",BY="comment",FY="declaration";function UY(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 g=m.match(IY);g&&(n+=g.length);var w=m.lastIndexOf(PY);r=~w?m.length-w:r+m.length}function i(){var m={line:n,column:r};return function(g){return g.position=new a(m),u(),g}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var w=g[0];return s(w),e=e.slice(w.length),g}}function u(){c(RY)}function d(m){var g;for(m=m||[];g=f();)g!==!1&&m.push(g);return m}function f(){var m=i();if(!(PT!=e.charAt(0)||BT!=e.charAt(1))){for(var g=2;Uo!=e.charAt(g)&&(BT!=e.charAt(g)||PT!=e.charAt(g+1));)++g;if(g+=2,Uo===e.charAt(g-1))return l("End of comment missing");var w=e.slice(2,g-2);return r+=2,s(w),e=e.slice(g),r+=2,m({type:BY,comment:w})}}function h(){var m=i(),g=c(OY);if(g){if(f(),!c(LY))return l("property missing ':'");var w=c(MY),y=m({type:FY,property:FT(g[0].replace(DT,Uo)),value:w?FT(w[0].replace(DT,Uo)):Uo});return c(jY),y}}function p(){var m=[];d(m);for(var g;g=h();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function FT(e){return e?e.replace(DY,Uo):Uo}var $Y=UY,HY=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.default=VY;const zY=HY($Y);function VY(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,zY.default)(e),s=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:l}=i;s?t(a,l,i):l&&(n=n||{},n[a]=l)}),n}var x0={};Object.defineProperty(x0,"__esModule",{value:!0});x0.camelCase=void 0;var KY=/^--[a-zA-Z0-9_-]+$/,YY=/-([a-z])/g,WY=/^[^-]+$/,GY=/^-(webkit|moz|ms|o|khtml)-/,qY=/^-(ms)-/,XY=function(e){return!e||WY.test(e)||KY.test(e)},QY=function(e,t){return t.toUpperCase()},UT=function(e,t){return"".concat(t,"-")},ZY=function(e,t){return t===void 0&&(t={}),XY(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(qY,UT):e=e.replace(GY,UT),e.replace(YY,QY))};x0.camelCase=ZY;var JY=_m&&_m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},eW=JY(Uv),tW=x0;function YE(e,t){var n={};return!e||typeof e!="string"||(0,eW.default)(e,function(r,s){r&&s&&(n[(0,tW.camelCase)(r,t)]=s)}),n}YE.default=YE;var nW=YE;const rW=Xf(nW),w0=qj("end"),Yi=qj("start");function qj(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 sW(e){const t=Yi(e),n=w0(e);if(t&&n)return{start:t,end:n}}function Kd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$T(e.position):"start"in e||"end"in e?$T(e):"line"in e||"column"in e?WE(e):""}function WE(e){return HT(e&&e.line)+":"+HT(e&&e.column)}function $T(e){return WE(e&&e.start)+"-"+WE(e&&e.end)}function HT(e){return e&&typeof e=="number"?e:1}class Br 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 l=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=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Kd(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}}Br.prototype.file="";Br.prototype.name="";Br.prototype.reason="";Br.prototype.message="";Br.prototype.stack="";Br.prototype.column=void 0;Br.prototype.line=void 0;Br.prototype.ancestors=void 0;Br.prototype.cause=void 0;Br.prototype.fatal=void 0;Br.prototype.place=void 0;Br.prototype.ruleId=void 0;Br.prototype.source=void 0;const $v={}.hasOwnProperty,iW=new Map,aW=/[A-Z]/g,oW=new Set(["table","tbody","thead","tfoot","tr"]),lW=new Set(["td","th"]),Xj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cW(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=yW(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=gW(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"?Eo:uh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Qj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Qj(e,t,n){if(t.type==="element")return uW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return hW(e,t,n);if(t.type==="mdxjsEsm")return fW(e,t);if(t.type==="root")return pW(e,t,n);if(t.type==="text")return mW(e,t)}function uW(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=Jj(e,t.tagName,!1),a=bW(e,t);let l=zv(e,t);return oW.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!wY(c):!0})),Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function dW(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)}Lf(e,t.position)}function fW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lf(e,t.position)}function hW(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Eo,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Jj(e,t.name,!0),a=EW(e,t),l=zv(e,t);return Zj(e,a,i,t),Hv(a,l),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function pW(e,t,n){const r={};return Hv(r,zv(e,t)),e.create(t,e.Fragment,r,n)}function mW(e,t){return t.value}function Zj(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function gW(e,t,n){return r;function r(s,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function yW(e,t){return n;function n(r,s,i,a){const l=Array.isArray(i.children),c=Yi(r);return t(s,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function bW(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&$v.call(t.properties,s)){const i=xW(e,s,t.properties[s]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&lW.has(t.tagName)?r=l:n[a]=l}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function EW(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 l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Lf(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 l=r.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else Lf(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function zv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:iW;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?(xs(e,e.length,0,t),e):t}const KT={}.hasOwnProperty;function t3(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 xi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yr=xo(/[A-Za-z]/),jr=xo(/[\dA-Za-z]/),CW=xo(/[#-'*+\--9=?A-Z^-~]/);function cg(e){return e!==null&&(e<32||e===127)}const GE=xo(/\d/),IW=xo(/[\dA-Fa-f]/),RW=xo(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function Tt(e){return e===-2||e===-1||e===32}const v0=xo(new RegExp("\\p{P}|\\p{S}","u")),fl=xo(/\s/);function xo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Nu(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),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 Mt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return Tt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Tt(c)&&i++a))return;const T=t.events.length;let S=T,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(y(r),N=T;Nx;){const k=n[_];t.containerState=k[1],k[0].exit.call(t,e)}n.length=x}function b(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function DW(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tu(e){if(e===null||un(e)||fl(e))return 1;if(v0(e))return 2}function _0(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};WT(f,-c),WT(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={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:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ds(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ds(u,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),u=Ds(u,_0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ds(u,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Ds(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,xs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&Tt(N)?Mt(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||it(N)?e.check(GT,g,_)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||it(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),x)}function _(N){return e.exit("codeFenced"),t(N)}function k(N,T,S){let R=0;return I;function I(U){return N.enter("lineEnding"),N.consume(U),N.exit("lineEnding"),j}function j(U){return N.enter("codeFencedFence"),Tt(U)?Mt(N,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===l?(N.enter("codeFencedFenceSequence"),Y(U)):S(U)}function Y(U){return U===l?(R++,N.consume(U),Y):R>=a?(N.exit("codeFencedFenceSequence"),Tt(U)?Mt(N,L,"whitespace")(U):L(U)):S(U)}function L(U){return U===null||it(U)?(N.exit("codeFencedFence"),T(U)):S(U)}}}function GW(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 cb={name:"codeIndented",tokenize:XW},qW={partial:!0,tokenize:QW};function XW(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Mt(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):it(u)?e.attempt(qW,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||it(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function QW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):it(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Mt(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):it(a)?s(a):n(a)}}const ZW={name:"codeText",previous:eG,resolve:JW,tokenize:tG};function JW(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&&nd(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),nd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nd(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 o3(e,t,n,r,s,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||cg(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||it(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!d&&(y===null||y===41||un(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_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):it(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||it(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Tt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function c3(e,t,n,r,s,i){let a;return l;function l(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):it(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Mt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||it(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 Yd(e,t){let n;return r;function r(s){return it(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Tt(s)?Mt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const cG={name:"definition",tokenize:dG},uG={partial:!0,tokenize:fG};function dG(e,t,n){const r=this;let s;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return l3.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=xi(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 un(p)?Yd(e,u)(p):u(p)}function u(p){return o3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(uG,f,f)(p)}function f(p){return Tt(p)?Mt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||it(p)?(e.exit("definition"),r.parser.defined.push(s),t(p)):n(p)}}function fG(e,t,n){return r;function r(l){return un(l)?Yd(e,s)(l):n(l)}function s(l){return c3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return Tt(l)?Mt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||it(l)?t(l):n(l)}}const hG={name:"hardBreakEscape",tokenize:pG};function pG(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const mG={name:"headingAtx",resolve:gG,tokenize:yG};function gG(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"},xs(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function yG(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||un(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||it(d)?(e.exit("atxHeading"),t(d)):Tt(d)?Mt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||un(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const bG=["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"],XT=["pre","script","style","textarea"],EG={concrete:!0,name:"htmlFlow",resolveTo:vG,tokenize:_G},xG={partial:!0,tokenize:NG},wG={partial:!0,tokenize:kG};function vG(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 _G(e,t,n){const r=this;let s,i,a,l,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,g):P===63?(e.consume(P),s=3,r.interrupt?t:A):Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function h(P){return P===45?(e.consume(P),s=2,p):P===91?(e.consume(P),s=5,l=0,m):Yr(P)?(e.consume(P),s=4,r.interrupt?t:A):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function m(P){const te="CDATA[";return P===te.charCodeAt(l++)?(e.consume(P),l===te.length?r.interrupt?t:F:m):n(P)}function g(P){return Yr(P)?(e.consume(P),a=String.fromCharCode(P),w):n(P)}function w(P){if(P===null||P===47||P===62||un(P)){const te=P===47,X=a.toLowerCase();return!te&&!i&&XT.includes(X)?(s=1,r.interrupt?t(P):F(P)):bG.includes(a.toLowerCase())?(s=6,te?(e.consume(P),y):r.interrupt?t(P):F(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):i?b(P):x(P))}return P===45||jr(P)?(e.consume(P),a+=String.fromCharCode(P),w):n(P)}function y(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function b(P){return Tt(P)?(e.consume(P),b):I(P)}function x(P){return P===47?(e.consume(P),I):P===58||P===95||Yr(P)?(e.consume(P),_):Tt(P)?(e.consume(P),x):I(P)}function _(P){return P===45||P===46||P===58||P===95||jr(P)?(e.consume(P),_):k(P)}function k(P){return P===61?(e.consume(P),N):Tt(P)?(e.consume(P),k):x(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,T):Tt(P)?(e.consume(P),N):S(P)}function T(P){return P===c?(e.consume(P),c=null,R):P===null||it(P)?n(P):(e.consume(P),T)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||un(P)?k(P):(e.consume(P),S)}function R(P){return P===47||P===62||Tt(P)?x(P):n(P)}function I(P){return P===62?(e.consume(P),j):n(P)}function j(P){return P===null||it(P)?F(P):Tt(P)?(e.consume(P),j):n(P)}function F(P){return P===45&&s===2?(e.consume(P),C):P===60&&s===1?(e.consume(P),M):P===62&&s===4?(e.consume(P),H):P===63&&s===3?(e.consume(P),A):P===93&&s===5?(e.consume(P),D):it(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(xG,W,Y)(P)):P===null||it(P)?(e.exit("htmlFlowData"),Y(P)):(e.consume(P),F)}function Y(P){return e.check(wG,L,W)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return P===null||it(P)?Y(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),A):F(P)}function M(P){return P===47?(e.consume(P),a="",O):F(P)}function O(P){if(P===62){const te=a.toLowerCase();return XT.includes(te)?(e.consume(P),H):F(P)}return Yr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),O):F(P)}function D(P){return P===93?(e.consume(P),A):F(P)}function A(P){return P===62?(e.consume(P),H):P===45&&s===2?(e.consume(P),A):F(P)}function H(P){return P===null||it(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),H)}function W(P){return e.exit("htmlFlow"),t(P)}}function kG(e,t,n){const r=this;return s;function s(a){return it(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 NG(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(dh,t,n)}}const SG={name:"htmlText",tokenize:TG};function TG(e,t,n){const r=this;let s,i,a;return l;function l(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),k):A===63?(e.consume(A),x):Yr(A)?(e.consume(A),S):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,m):Yr(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),p):n(A)}function f(A){return A===null?n(A):A===45?(e.consume(A),h):it(A)?(a=f,M(A)):(e.consume(A),f)}function h(A){return A===45?(e.consume(A),p):f(A)}function p(A){return A===62?C(A):A===45?h(A):f(A)}function m(A){const H="CDATA[";return A===H.charCodeAt(i++)?(e.consume(A),i===H.length?g:m):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),w):it(A)?(a=g,M(A)):(e.consume(A),g)}function w(A){return A===93?(e.consume(A),y):g(A)}function y(A){return A===62?C(A):A===93?(e.consume(A),y):g(A)}function b(A){return A===null||A===62?C(A):it(A)?(a=b,M(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),_):it(A)?(a=x,M(A)):(e.consume(A),x)}function _(A){return A===62?C(A):x(A)}function k(A){return Yr(A)?(e.consume(A),N):n(A)}function N(A){return A===45||jr(A)?(e.consume(A),N):T(A)}function T(A){return it(A)?(a=T,M(A)):Tt(A)?(e.consume(A),T):C(A)}function S(A){return A===45||jr(A)?(e.consume(A),S):A===47||A===62||un(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),C):A===58||A===95||Yr(A)?(e.consume(A),I):it(A)?(a=R,M(A)):Tt(A)?(e.consume(A),R):C(A)}function I(A){return A===45||A===46||A===58||A===95||jr(A)?(e.consume(A),I):j(A)}function j(A){return A===61?(e.consume(A),F):it(A)?(a=j,M(A)):Tt(A)?(e.consume(A),j):R(A)}function F(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,Y):it(A)?(a=F,M(A)):Tt(A)?(e.consume(A),F):(e.consume(A),L)}function Y(A){return A===s?(e.consume(A),s=void 0,U):A===null?n(A):it(A)?(a=Y,M(A)):(e.consume(A),Y)}function L(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||un(A)?R(A):(e.consume(A),L)}function U(A){return A===47||A===62||un(A)?R(A):n(A)}function C(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function M(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return Tt(A)?Mt(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):D(A)}function D(A){return e.enter("htmlTextData"),a(A)}}const Yv={name:"labelEnd",resolveAll:RG,resolveTo:OG,tokenize:LG},AG={tokenize:MG},CG={tokenize:jG},IG={tokenize:DG};function RG(e){let t=-1;const n=[];for(;++t=3&&(u===null||it(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Tt(u)?Mt(e,l,"whitespace")(u):l(u))}}const ts={continuation:{tokenize:YG},exit:GG,name:"list",tokenize:KG},zG={partial:!0,tokenize:qG},VG={partial:!0,tokenize:WG};function KG(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 l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:GE(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(um,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 GE(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(dh,r.interrupt?n:d,e.attempt(zG,h,f))}function d(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return Tt(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 YG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dh,s,i);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!Tt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VG,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(ts,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function WG(e,t,n){const r=this;return Mt(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 qG(e,t,n){const r=this;return Mt(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!Tt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const QT={name:"setextUnderline",resolveTo:XG,tokenize:QG};function XG(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 QG(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"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Tt(u)?Mt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||it(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ZG={tokenize:JG};function JG(e){const t=this,n=e.attempt(dh,r,e.attempt(this.parser.constructs.flowInitial,s,Mt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(sG,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 eq={resolveAll:d3()},tq=u3("string"),nq=u3("text");function u3(e){return{resolveAll:d3(e==="text"?rq:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(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 l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function gq(e,t){let n=-1;const r=[];let s;for(;++n0){const nt=he.tokenStack[he.tokenStack.length-1];(nt[1]||JT).call(he,void 0,nt[0])}for(Z.position={start:La(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:La(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe0&&(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 Cq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Iq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ku(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Oq(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 Lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p3(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 Mq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={src:ku(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 jq(e,t){const n={src:ku(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 Dq(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 Pq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={href:ku(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 Bq(e,t){const n={href:ku(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 Fq(e,t,n){const r=e.all(t),s=n?Uq(n):m3(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 l=-1;for(;++l0){const nt=he.tokenStack[he.tokenStack.length-1];(nt[1]||JT).call(he,void 0,nt[0])}for(Z.position={start:La(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:La(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe0&&(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 Iq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Nu(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),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 Lq(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 Mq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p3(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 jq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={src:Nu(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 Dq(e,t){const n={src:Nu(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 Pq(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 Bq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p3(e,t);const s={href:Nu(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 Fq(e,t){const n={href:Nu(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 Uq(e,t,n){const r=e.all(t),s=n?$q(n):m3(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 l=-1;for(;++l1}function $q(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)},l=Yi(t.children[1]),c=w0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Yq(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,l=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(n2(t.slice(s),s>0,!1)),i.join("")}function n2(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===e2||i===t2;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===e2||i===t2;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function qq(e,t){const n={type:"text",value:Gq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Qq={blockquote:Sq,break:Tq,code:Aq,delete:Cq,emphasis:Iq,footnoteReference:Rq,heading:Oq,html:Lq,imageReference:Mq,image:jq,inlineCode:Dq,linkReference:Pq,link:Bq,listItem:Fq,list:$q,paragraph:Hq,root:zq,strong:Vq,table:Kq,tableCell:Wq,tableRow:Yq,text:qq,thematicBreak:Xq,toml:mp,yaml:mp,definition:mp,footnoteDefinition:mp};function mp(){}const g3=-1,k0=0,Wd=1,ug=2,Wv=3,Gv=4,qv=5,Xv=6,y3=7,b3=8,Zq=typeof self=="object"?self:globalThis,r2=(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 Zq[e](t)},Jq=(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 k0:case g3:return n(a,s);case Wd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case ug:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Wv:return n(new Date(a),s);case Gv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case qv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Xv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case y3:{const{name:l,message:c}=a;return n(r2(l,c),s)}case b3: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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(r2(i,a),s)};return r},s2=e=>Jq(new Map,e)(0),Bl="",{toString:eX}={},{keys:tX}=Object,nd=e=>{const t=typeof e;if(t!=="object"||!e)return[k0,t];const n=eX.call(e).slice(8,-1);switch(n){case"Array":return[Wd,Bl];case"Object":return[ug,Bl];case"Date":return[Wv,Bl];case"RegExp":return[Gv,Bl];case"Map":return[qv,Bl];case"Set":return[Xv,Bl];case"DataView":return[Wd,n]}return n.includes("Array")?[Wd,n]:n.includes("Error")?[y3,n]:[ug,n]},gp=([e,t])=>e===k0&&(t==="function"||t==="symbol"),nX=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=nd(a);switch(l){case k0:{let d=a;switch(c){case"bigint":l=b3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([g3],a)}return s([l,d],a)}case Wd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case ug:{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([l,d],a);for(const h of tX(a))(e||!gp(nd(a[h])))&&d.push([i(h),i(a[h])]);return f}case Wv:return s([l,a.toISOString()],a);case Gv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case qv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(gp(nd(h))||gp(nd(p))))&&d.push([i(h),i(p)]);return f}case Xv:{const d=[],f=s([l,d],a);for(const h of a)(e||!gp(nd(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},i2=(e,{json:t,lossy:n}={})=>{const r=[];return nX(!(t||n),!!t,new Map,r)(e),r},tu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?s2(i2(e,t)):structuredClone(e):(e,t)=>s2(i2(e,t));function rX(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 sX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rX,r=e.options.footnoteBackLabel||sX,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...tu(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)}function $q(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function Hq(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)},l=Yi(t.children[1]),c=w0(t.children[t.children.length-1]);l&&c&&(a.position={start:l,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 Wq(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,l=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(n2(t.slice(s),s>0,!1)),i.join("")}function n2(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===e2||i===t2;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===e2||i===t2;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Xq(e,t){const n={type:"text",value:qq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Qq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Zq={blockquote:Tq,break:Aq,code:Cq,delete:Iq,emphasis:Rq,footnoteReference:Oq,heading:Lq,html:Mq,imageReference:jq,image:Dq,inlineCode:Pq,linkReference:Bq,link:Fq,listItem:Uq,list:Hq,paragraph:zq,root:Vq,strong:Kq,table:Yq,tableCell:Gq,tableRow:Wq,text:Xq,thematicBreak:Qq,toml:mp,yaml:mp,definition:mp,footnoteDefinition:mp};function mp(){}const g3=-1,k0=0,Wd=1,ug=2,Wv=3,Gv=4,qv=5,Xv=6,y3=7,b3=8,Jq=typeof self=="object"?self:globalThis,r2=(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 Jq[e](t)},eX=(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 k0:case g3:return n(a,s);case Wd:{const l=n([],s);for(const c of a)l.push(r(c));return l}case ug:{const l=n({},s);for(const[c,u]of a)l[r(c)]=r(u);return l}case Wv:return n(new Date(a),s);case Gv:{const{source:l,flags:c}=a;return n(new RegExp(l,c),s)}case qv:{const l=n(new Map,s);for(const[c,u]of a)l.set(r(c),r(u));return l}case Xv:{const l=n(new Set,s);for(const c of a)l.add(r(c));return l}case y3:{const{name:l,message:c}=a;return n(r2(l,c),s)}case b3: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:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(r2(i,a),s)};return r},s2=e=>eX(new Map,e)(0),Bl="",{toString:tX}={},{keys:nX}=Object,rd=e=>{const t=typeof e;if(t!=="object"||!e)return[k0,t];const n=tX.call(e).slice(8,-1);switch(n){case"Array":return[Wd,Bl];case"Object":return[ug,Bl];case"Date":return[Wv,Bl];case"RegExp":return[Gv,Bl];case"Map":return[qv,Bl];case"Set":return[Xv,Bl];case"DataView":return[Wd,n]}return n.includes("Array")?[Wd,n]:n.includes("Error")?[y3,n]:[ug,n]},gp=([e,t])=>e===k0&&(t==="function"||t==="symbol"),rX=(e,t,n,r)=>{const s=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=rd(a);switch(l){case k0:{let d=a;switch(c){case"bigint":l=b3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([g3],a)}return s([l,d],a)}case Wd:{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([l,d],a);for(const h of a)d.push(i(h));return f}case ug:{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([l,d],a);for(const h of nX(a))(e||!gp(rd(a[h])))&&d.push([i(h),i(a[h])]);return f}case Wv:return s([l,a.toISOString()],a);case Gv:{const{source:d,flags:f}=a;return s([l,{source:d,flags:f}],a)}case qv:{const d=[],f=s([l,d],a);for(const[h,p]of a)(e||!(gp(rd(h))||gp(rd(p))))&&d.push([i(h),i(p)]);return f}case Xv:{const d=[],f=s([l,d],a);for(const h of a)(e||!gp(rd(h)))&&d.push(i(h));return f}}const{message:u}=a;return s([l,{name:c,message:u}],a)};return i},i2=(e,{json:t,lossy:n}={})=>{const r=[];return rX(!(t||n),!!t,new Map,r)(e),r},nu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?s2(i2(e,t)):structuredClone(e):(e,t)=>s2(i2(e,t));function sX(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 iX(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aX(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sX,r=e.options.footnoteBackLabel||iX,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,p);typeof b=="string"&&(b={type:"text",value:b}),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(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...nu(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const fh=function(e){if(e==null)return cX;if(typeof e=="function")return N0(e);if(typeof e=="object")return Array.isArray(e)?aX(e):oX(e);if(typeof e=="string")return lX(e);throw new Error("Expected function, string, or object as test")};function aX(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=E3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=hX(n(c,d)),p[0]===XE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==fX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g":""))+")"})}return h;function h(){let p=E3,m,g,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=pX(n(c,d)),p[0]===XE))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==hX)for(g=(r?y.children.length:-1)+a,w=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` -`}),n}function a2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function o2(e,t){const n=mX(e,t),r=n.one(e,void 0),s=iX(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function xX(e,t){return e&&"run"in e?async function(n,r){const s=o2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return o2(n,{file:r,...e||t})}}function l2(e){if(e)throw e}var dm=Object.prototype.hasOwnProperty,w3=Object.prototype.toString,c2=Object.defineProperty,u2=Object.getOwnPropertyDescriptor,d2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):w3.call(t)==="[object Array]"},f2=function(t){if(!t||w3.call(t)!=="[object Object]")return!1;var n=dm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&dm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||dm.call(t,s)},h2=function(t,n){c2&&n.name==="__proto__"?c2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},p2=function(t,n){if(n==="__proto__")if(dm.call(t,n)){if(u2)return u2(t,n).value}else return;return t[n]},wX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Li={basename:kX,dirname:NX,extname:SX,join:TX,sep:"/"};function kX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ph(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function NX(e){if(ph(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 SX(e){ph(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 TX(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function ph(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IX={cwd:RX};function RX(){return"/"}function JE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function OX(e){if(typeof e=="string")e=new URL(e);else if(!JE(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 LX(e)}function LX(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 g=r[h][1];ZE(g)&&ZE(p)&&(p=db(!0,g,p)),r[h]=[u,p,...m]}}}}const PX=new Qv().freeze();function mb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yb(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 g2(e){if(!ZE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yp(e){return BX(e)?e:new v3(e)}function BX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FX(e){return typeof e=="string"||UX(e)}function UX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $X="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b2=[],E2={allowDangerousHtml:!0},HX=/^(https?|ircs?|mailto|xmpp)$/i,zX=[{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 VX(e){const t=KX(e),n=YX(e);return WX(t.runSync(t.parse(n),n),e)}function KX(e){const t=e.rehypePlugins||b2,n=e.remarkPlugins||b2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...E2}:E2;return PX().use(Nq).use(n).use(xX,r).use(t)}function YX(e){const t=e.children||"",n=new v3;return typeof t=="string"&&(n.value=t),n}function WX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||GX;for(const d of zX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+$X+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),hh(e,u),lW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 lb)if(Object.hasOwn(lb,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=lb[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function GX(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||HX.test(e.slice(0,t))?e:""}function x2(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 qX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XX(e,t,n){const s=fh((n||{}).ignore||[]),i=QX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=x2(e,"(");let i=x2(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 _3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fl(n)||v0(n))&&(!t||n!==47)}k3.peek=xQ;function fQ(){this.buffer()}function hQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function pQ(){this.buffer()}function mQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yQ(e){this.exit(e)}function bQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EQ(e){this.exit(e)}function xQ(){return"["}function k3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function wQ(){return{enter:{gfmFootnoteCallString:fQ,gfmFootnoteCall:hQ,gfmFootnoteDefinitionLabelString:pQ,gfmFootnoteDefinition:mQ},exit:{gfmFootnoteCallString:gQ,gfmFootnoteCall:yQ,gfmFootnoteDefinitionLabelString:bQ,gfmFootnoteDefinition:EQ}}}function vQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:k3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?N3:_Q))),u(),c}}function _Q(e,t,n){return t===0?e:N3(e,t,n)}function N3(e,t,n){return(n?"":" ")+e}const kQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];S3.peek=CQ;function NQ(){return{canContainEols:["delete"],enter:{strikethrough:TQ},exit:{strikethrough:AQ}}}function SQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kQ}],handlers:{delete:S3}}}function TQ(e){this.enter({type:"delete",children:[]},e)}function AQ(e){this.exit(e)}function S3(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 CQ(){return"~"}function IQ(e){return e.length}function RQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||IQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),MQ);return s(),a}function MQ(e,t,n){return">"+(n?"":" ")+e}function jQ(e,t){return _2(e,t.inConstruct,!0)&&!_2(e,t.notInConstruct,!1)}function _2(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 PQ(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 BQ(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 FQ(e,t,n,r){const s=BQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(PQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,UQ);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(DQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function a2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function o2(e,t){const n=gX(e,t),r=n.one(e,void 0),s=aX(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function wX(e,t){return e&&"run"in e?async function(n,r){const s=o2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return o2(n,{file:r,...e||t})}}function l2(e){if(e)throw e}var dm=Object.prototype.hasOwnProperty,w3=Object.prototype.toString,c2=Object.defineProperty,u2=Object.getOwnPropertyDescriptor,d2=function(t){return typeof Array.isArray=="function"?Array.isArray(t):w3.call(t)==="[object Array]"},f2=function(t){if(!t||w3.call(t)!=="[object Object]")return!1;var n=dm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&dm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||dm.call(t,s)},h2=function(t,n){c2&&n.name==="__proto__"?c2(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},p2=function(t,n){if(n==="__proto__")if(dm.call(t,n)){if(u2)return u2(t,n).value}else return;return t[n]},vX=function e(){var t,n,r,s,i,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(s);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...l){n||(n=!0,t(a,...l))}function i(a){s(null,a)}}const Li={basename:NX,dirname:SX,extname:TX,join:AX,sep:"/"};function NX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ph(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,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function SX(e){if(ph(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 TX(e){ph(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===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 AX(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function IX(e,t){let n="",r=0,s=-1,i=0,a=-1,l,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 l===46&&i>-1?i++:i=-1}return n}function ph(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RX={cwd:OX};function OX(){return"/"}function JE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LX(e){if(typeof e=="string")e=new URL(e);else if(!JE(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 MX(e)}function MX(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 g=r[h][1];ZE(g)&&ZE(p)&&(p=db(!0,g,p)),r[h]=[u,p,...m]}}}}const BX=new Qv().freeze();function mb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yb(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 g2(e){if(!ZE(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yp(e){return FX(e)?e:new v3(e)}function FX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UX(e){return typeof e=="string"||$X(e)}function $X(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b2=[],E2={allowDangerousHtml:!0},zX=/^(https?|ircs?|mailto|xmpp)$/i,VX=[{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 KX(e){const t=YX(e),n=WX(e);return GX(t.runSync(t.parse(n),n),e)}function YX(e){const t=e.rehypePlugins||b2,n=e.remarkPlugins||b2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...E2}:E2;return BX().use(Sq).use(n).use(wX,r).use(t)}function WX(e){const t=e.children||"",n=new v3;return typeof t=="string"&&(n.value=t),n}function GX(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||qX;for(const d of VX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+HX+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),hh(e,u),cW(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.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 lb)if(Object.hasOwn(lb,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=lb[p];(g===null||g.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 l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function qX(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||zX.test(e.slice(0,t))?e:""}function x2(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 XX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function QX(e,t,n){const s=fh((n||{}).ignore||[]),i=ZX(t);let a=-1;for(;++a0?{type:"text",value:N}:void 0),N===!1?h.lastIndex=_+1:(m!==_&&b.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(N)?b.push(...N):N&&b.push(N),m=_+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=x2(e,"(");let i=x2(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 _3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fl(n)||v0(n))&&(!t||n!==47)}k3.peek=wQ;function hQ(){this.buffer()}function pQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function mQ(){this.buffer()}function gQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bQ(e){this.exit(e)}function EQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xQ(e){this.exit(e)}function wQ(){return"["}function k3(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=s.move("]"),i}function vQ(){return{enter:{gfmFootnoteCallString:hQ,gfmFootnoteCall:pQ,gfmFootnoteDefinitionLabelString:mQ,gfmFootnoteDefinition:gQ},exit:{gfmFootnoteCallString:yQ,gfmFootnoteCall:bQ,gfmFootnoteDefinitionLabelString:EQ,gfmFootnoteDefinition:xQ}}}function _Q(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:k3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+i.indentLines(i.containerFlow(r,l.current()),t?N3:kQ))),u(),c}}function kQ(e,t,n){return t===0?e:N3(e,t,n)}function N3(e,t,n){return(n?"":" ")+e}const NQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];S3.peek=IQ;function SQ(){return{canContainEols:["delete"],enter:{strikethrough:AQ},exit:{strikethrough:CQ}}}function TQ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NQ}],handlers:{delete:S3}}}function AQ(e){this.enter({type:"delete",children:[]},e)}function CQ(e){this.exit(e)}function S3(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 IQ(){return"~"}function RQ(e){return e.length}function OQ(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||RQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}g.push(b)}a[d]=g,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=b),p[f]=b),h[f]=x}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),jQ);return s(),a}function jQ(e,t,n){return">"+(n?"":" ")+e}function DQ(e,t){return _2(e,t.inConstruct,!0)&&!_2(e,t.notInConstruct,!1)}function _2(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 BQ(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 FQ(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 UQ(e,t,n,r){const s=FQ(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(BQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,$Q);return f(),h}const l=n.createTracker(r),c=s.repeat(Math.max(PQ(i,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),i&&(d+=l.move(i+` -`)),d+=l.move(c),u(),d}function UQ(e,t,n){return(n?"":" ")+e}function Zv(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 $Q(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function HQ(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 Mf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dg(e,t,n){const r=eu(e),s=eu(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}}A3.peek=zQ;function A3(e,t,n,r){const s=HQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function zQ(e,t,n){return n.options.emphasis||"*"}function VQ(e,t){let n=!1;return hh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,XE}),!!((!e.depth||e.depth<3)&&Vv(e)&&(t.options.setext||n))}function KQ(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(VQ(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:` +`)),d+=l.move(c),u(),d}function $Q(e,t,n){return(n?"":" ")+e}function Zv(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 HQ(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=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("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=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),l()),a(),u}function zQ(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 Mf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function dg(e,t,n){const r=tu(e),s=tu(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}}A3.peek=VQ;function A3(e,t,n,r){const s=zQ(n),i=n.enter("emphasis"),a=n.createTracker(r),l=a.move(s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function VQ(e,t,n){return n.options.emphasis||"*"}function KQ(e,t){let n=!1;return hh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,XE}),!!((!e.depth||e.depth<3)&&Vv(e)&&(t.options.setext||n))}function YQ(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(KQ(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),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(u)&&(u=Mf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}C3.peek=YQ;function C3(e){return e.value||""}function YQ(){return"<"}I3.peek=WQ;function I3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function WQ(){return"!"}R3.peek=GQ;function R3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function GQ(){return"!"}O3.peek=qQ;function O3(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))}M3.peek=XQ;function M3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(L3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function XQ(e,t,n){return L3(e,n)?"<":"["}j3.peek=QQ;function j3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function QQ(){return"["}function Jv(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 ZQ(e){const t=Jv(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 JQ(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 D3(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 eZ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?JQ(n):Jv(n);const l=e.ordered?a==="."?")":".":ZQ(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),D3(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 rZ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const sZ=fh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iZ(e,t,n,r){return(e.children.some(function(a){return sZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function aZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}P3.peek=oZ;function P3(e,t,n,r){const s=aZ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function oZ(e,t,n){return n.options.strong||"*"}function lZ(e,t,n,r){return n.safe(e.value,r)}function cZ(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 uZ(e,t,n){const r=(D3(n)+(n.options.ruleSpaces?" ":"")).repeat(cZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const B3={blockquote:LQ,break:k2,code:FQ,definition:$Q,emphasis:A3,hardBreak:k2,heading:KQ,html:C3,image:I3,imageReference:R3,inlineCode:O3,link:M3,linkReference:j3,list:eZ,listItem:nZ,paragraph:rZ,root:iZ,strong:P3,text:lZ,thematicBreak:uZ};function dZ(){return{enter:{table:fZ,tableData:N2,tableHeader:N2,tableRow:pZ},exit:{codeText:mZ,table:hZ,tableData:wb,tableHeader:wb,tableRow:wb}}}function fZ(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 hZ(e){this.exit(e),this.data.inTable=void 0}function pZ(e){this.enter({type:"tableRow",children:[]},e)}function wb(e){this.exit(e)}function N2(e){this.enter({type:"tableCell",children:[]},e)}function mZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gZ(e,t){return t==="|"?t:e}function yZ(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=Mf(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}C3.peek=WQ;function C3(e){return e.value||""}function WQ(){return"<"}I3.peek=GQ;function I3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=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("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=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),l()),u+=c.move(")"),a(),u}function GQ(){return"!"}R3.peek=qQ;function R3(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function qQ(){return"!"}O3.peek=XQ;function O3(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))}M3.peek=QQ;function M3(e,t,n,r){const s=Zv(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let l,c;if(L3(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=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(")"),l(),u}function QQ(e,t,n){return L3(e,n)?"<":"["}j3.peek=ZQ;function j3(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?c+=l.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ZQ(){return"["}function Jv(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 JQ(e){const t=Jv(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 eZ(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 D3(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 tZ(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?eZ(n):Jv(n);const l=e.ordered?a==="."?")":".":JQ(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),D3(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 l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.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 sZ(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const iZ=fh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function aZ(e,t,n,r){return(e.children.some(function(a){return iZ(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oZ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}P3.peek=lZ;function P3(e,t,n,r){const s=oZ(n),i=n.enter("strong"),a=n.createTracker(r),l=a.move(s+s);let c=a.move(n.containerPhrasing(e,{after:s,before:l,...a.current()}));const u=c.charCodeAt(0),d=dg(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=Mf(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=dg(r.after.charCodeAt(0),f,s);h.inside&&(c=c.slice(0,-1)+Mf(f));const p=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function lZ(e,t,n){return n.options.strong||"*"}function cZ(e,t,n,r){return n.safe(e.value,r)}function uZ(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 dZ(e,t,n){const r=(D3(n)+(n.options.ruleSpaces?" ":"")).repeat(uZ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const B3={blockquote:MQ,break:k2,code:UQ,definition:HQ,emphasis:A3,hardBreak:k2,heading:YQ,html:C3,image:I3,imageReference:R3,inlineCode:O3,link:M3,linkReference:j3,list:tZ,listItem:rZ,paragraph:sZ,root:aZ,strong:P3,text:cZ,thematicBreak:dZ};function fZ(){return{enter:{table:hZ,tableData:N2,tableHeader:N2,tableRow:mZ},exit:{codeText:gZ,table:pZ,tableData:wb,tableHeader:wb,tableRow:wb}}}function hZ(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 pZ(e){this.exit(e),this.data.inTable=void 0}function mZ(e){this.enter({type:"tableRow",children:[]},e)}function wb(e){this.exit(e)}function N2(e){this.enter({type:"tableCell",children:[]},e)}function gZ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yZ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yZ(e,t){return t==="|"?t:e}function bZ(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:l}};function a(p,m,g,w){return u(d(p,g,w),p.align)}function l(p,m,g,w){const y=f(p,g,w),b=u([y]);return b.slice(0,b.indexOf(` -`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return RQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const jZ={tokenize:zZ,partial:!0};function DZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:UZ,continuation:{tokenize:$Z},exit:HZ}},text:{91:{name:"gfmFootnoteCall",tokenize:FZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PZ,resolveTo:BZ}}}}function PZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=xi(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 BZ(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)},l=[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,...l),e}function FZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||un(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(xi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return un(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 UZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||un(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=xi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return un(m)||(l=!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),Mt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function $Z(e,t,n){return e.check(dh,t,e.attempt(jZ,t,n))}function HZ(e){e.exit("gfmFootnoteDefinition")}function zZ(e,t,n){const r=this;return Mt(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 VZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=eu(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class KZ{constructor(){this.map=[]}add(t,n,r){YZ(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 YZ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const L=r.events[j][1].type;if(L==="lineEnding"||L==="linePrefix")j--;else break}const F=j>-1?r.events[j][1].type:null,Y=F==="tableHead"||F==="tableRow"?N:c;return Y===N&&r.parser.lazy[r.now().line]?n(I):Y(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):it(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):Tt(I)?Mt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||un(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Tt(I)?Mt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return Tt(I)?Mt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||it(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return Tt(I)?Mt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||it(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||it(I)?(e.exit("tableRow"),t(I)):Tt(I)?Mt(e,T,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||un(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function XZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new KZ;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Wl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function T2(e,t,n,r,s){const i=[],a=Wl(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 Wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const QZ={name:"tasklistCheck",tokenize:JZ};function ZZ(){return{text:{91:QZ}}}function JZ(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 un(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"),l):n(c)}function l(c){return it(c)?t(c):Tt(c)?e.check({tokenize:eJ},t,n)(c):n(c)}}function eJ(e,t,n){return Mt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function tJ(e){return t3([SZ(),DZ(),VZ(e),GZ(),ZZ()])}const nJ={};function rJ(e){const t=this,n=e||nJ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(tJ(n)),i.push(vZ()),a.push(_Z(n))}const A2=function(e,t,n){const r=fh(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 G3(e,t,n){return e.type==="element"?dJ(e,t,n):e.type==="text"?n.whitespace==="normal"?q3(e,n):fJ(e):[]}function dJ(e,t,n){const r=X3(e,n),s=e.children||[];let i=-1,a=[];if(cJ(e))return a;let l,c;for(tx(e)||O2(e)&&A2(t,e,O2)?c=` -`:lJ(e)?(l=2,c=2):W3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function EJ(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=bJ(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 Q3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function xJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function wJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vJ(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const _J=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_-]*/}}),kJ=["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"],NJ=["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"],SJ=[...kJ,...NJ],TJ=["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(),AJ=["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(),CJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IJ=["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 RJ(e){const t=e.regex,n=_J(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_-]*",l=[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:":("+AJ.join("|")+")"},{begin:":(:)?("+CJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+IJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:TJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+SJ.join("|")+")\\b"}]}}function OJ(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 LJ(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:"J3(e,t,n-1))}function jJ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+J3("(?:<"+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,L2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},L2,u]}}const M2="[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"],PJ=["true","false","null","undefined","NaN","Infinity"],eD=["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"],tD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],FJ=[].concat(nD,eD,tD);function rD(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:M2,keyword:DJ,literal:PJ,built_in:FJ,"variable.language":BJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...eD,...tD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...nD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function sD(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 ql="[0-9](_*[0-9])*",wp=`\\.(${ql})`,vp="[0-9a-fA-F](_*[0-9a-fA-F])*",UJ={className:"number",variants:[{begin:`(\\b(${ql})((${wp})|\\.)?|(${wp}))[eE][+-]?(${ql})[fFdD]?\\b`},{begin:`\\b(${ql})((${wp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wp})[fFdD]?\\b`},{begin:`\\b(${ql})[fFdD]\\b`},{begin:`\\b0[xX]((${vp})\\.?|(${vp})?\\.(${vp}))[pP][+-]?(${ql})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $J(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 l={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=UJ,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const HJ=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_-]*/}}),zJ=["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"],VJ=["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"],KJ=[...zJ,...VJ],YJ=["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(),iD=["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(),aD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),WJ=["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(),GJ=iD.concat(aD).sort().reverse();function qJ(e){const t=HJ(e),n=GJ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:YJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+WJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+KJ.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:":("+iD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+aD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function XJ(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 oD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 QJ(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_]*/,l={"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:l,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 ZJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 JJ(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},l={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,U)=>{U.data._beginMatch=L[1]||L[2]},"on:end":(L,U)=>{U.data._beginMatch!==L[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(L=>{const U=[];return L.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:b},k=L=>L.map(U=>U.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(j);const F=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,j,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",Y,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function eee(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 tee(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function cD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function nee(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ree(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 see(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function iee(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const aee=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_-]*/}}),oee=["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"],lee=["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"],cee=[...oee,...lee],uee=["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(),dee=["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(),fee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hee=["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 pee(e){const t=aee(e),n=fee,r=dee,s="@[a-z-]+",i="and or not only",l={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("+cee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hee.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,l,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:uee.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function mee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function gee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:T}={}){const S=T;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function uD(e){return e?typeof e=="string"?e:e.source:null}function rd(e){return tn("(?=",e,")")}function tn(...e){return e.map(n=>uD(n)).join("")}function yee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function zr(...e){return"("+(yee(e).capture?"":"?:")+e.map(r=>uD(r)).join("|")+")"}const n_=e=>tn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),bee=["Protocol","Type"].map(n_),j2=["init","self"].map(n_),Eee=["Any","Self"],vb=["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"],D2=["false","nil","true"],xee=["assignment","associativity","higherThan","left","lowerThan","none","right"],wee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],P2=["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"],dD=zr(/[/=\-+!*%<>&|^~?]/,/[\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]/),fD=zr(dD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),_b=tn(dD,fD,"*"),hD=zr(/[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]/),fg=zr(hD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ii=tn(hD,fg,"*"),_p=tn(/[A-Z]/,fg,"*"),vee=["attached","autoclosure",tn(/convention\(/,zr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",tn(/objc\(/,Ii,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_ee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function kee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,zr(...bee,...j2)],className:{2:"keyword"}},i={match:tn(/\./,zr(...vb)),relevance:0},a=vb.filter(Re=>typeof Re=="string").concat(["_|0"]),l=vb.filter(Re=>typeof Re!="string").concat(Eee).map(n_),c={variants:[{className:"keyword",match:zr(...l,...j2)}]},u={$pattern:zr(/\b\w+/,/#\w+/),keyword:a.concat(wee),literal:D2},d=[s,i,c],f={match:tn(/\./,zr(...P2)),relevance:0},h={className:"built_in",match:tn(/\b/,zr(...P2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:_b},{match:`\\.(\\.|${fD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Re="")=>({className:"subst",variants:[{match:tn(/\\/,Re,/[0\\tnr"']/)},{match:tn(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Re="")=>({className:"subst",match:tn(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Re="")=>({className:"subst",label:"interpol",begin:tn(/\\/,Re,/\(/),end:/\)/}),T=(Re="")=>({begin:tn(Re,/"""/),end:tn(/"""/,Re),contains:[_(Re),k(Re),N(Re)]}),S=(Re="")=>({begin:tn(Re,/"/),end:tn(/"/,Re),contains:[_(Re),N(Re)]}),R={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=Re=>{const Ye=tn(Re,/\//),Le=tn(/\//,Re);return{begin:Ye,end:Le,contains:[...I,{scope:"comment",begin:`#(?!.*${Le})`,end:/$/}]}},Y={scope:"regexp",variants:[F("###"),F("##"),F("#"),j]},L={match:tn(/`/,Ii,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${fg}+`},M=[L,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_ee,contains:[...w,x,R]}]}},D={scope:"keyword",match:tn(/@/,zr(...vee),rd(zr(/\(/,/\s+/)))},A={scope:"meta",match:tn(/@/,Ii)},H=[O,D,A],W={match:rd(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:tn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,fg,"+")},{className:"type",match:_p,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:tn(/\s+&\s+/,rd(_p)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...H,m,W]};W.contains.push(P);const te={match:tn(Ii,/\s*:/),keywords:"_|0",relevance:0},X={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",te,...r,Y,...d,...p,...w,x,R,...M,...H,W]},ne={begin://,keywords:"repeat each",contains:[...r,W]},ce={begin:zr(rd(tn(Ii,/\s*:/)),rd(tn(Ii,/\s+/,Ii,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ii}]},J={begin:/\(/,end:/\)/,keywords:u,contains:[ce,...r,...d,...w,x,R,...H,W,X],endsParent:!0,illegal:/["']/},fe={match:[/(func|macro)/,/\s+/,zr(L.match,Ii,_b)],className:{1:"keyword",3:"title.function"},contains:[ne,J,t],illegal:[/\[/,/%/]},ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,J,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,_b],className:{1:"keyword",3:"title"}},ge={begin:[/precedencegroup/,/\s+/,_p],className:{1:"keyword",3:"title"},contains:[W],keywords:[...xee,...D2],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},we={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ii,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:_p},...d],relevance:0}]};for(const Re of R.variants){const Ye=Re.contains.find(bt=>bt.label==="interpol");Ye.keywords=u;const Le=[...d,...p,...w,x,R,...M];Ye.contains=[...Le,{begin:/\(/,end:/\)/,contains:["self",...Le]}]}return{name:"Swift",keywords:u,contains:[...r,fe,ee,xe,we,Te,Ee,ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,x,R,...M,...H,W,X]}}const hg="[A-Za-z$_][0-9A-Za-z$_]*",pD=["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"],mD=["true","false","null","undefined","NaN","Infinity"],gD=["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"],yD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ED=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xD=[].concat(bD,gD,yD);function Nee(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:hg,keyword:pD,literal:mD,built_in:xD,"variable.language":ED},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...gD,...yD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...bD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function wD(e){const t=e.regex,n=Nee(e),r=hg,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:hg,keyword:pD.concat(c),literal:mD,built_in:xD.concat(s),"variable.language":ED},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function See(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 Tee(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},l={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,l]}}function Aee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 vD(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Cee={arduino:EJ,bash:Q3,c:xJ,cpp:wJ,csharp:vJ,css:RJ,diff:OJ,go:LJ,graphql:MJ,ini:Z3,java:jJ,javascript:rD,json:sD,kotlin:$J,less:qJ,lua:XJ,makefile:oD,markdown:lD,objectivec:QJ,perl:ZJ,php:JJ,"php-template":eee,plaintext:tee,python:cD,"python-repl":nee,r:ree,ruby:see,rust:iee,scss:pee,shell:mee,sql:gee,swift:kee,typescript:wD,vbnet:See,wasm:Tee,xml:Aee,yaml:vD};function _D(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)&&_D(n)}),e}let B2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function kD(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Xa(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 Iee="",F2=e=>!!e.scope,Ree=(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 Oee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=kD(t)}openNode(t){if(!F2(t))return;const n=Ree(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){F2(t)&&(this.buffer+=Iee)}value(){return this.buffer}span(t){this.buffer+=``}}const U2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class r_{constructor(){this.rootNode=U2(),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=U2({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=>{r_._collapse(n)}))}}class Lee extends r_{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 Oee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function jf(e){return e?typeof e=="string"?e:e.source:null}function ND(e){return kl("(?=",e,")")}function Mee(e){return kl("(?:",e,")*")}function jee(e){return kl("(?:",e,")?")}function kl(...e){return e.map(n=>jf(n)).join("")}function Dee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function s_(...e){return"("+(Dee(e).capture?"":"?:")+e.map(r=>jf(r)).join("|")+")"}function SD(e){return new RegExp(e.toString()+"|").exec("").length-1}function Pee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Bee=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function i_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=jf(r),a="";for(;i.length>0;){const l=Bee.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const Fee=/\b\B/,TD="[a-zA-Z]\\w*",a_="[a-zA-Z_]\\w*",AD="\\b\\d+(\\.\\d+)?",CD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ID="\\b(0b[01]+)",Uee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$ee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=kl(t,/.*\b/,e.binary,/\b.*/)),Xa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Df={begin:"\\\\[\\s\\S]",relevance:0},Hee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Df]},zee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Df]},Vee={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/},S0=function(e,t,n={}){const r=Xa({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=s_("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:kl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Kee=S0("//","$"),Yee=S0("/\\*","\\*/"),Wee=S0("#","$"),Gee={scope:"number",begin:AD,relevance:0},qee={scope:"number",begin:CD,relevance:0},Xee={scope:"number",begin:ID,relevance:0},Qee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Df,{begin:/\[/,end:/\]/,relevance:0,contains:[Df]}]},Zee={scope:"title",begin:TD,relevance:0},Jee={scope:"title",begin:a_,relevance:0},ete={begin:"\\.\\s*"+a_,relevance:0},tte=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 kp=Object.freeze({__proto__:null,APOS_STRING_MODE:Hee,BACKSLASH_ESCAPE:Df,BINARY_NUMBER_MODE:Xee,BINARY_NUMBER_RE:ID,COMMENT:S0,C_BLOCK_COMMENT_MODE:Yee,C_LINE_COMMENT_MODE:Kee,C_NUMBER_MODE:qee,C_NUMBER_RE:CD,END_SAME_AS_BEGIN:tte,HASH_COMMENT_MODE:Wee,IDENT_RE:TD,MATCH_NOTHING_RE:Fee,METHOD_GUARD:ete,NUMBER_MODE:Gee,NUMBER_RE:AD,PHRASAL_WORDS_MODE:Vee,QUOTE_STRING_MODE:zee,REGEXP_MODE:Qee,RE_STARTERS_RE:Uee,SHEBANG:$ee,TITLE_MODE:Zee,UNDERSCORE_IDENT_RE:a_,UNDERSCORE_TITLE_MODE:Jee});function nte(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function rte(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ste(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=nte,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ite(e,t){Array.isArray(e.illegal)&&(e.illegal=s_(...e.illegal))}function ate(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 ote(e,t){e.relevance===void 0&&(e.relevance=1)}const lte=(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=kl(n.beforeMatch,ND(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},cte=["of","and","for","in","not","or","if","then","parent","list","value"],ute="keyword";function RD(e,t,n=ute){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,RD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,dte(c[0],c[1])]})}}function dte(e,t){return t?Number(t):fte(e)?0:1}function fte(e){return cte.includes(e.toLowerCase())}const $2={},el=e=>{console.error(e)},H2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fl=(e,t)=>{$2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$2[`${e}/${t}`]=!0)},pg=new Error;function OD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=SD(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function hte(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw el("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pg;if(typeof e.beginScope!="object"||e.beginScope===null)throw el("beginScope must be object"),pg;OD(e,e.begin,{key:"beginScope"}),e.begin=i_(e.begin,{joinWith:""})}}function pte(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw el("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pg;if(typeof e.endScope!="object"||e.endScope===null)throw el("endScope must be object"),pg;OD(e,e.end,{key:"endScope"}),e.end=i_(e.end,{joinWith:""})}}function mte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function gte(e){mte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),hte(e),pte(e)}function yte(e){function t(a,l){return new RegExp(jf(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=SD(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(i_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[rte,ate,gte,lte].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[ste,ite,ote].forEach(d=>d(a,l)),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=RD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=jf(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return bte(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Xa(e.classNameAliases||{}),i(e)}function LD(e){return e?e.endsWithParent||LD(e.starts):!1}function bte(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Xa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:LD(e)?Xa(e,{starts:e.starts?Xa(e.starts):null}):Object.isFrozen(e)?Xa(e):e}var Ete="11.11.1";class xte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const kb=kD,z2=Xa,V2=Symbol("nomatch"),wte=7,MD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lee};function c(C){return l.noHighlightRe.test(C)}function u(C){let M=C.className+" ";M+=C.parentNode?C.parentNode.className:"";const O=l.languageDetectRe.exec(M);if(O){const D=S(O[1]);return D||(H2(i.replace("{}",O[1])),H2("Falling back to no-highlight mode for this block.",C)),D?O[1]:"no-highlight"}return M.split(/\s+/).find(D=>c(D)||S(D))}function d(C,M,O){let D="",A="";typeof M=="object"?(D=C,O=M.ignoreIllegals,A=M.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`),A=C,D=M),O===void 0&&(O=!0);const H={code:D,language:A};L("before:highlight",H);const W=H.result?H.result:f(H.language,H.code,O);return W.code=H.code,L("after:highlight",W),W}function f(C,M,O,D){const A=Object.create(null);function H(G,Z){return G.keywords[Z]}function W(){if(!Le.keywords){Ze.addText(ze);return}let G=0;Le.keywordPatternRe.lastIndex=0;let Z=Le.keywordPatternRe.exec(ze),he="";for(;Z;){he+=ze.substring(G,Z.index);const De=Te.case_insensitive?Z[0].toLowerCase():Z[0],qe=H(Le,De);if(qe){const[nt,Vt]=qe;if(Ze.addText(he),he="",A[De]=(A[De]||0)+1,A[De]<=wte&&(le+=Vt),nt.startsWith("_"))he+=Z[0];else{const Et=Te.classNameAliases[nt]||nt;X(Z[0],Et)}}else he+=Z[0];G=Le.keywordPatternRe.lastIndex,Z=Le.keywordPatternRe.exec(ze)}he+=ze.substring(G),Ze.addText(he)}function P(){if(ze==="")return;let G=null;if(typeof Le.subLanguage=="string"){if(!t[Le.subLanguage]){Ze.addText(ze);return}G=f(Le.subLanguage,ze,!0,bt[Le.subLanguage]),bt[Le.subLanguage]=G._top}else G=p(ze,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(le+=G.relevance),Ze.__addSublanguage(G._emitter,G.language)}function te(){Le.subLanguage!=null?P():W(),ze=""}function X(G,Z){G!==""&&(Ze.startScope(Z),Ze.addText(G),Ze.endScope())}function ne(G,Z){let he=1;const De=Z.length-1;for(;he<=De;){if(!G._emit[he]){he++;continue}const qe=Te.classNameAliases[G[he]]||G[he],nt=Z[he];qe?X(nt,qe):(ze=nt,W(),ze=""),he++}}function ce(G,Z){return G.scope&&typeof G.scope=="string"&&Ze.openNode(Te.classNameAliases[G.scope]||G.scope),G.beginScope&&(G.beginScope._wrap?(X(ze,Te.classNameAliases[G.beginScope._wrap]||G.beginScope._wrap),ze=""):G.beginScope._multi&&(ne(G.beginScope,Z),ze="")),Le=Object.create(G,{parent:{value:Le}}),Le}function J(G,Z,he){let De=Pee(G.endRe,he);if(De){if(G["on:end"]){const qe=new B2(G);G["on:end"](Z,qe),qe.isMatchIgnored&&(De=!1)}if(De){for(;G.endsParent&&G.parent;)G=G.parent;return G}}if(G.endsWithParent)return J(G.parent,Z,he)}function fe(G){return Le.matcher.regexIndex===0?(ze+=G[0],1):(ht=!0,0)}function ee(G){const Z=G[0],he=G.rule,De=new B2(he),qe=[he.__beforeBegin,he["on:begin"]];for(const nt of qe)if(nt&&(nt(G,De),De.isMatchIgnored))return fe(Z);return he.skip?ze+=Z:(he.excludeBegin&&(ze+=Z),te(),!he.returnBegin&&!he.excludeBegin&&(ze=Z)),ce(he,G),he.returnBegin?0:Z.length}function Ee(G){const Z=G[0],he=M.substring(G.index),De=J(Le,G,he);if(!De)return V2;const qe=Le;Le.endScope&&Le.endScope._wrap?(te(),X(Z,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(te(),ne(Le.endScope,G)):qe.skip?ze+=Z:(qe.returnEnd||qe.excludeEnd||(ze+=Z),te(),qe.excludeEnd&&(ze=Z));do Le.scope&&Ze.closeNode(),!Le.skip&&!Le.subLanguage&&(le+=Le.relevance),Le=Le.parent;while(Le!==De.parent);return De.starts&&ce(De.starts,G),qe.returnEnd?0:Z.length}function ge(){const G=[];for(let Z=Le;Z!==Te;Z=Z.parent)Z.scope&&G.unshift(Z.scope);G.forEach(Z=>Ze.openNode(Z))}let xe={};function we(G,Z){const he=Z&&Z[0];if(ze+=G,he==null)return te(),0;if(xe.type==="begin"&&Z.type==="end"&&xe.index===Z.index&&he===""){if(ze+=M.slice(Z.index,Z.index+1),!s){const De=new Error(`0 width match regex (${C})`);throw De.languageName=C,De.badRule=xe.rule,De}return 1}if(xe=Z,Z.type==="begin")return ee(Z);if(Z.type==="illegal"&&!O){const De=new Error('Illegal lexeme "'+he+'" for mode "'+(Le.scope||"")+'"');throw De.mode=Le,De}else if(Z.type==="end"){const De=Ee(Z);if(De!==V2)return De}if(Z.type==="illegal"&&he==="")return ze+=` -`,1;if(ct>1e5&&ct>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=he,he.length}const Te=S(C);if(!Te)throw el(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Re=yte(Te);let Ye="",Le=D||Re;const bt={},Ze=new l.__emitter(l);ge();let ze="",le=0,ve=0,ct=0,ht=!1;try{if(Te.__emitTokens)Te.__emitTokens(M,Ze);else{for(Le.matcher.considerAll();;){ct++,ht?ht=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=ve;const G=Le.matcher.exec(M);if(!G)break;const Z=M.substring(ve,G.index),he=we(Z,G);ve=G.index+he}we(M.substring(ve))}return Ze.finalize(),Ye=Ze.toHTML(),{language:C,value:Ye,relevance:le,illegal:!1,_emitter:Ze,_top:Le}}catch(G){if(G.message&&G.message.includes("Illegal"))return{language:C,value:kb(M),illegal:!0,relevance:0,_illegalBy:{message:G.message,index:ve,context:M.slice(ve-100,ve+100),mode:G.mode,resultSoFar:Ye},_emitter:Ze};if(s)return{language:C,value:kb(M),illegal:!1,relevance:0,errorRaised:G,_emitter:Ze,_top:Le};throw G}}function h(C){const M={value:kb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return M._emitter.addText(C),M}function p(C,M){M=M||l.languages||Object.keys(t);const O=h(C),D=M.filter(S).filter(I).map(te=>f(te,C,!1));D.unshift(O);const A=D.sort((te,X)=>{if(te.relevance!==X.relevance)return X.relevance-te.relevance;if(te.language&&X.language){if(S(te.language).supersetOf===X.language)return 1;if(S(X.language).supersetOf===te.language)return-1}return 0}),[H,W]=A,P=H;return P.secondBest=W,P}function m(C,M,O){const D=M&&n[M]||O;C.classList.add("hljs"),C.classList.add(`language-${D}`)}function g(C){let M=null;const O=u(C);if(c(O))return;if(L("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new xte("One of your code blocks includes unescaped HTML.",C.innerHTML);M=C;const D=M.textContent,A=O?d(D,{language:O,ignoreIllegals:!0}):p(D);C.innerHTML=A.value,C.dataset.highlighted="yes",m(C,O,A.language),C.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(C.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),L("after:highlightElement",{el:C,result:A,text:D})}function w(C){l=z2(l,C)}const y=()=>{_(),Fl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Fl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,M){let O=null;try{O=M(e)}catch(D){if(el("Language definition for '{}' could not be registered.".replace("{}",C)),s)el(D);else throw D;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=M.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function N(C){delete t[C];for(const M of Object.keys(n))n[M]===C&&delete n[M]}function T(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:M}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=M})}function I(C){const M=S(C);return M&&!M.disableAutodetect}function j(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=M=>{C["before:highlightBlock"](Object.assign({block:M.el},M))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=M=>{C["after:highlightBlock"](Object.assign({block:M.el},M))})}function F(C){j(C),r.push(C)}function Y(C){const M=r.indexOf(C);M!==-1&&r.splice(M,1)}function L(C,M){const O=C;r.forEach(function(D){D[O]&&D[O](M)})}function U(C){return Fl("10.7.0","highlightBlock will be removed entirely in v12.0"),Fl("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:U,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:T,getLanguage:S,registerAliases:R,autoDetection:I,inherit:z2,addPlugin:F,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Ete,e.regex={concat:kl,lookahead:ND,either:s_,optional:jee,anyNumberOfTimes:Mee};for(const C in kp)typeof kp[C]=="object"&&_D(kp[C]);return Object.assign(e,kp),e},nu=MD({});nu.newInstance=()=>MD({});var vte=nu;nu.HighlightJS=nu;nu.default=nu;const ls=Xf(vte),K2={},_te="hljs-";function kte(e){const t=ls.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||K2,h=typeof f.prefix=="string"?f.prefix:_te;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Nte,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||K2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class Nte{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,l){return l?a+"_".repeat(l):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 Ste={};function Y2(e){const t=e||Ste,n=t.aliases,r=t.detect||!1,s=t.languages||Cee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=kte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){hh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=Tte(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=uJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Tte(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 l=n[a];if(l===void 0){const c=q2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 Jte(e){return e>=56320&&e<=57343}function ene(e,t){return(e-55296)*1024+9216+t}function UD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $D(e){return e>=64976&&e<=65007||Zte.has(e)}var de;(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"})(de||(de={}));const tne=65536;class nne{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=tne,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(Jte(n))return this.pos++,this._addGap(),ene(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(de.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,FD(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){UD(t)?this._err(de.controlCharacterInInputStream):$D(t)&&this._err(de.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 rne=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))),sne=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 ine(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=sne.get(e))!==null&&t!==void 0?t:e}var Er;(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"})(Er||(Er={}));const ane=32;var Qa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qa||(Qa={}));function rx(e){return e>=Er.ZERO&&e<=Er.NINE}function one(e){return e>=Er.UPPER_A&&e<=Er.UPPER_F||e>=Er.LOWER_A&&e<=Er.LOWER_F}function lne(e){return e>=Er.UPPER_A&&e<=Er.UPPER_Z||e>=Er.LOWER_A&&e<=Er.LOWER_Z||rx(e)}function cne(e){return e===Er.EQUALS||lne(e)}var yr;(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"})(yr||(yr={}));var ia;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ia||(ia={}));class une{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=yr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ia.Strict}startEntity(t){this.decodeMode=t,this.state=yr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case yr.EntityStart:return t.charCodeAt(n)===Er.NUM?(this.state=yr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=yr.NamedEntity,this.stateNamedEntity(t,n));case yr.NumericStart:return this.stateNumericStart(t,n);case yr.NumericDecimal:return this.stateNumericDecimal(t,n);case yr.NumericHex:return this.stateNumericHex(t,n);case yr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ane)===Er.LOWER_X?(this.state=yr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=yr.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===Er.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ia.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]&Qa.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]&~Qa.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case yr.NamedEntity:return this.result!==0&&(this.decodeMode!==ia.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yr.NumericDecimal:return this.emitNumericEntity(0,2);case yr.NumericHex:return this.emitNumericEntity(0,3);case yr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yr.EntityStart:return 0}}}function dne(e,t,n,r){const s=(t&Qa.BRANCH_LENGTH)>>7,i=t&Qa.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=c-1;else return e[c+s]}return-1}var ke;(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/"})(ke||(ke={}));var tl;(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"})(tl||(tl={}));var Ps;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ps||(Ps={}));var ie;(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"})(ie||(ie={}));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 fne=new Map([[ie.A,v.A],[ie.ADDRESS,v.ADDRESS],[ie.ANNOTATION_XML,v.ANNOTATION_XML],[ie.APPLET,v.APPLET],[ie.AREA,v.AREA],[ie.ARTICLE,v.ARTICLE],[ie.ASIDE,v.ASIDE],[ie.B,v.B],[ie.BASE,v.BASE],[ie.BASEFONT,v.BASEFONT],[ie.BGSOUND,v.BGSOUND],[ie.BIG,v.BIG],[ie.BLOCKQUOTE,v.BLOCKQUOTE],[ie.BODY,v.BODY],[ie.BR,v.BR],[ie.BUTTON,v.BUTTON],[ie.CAPTION,v.CAPTION],[ie.CENTER,v.CENTER],[ie.CODE,v.CODE],[ie.COL,v.COL],[ie.COLGROUP,v.COLGROUP],[ie.DD,v.DD],[ie.DESC,v.DESC],[ie.DETAILS,v.DETAILS],[ie.DIALOG,v.DIALOG],[ie.DIR,v.DIR],[ie.DIV,v.DIV],[ie.DL,v.DL],[ie.DT,v.DT],[ie.EM,v.EM],[ie.EMBED,v.EMBED],[ie.FIELDSET,v.FIELDSET],[ie.FIGCAPTION,v.FIGCAPTION],[ie.FIGURE,v.FIGURE],[ie.FONT,v.FONT],[ie.FOOTER,v.FOOTER],[ie.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ie.FORM,v.FORM],[ie.FRAME,v.FRAME],[ie.FRAMESET,v.FRAMESET],[ie.H1,v.H1],[ie.H2,v.H2],[ie.H3,v.H3],[ie.H4,v.H4],[ie.H5,v.H5],[ie.H6,v.H6],[ie.HEAD,v.HEAD],[ie.HEADER,v.HEADER],[ie.HGROUP,v.HGROUP],[ie.HR,v.HR],[ie.HTML,v.HTML],[ie.I,v.I],[ie.IMG,v.IMG],[ie.IMAGE,v.IMAGE],[ie.INPUT,v.INPUT],[ie.IFRAME,v.IFRAME],[ie.KEYGEN,v.KEYGEN],[ie.LABEL,v.LABEL],[ie.LI,v.LI],[ie.LINK,v.LINK],[ie.LISTING,v.LISTING],[ie.MAIN,v.MAIN],[ie.MALIGNMARK,v.MALIGNMARK],[ie.MARQUEE,v.MARQUEE],[ie.MATH,v.MATH],[ie.MENU,v.MENU],[ie.META,v.META],[ie.MGLYPH,v.MGLYPH],[ie.MI,v.MI],[ie.MO,v.MO],[ie.MN,v.MN],[ie.MS,v.MS],[ie.MTEXT,v.MTEXT],[ie.NAV,v.NAV],[ie.NOBR,v.NOBR],[ie.NOFRAMES,v.NOFRAMES],[ie.NOEMBED,v.NOEMBED],[ie.NOSCRIPT,v.NOSCRIPT],[ie.OBJECT,v.OBJECT],[ie.OL,v.OL],[ie.OPTGROUP,v.OPTGROUP],[ie.OPTION,v.OPTION],[ie.P,v.P],[ie.PARAM,v.PARAM],[ie.PLAINTEXT,v.PLAINTEXT],[ie.PRE,v.PRE],[ie.RB,v.RB],[ie.RP,v.RP],[ie.RT,v.RT],[ie.RTC,v.RTC],[ie.RUBY,v.RUBY],[ie.S,v.S],[ie.SCRIPT,v.SCRIPT],[ie.SEARCH,v.SEARCH],[ie.SECTION,v.SECTION],[ie.SELECT,v.SELECT],[ie.SOURCE,v.SOURCE],[ie.SMALL,v.SMALL],[ie.SPAN,v.SPAN],[ie.STRIKE,v.STRIKE],[ie.STRONG,v.STRONG],[ie.STYLE,v.STYLE],[ie.SUB,v.SUB],[ie.SUMMARY,v.SUMMARY],[ie.SUP,v.SUP],[ie.TABLE,v.TABLE],[ie.TBODY,v.TBODY],[ie.TEMPLATE,v.TEMPLATE],[ie.TEXTAREA,v.TEXTAREA],[ie.TFOOT,v.TFOOT],[ie.TD,v.TD],[ie.TH,v.TH],[ie.THEAD,v.THEAD],[ie.TITLE,v.TITLE],[ie.TR,v.TR],[ie.TRACK,v.TRACK],[ie.TT,v.TT],[ie.U,v.U],[ie.UL,v.UL],[ie.SVG,v.SVG],[ie.VAR,v.VAR],[ie.WBR,v.WBR],[ie.XMP,v.XMP]]);function Su(e){var t;return(t=fne.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ie=v,hne={[ke.HTML]:new Set([Ie.ADDRESS,Ie.APPLET,Ie.AREA,Ie.ARTICLE,Ie.ASIDE,Ie.BASE,Ie.BASEFONT,Ie.BGSOUND,Ie.BLOCKQUOTE,Ie.BODY,Ie.BR,Ie.BUTTON,Ie.CAPTION,Ie.CENTER,Ie.COL,Ie.COLGROUP,Ie.DD,Ie.DETAILS,Ie.DIR,Ie.DIV,Ie.DL,Ie.DT,Ie.EMBED,Ie.FIELDSET,Ie.FIGCAPTION,Ie.FIGURE,Ie.FOOTER,Ie.FORM,Ie.FRAME,Ie.FRAMESET,Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6,Ie.HEAD,Ie.HEADER,Ie.HGROUP,Ie.HR,Ie.HTML,Ie.IFRAME,Ie.IMG,Ie.INPUT,Ie.LI,Ie.LINK,Ie.LISTING,Ie.MAIN,Ie.MARQUEE,Ie.MENU,Ie.META,Ie.NAV,Ie.NOEMBED,Ie.NOFRAMES,Ie.NOSCRIPT,Ie.OBJECT,Ie.OL,Ie.P,Ie.PARAM,Ie.PLAINTEXT,Ie.PRE,Ie.SCRIPT,Ie.SECTION,Ie.SELECT,Ie.SOURCE,Ie.STYLE,Ie.SUMMARY,Ie.TABLE,Ie.TBODY,Ie.TD,Ie.TEMPLATE,Ie.TEXTAREA,Ie.TFOOT,Ie.TH,Ie.THEAD,Ie.TITLE,Ie.TR,Ie.TRACK,Ie.UL,Ie.WBR,Ie.XMP]),[ke.MATHML]:new Set([Ie.MI,Ie.MO,Ie.MN,Ie.MS,Ie.MTEXT,Ie.ANNOTATION_XML]),[ke.SVG]:new Set([Ie.TITLE,Ie.FOREIGN_OBJECT,Ie.DESC]),[ke.XLINK]:new Set,[ke.XML]:new Set,[ke.XMLNS]:new Set},sx=new Set([Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6]);ie.STYLE,ie.SCRIPT,ie.XMP,ie.IFRAME,ie.NOEMBED,ie.NOFRAMES,ie.PLAINTEXT;var K;(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"})(K||(K={}));const Qn={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function pne(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function vd(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function mne(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function Ba(e){return mne(e)||vd(e)}function Q2(e){return Ba(e)||pne(e)}function Np(e){return e+32}function zD(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function Z2(e){return zD(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function gne(e){return e===$.NULL?de.nullCharacterReference:e>1114111?de.characterReferenceOutsideUnicodeRange:FD(e)?de.surrogateCharacterReference:$D(e)?de.noncharacterCharacterReference:UD(e)||e===$.CARRIAGE_RETURN?de.controlCharacterReference:null}class yne{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=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new nne(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new une(rne,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(de.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(de.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=gne(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(de.endTagWithAttributes),t.selfClosing&&this._err(de.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 St.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case St.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case St.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:St.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=zD(t)?St.WHITESPACE_CHARACTER:t===$.NULL?St.NULL_CHARACTER:St.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(St.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ia.Attribute:ia.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case K.DATA:{this._stateData(t);break}case K.RCDATA:{this._stateRcdata(t);break}case K.RAWTEXT:{this._stateRawtext(t);break}case K.SCRIPT_DATA:{this._stateScriptData(t);break}case K.PLAINTEXT:{this._statePlaintext(t);break}case K.TAG_OPEN:{this._stateTagOpen(t);break}case K.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case K.TAG_NAME:{this._stateTagName(t);break}case K.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case K.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case K.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case K.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case K.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case K.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case K.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case K.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case K.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case K.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case K.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case K.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case K.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case K.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case K.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case K.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case K.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case K.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case K.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case K.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case K.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case K.BOGUS_COMMENT:{this._stateBogusComment(t);break}case K.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case K.COMMENT_START:{this._stateCommentStart(t);break}case K.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case K.COMMENT:{this._stateComment(t);break}case K.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case K.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case K.COMMENT_END:{this._stateCommentEnd(t);break}case K.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case K.DOCTYPE:{this._stateDoctype(t);break}case K.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case K.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case K.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case K.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case K.CDATA_SECTION:{this._stateCdataSection(t);break}case K.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case K.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case K.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case K.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(de.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=K.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ba(t))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=K.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=K.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(de.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(de.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=K.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ba(t))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(de.missingEndTagName),this.state=K.DATA;break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ba(t)?(this._emitChars("<"),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ba(t)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(es.SCRIPT,!1)&&Z2(this.preprocessor.peek(es.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])!==ke.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(vne,ke.HTML)}clearBackToTableBodyContext(){this.clearBackTo(wne,ke.HTML)}clearBackToTableRowContext(){this.clearBackTo(xne,ke.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 ke.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ke.SVG:{if(tA.has(s))return!1;break}case ke.MATHML:{if(eA.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,mg)}hasInListItemScope(t){return this.hasInDynamicScope(t,bne)}hasInButtonScope(t){return this.hasInDynamicScope(t,Ene)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ke.HTML:{if(sx.has(n))return!0;if(mg.has(n))return!1;break}case ke.SVG:{if(tA.has(n))return!1;break}case ke.MATHML:{if(eA.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.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])===ke.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])===ke.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&&VD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&J2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&J2.has(this.currentTagId);)this.pop()}}const Nb=3;var Mi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Mi||(Mi={}));const nA={type:Mi.Marker};class Nne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=Nb&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(nA)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Mi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Mi.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(nA);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Mi.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Mi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Mi.Element&&n.element===t)}}const Fa={createDocument(){return{nodeName:"#document",mode:Ps.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};Fa.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(Fa.isTextNode(n)){n.value+=t;return}}Fa.appendChild(e,Fa.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Fa.isTextNode(r)?r.value+=t:Fa.insertBefore(e,Fa.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Rne(e){return e.name===KD&&e.publicId===null&&(e.systemId===null||e.systemId===Sne)}function One(e){if(e.name!==KD)return Ps.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Tne)return Ps.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Cne.has(n))return Ps.QUIRKS;let r=t===null?Ane:YD;if(rA(n,r))return Ps.QUIRKS;if(r=t===null?WD:Ine,rA(n,r))return Ps.LIMITED_QUIRKS}return Ps.NO_QUIRKS}const sA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Lne="definitionurl",Mne="definitionURL",jne=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])),Dne=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ke.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ke.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ke.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ke.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ke.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ke.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ke.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ke.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ke.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ke.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ke.XMLNS}]]),Pne=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])),Bne=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 Fne(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===tl.COLOR||r===tl.SIZE||r===tl.FACE)||Bne.has(t)}function GD(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)===ke.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ke.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=Qn.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)===ie.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ke.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Qn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Qn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Qn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Qn.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(l=>this.treeAdapter.isDocumentTypeNode(l));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,ke.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ke.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(ie.HTML,ke.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===St.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)===ie.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ke.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ke.HTML)}_processToken(t){switch(t.type){case St.CHARACTER:{this.onCharacter(t);break}case St.NULL_CHARACTER:{this.onNullCharacter(t);break}case St.COMMENT:{this.onComment(t);break}case St.DOCTYPE:{this.onDoctype(t);break}case St.START_TAG:{this._processStartTag(t);break}case St.END_TAG:{this.onEndTag(t);break}case St.EOF:{this.onEof(t);break}case St.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return zne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Mi.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=Q.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=Q.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Q.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Q.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Q.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Q.IN_TABLE;return}case v.BODY:{this.insertionMode=Q.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Q.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?Q.AFTER_HEAD:Q.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Q.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Q.IN_HEAD;return}break}}this.insertionMode=Q.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=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(t){return XD.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)===ke.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 hne[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_se(this,t);return}switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:{ZD(this,t);break}case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{sP(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){vse(this,t);return}switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.TEXT:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ix(this,t);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{ix(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.AFTER_BODY:{ere(this,t);break}case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{tre(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:{nre(this,t);break}case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:{this._err(t,de.misplacedDoctype);break}case Q.IN_TABLE_TEXT:{id(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,de.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?kse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{rre(this,t);break}case Q.BEFORE_HEAD:{ire(this,t);break}case Q.IN_HEAD:{_i(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{lre(this,t);break}case Q.AFTER_HEAD:{ure(this,t);break}case Q.IN_BODY:{Fr(this,t);break}case Q.IN_TABLE:{ru(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_CAPTION:{ase(this,t);break}case Q.IN_COLUMN_GROUP:{f_(this,t);break}case Q.IN_TABLE_BODY:{C0(this,t);break}case Q.IN_ROW:{I0(this,t);break}case Q.IN_CELL:{cse(this,t);break}case Q.IN_SELECT:{oP(this,t);break}case Q.IN_SELECT_IN_TABLE:{dse(this,t);break}case Q.IN_TEMPLATE:{hse(this,t);break}case Q.AFTER_BODY:{mse(this,t);break}case Q.IN_FRAMESET:{gse(this,t);break}case Q.AFTER_FRAMESET:{bse(this,t);break}case Q.AFTER_AFTER_BODY:{xse(this,t);break}case Q.AFTER_AFTER_FRAMESET:{wse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Nse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{sre(this,t);break}case Q.BEFORE_HEAD:{are(this,t);break}case Q.IN_HEAD:{ore(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{cre(this,t);break}case Q.AFTER_HEAD:{dre(this,t);break}case Q.IN_BODY:{A0(this,t);break}case Q.TEXT:{Xre(this,t);break}case Q.IN_TABLE:{Pf(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_CAPTION:{ose(this,t);break}case Q.IN_COLUMN_GROUP:{lse(this,t);break}case Q.IN_TABLE_BODY:{ax(this,t);break}case Q.IN_ROW:{aP(this,t);break}case Q.IN_CELL:{use(this,t);break}case Q.IN_SELECT:{lP(this,t);break}case Q.IN_SELECT_IN_TABLE:{fse(this,t);break}case Q.IN_TEMPLATE:{pse(this,t);break}case Q.AFTER_BODY:{uP(this,t);break}case Q.IN_FRAMESET:{yse(this,t);break}case Q.AFTER_FRAMESET:{Ese(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onEof(t){switch(this.insertionMode){case Q.INITIAL:{sd(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{nP(this,t);break}case Q.TEXT:{Qre(this,t);break}case Q.IN_TABLE_TEXT:{id(this,t);break}case Q.IN_TEMPLATE:{cP(this,t);break}case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{d_(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 Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{this._insertCharacters(t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{QD(this,t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{rP(this,t);break}}}};function Gne(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):tP(e,t),n}function qne(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 Xne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Yne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Qne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Qne(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 Zne(e,t,n){const r=e.treeAdapter.getTagName(t),s=Su(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===ke.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Jne(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 u_(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 nre(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ps.QUIRKS:One(t);Rne(t)||e._err(t,de.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function sd(e,t){e._err(t,de.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ps.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function rre(e,t){t.tagID===v.HTML?(e._insertElement(t,ke.HTML),e.insertionMode=Q.BEFORE_HEAD):Gd(e,t)}function sre(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Gd(e,t)}function Gd(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function ire(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.HEAD:{e._insertElement(t,ke.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break}default:qd(e,t)}}function are(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?qd(e,t):e._err(t,de.endTagWithoutMatchingOpenElement)}function qd(e,t){e._insertFakeElement(ie.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function _i(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Qn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Qn.RAWTEXT):(e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Qn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Qn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Xd(e,t)}}function ore(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Xd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Nl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,de.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,de.endTagWithoutMatchingOpenElement)}function Xd(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function lre(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{_i(e,t);break}case v.NOSCRIPT:{e._err(t,de.nestedNoscriptInHead);break}default:Qd(e,t)}}function cre(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break}case v.BR:{Qd(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Qd(e,t){const n=t.type===St.EOF?de.openElementsLeftAfterEof:de.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function ure(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BODY:{e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,ke.HTML),e.insertionMode=Q.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,de.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),_i(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Zd(e,t)}}function dre(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Zd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Zd(e,t){e._insertFakeElement(ie.BODY,v.BODY),e.insertionMode=Q.IN_BODY,T0(e,t)}function T0(e,t){switch(t.type){case St.CHARACTER:{ZD(e,t);break}case St.WHITESPACE_CHARACTER:{QD(e,t);break}case St.COMMENT:{ix(e,t);break}case St.START_TAG:{Fr(e,t);break}case St.END_TAG:{A0(e,t);break}case St.EOF:{nP(e,t);break}}}function QD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ZD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function fre(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function hre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function pre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_FRAMESET)}function mre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function gre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&sx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ke.HTML)}function yre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function bre(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),n||(e.formElement=e.openElements.current))}function Ere(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,ke.HTML)}function xre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.tokenizer.state=Qn.PLAINTEXT}function wre(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1}function vre(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ie.A);n&&(u_(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _re(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(u_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Sre(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ps.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function JD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function eP(e){const t=HD(e,tl.TYPE);return t!=null&&t.toLowerCase()===Vne}function Tre(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),eP(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Are(e,t){e._appendElement(t,ke.HTML),t.ackSelfClosing=!0}function Cre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ire(e,t){t.tagName=ie.IMG,t.tagID=v.IMG,JD(e,t)}function Rre(e,t){e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Qn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function Ore(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function Lre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function oA(e,t){e._switchToTextParsing(t,Qn.RAWTEXT)}function Mre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function jre(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Dre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ke.HTML)}function Pre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,ke.HTML)}function Bre(e,t){e._reconstructActiveFormattingElements(),GD(t),c_(t),t.selfClosing?e._appendElement(t,ke.MATHML):e._insertElement(t,ke.MATHML),t.ackSelfClosing=!0}function Fre(e,t){e._reconstructActiveFormattingElements(),qD(t),c_(t),t.selfClosing?e._appendElement(t,ke.SVG):e._insertElement(t,ke.SVG),t.ackSelfClosing=!0}function lA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Fr(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:{_re(e,t);break}case v.A:{vre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{gre(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:{mre(e,t);break}case v.LI:case v.DD:case v.DT:{Ere(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{JD(e,t);break}case v.HR:{Cre(e,t);break}case v.RB:case v.RTC:{Dre(e,t);break}case v.RT:case v.RP:{Pre(e,t);break}case v.PRE:case v.LISTING:{yre(e,t);break}case v.XMP:{Ore(e,t);break}case v.SVG:{Fre(e,t);break}case v.HTML:{fre(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:{_i(e,t);break}case v.BODY:{hre(e,t);break}case v.FORM:{bre(e,t);break}case v.NOBR:{kre(e,t);break}case v.MATH:{Bre(e,t);break}case v.TABLE:{Sre(e,t);break}case v.INPUT:{Tre(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{Are(e,t);break}case v.IMAGE:{Ire(e,t);break}case v.BUTTON:{wre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Nre(e,t);break}case v.IFRAME:{Lre(e,t);break}case v.SELECT:{Mre(e,t);break}case v.OPTION:case v.OPTGROUP:{jre(e,t);break}case v.NOEMBED:case v.NOFRAMES:{oA(e,t);break}case v.FRAMESET:{pre(e,t);break}case v.TEXTAREA:{Rre(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?oA(e,t):lA(e,t);break}case v.PLAINTEXT:{xre(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:lA(e,t)}}function Ure(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function $re(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,uP(e,t))}function Hre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function zre(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 Vre(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ie.P,v.P),e._closePElement()}function Kre(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Yre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Wre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Gre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function qre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ie.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function tP(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 A0(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:{u_(e,t);break}case v.P:{Vre(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:{Hre(e,t);break}case v.LI:{Kre(e);break}case v.DD:case v.DT:{Yre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Wre(e);break}case v.BR:{qre(e);break}case v.BODY:{Ure(e,t);break}case v.HTML:{$re(e,t);break}case v.FORM:{zre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Gre(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:tP(e,t)}}function nP(e,t){e.tmplInsertionModeStack.length>0?cP(e,t):d_(e,t)}function Xre(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 Qre(e,t){e._err(t,de.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Sb(e,t){if(e.openElements.currentTagId!==void 0&&XD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case St.CHARACTER:{sP(e,t);break}case St.WHITESPACE_CHARACTER:{rP(e,t);break}}else mh(e,t)}function Zre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_CAPTION}function Jre(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function ese(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.COLGROUP,v.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t)}function tse(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_TABLE_BODY}function nse(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.TBODY,v.TBODY),e.insertionMode=Q.IN_TABLE_BODY,C0(e,t)}function rse(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function sse(e,t){eP(t)?e._appendElement(t,ke.HTML):mh(e,t),t.ackSelfClosing=!0}function ise(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ke.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ru(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{nse(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{_i(e,t);break}case v.COL:{ese(e,t);break}case v.FORM:{ise(e,t);break}case v.TABLE:{rse(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{tse(e,t);break}case v.INPUT:{sse(e,t);break}case v.CAPTION:{Zre(e,t);break}case v.COLGROUP:{Jre(e,t);break}default:mh(e,t)}}function Pf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Nl(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:mh(e,t)}}function mh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,T0(e,t),e.fosterParentingEnabled=n}function rP(e,t){e.pendingCharacterTokens.push(t)}function sP(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function id(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:{Nl(e,t);break}}}function dse(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)):oP(e,t)}function fse(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)):lP(e,t)}function hse(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:{_i(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,ru(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,C0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,I0(e,t);break}default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,Fr(e,t)}}function pse(e,t){t.tagID===v.TEMPLATE&&Nl(e,t)}function cP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):d_(e,t)}function mse(e,t){t.tagID===v.HTML?Fr(e,t):yg(e,t)}function uP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Q.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 yg(e,t)}function yg(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function gse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.FRAMESET:{e._insertElement(t,ke.HTML);break}case v.FRAME:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{_i(e,t);break}}}function yse(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function bse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function Ese(e,t){t.tagID===v.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function xse(e,t){t.tagID===v.HTML?Fr(e,t):hm(e,t)}function hm(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function wse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function vse(e,t){t.chars=Tn,e._insertCharacters(t)}function _se(e,t){e._insertCharacters(t),e.framesetOk=!1}function dP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ke.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function kse(e,t){if(Fne(t))dP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ke.MATHML?GD(t):r===ke.SVG&&(Une(t),qD(t)),c_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Nse(e,t){if(t.tagID===v.P||t.tagID===v.BR){dP(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)===ke.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ie.AREA,ie.BASE,ie.BASEFONT,ie.BGSOUND,ie.BR,ie.COL,ie.EMBED,ie.FRAME,ie.HR,ie.IMG,ie.INPUT,ie.KEYGEN,ie.LINK,ie.META,ie.PARAM,ie.SOURCE,ie.TRACK,ie.WBR;const Sse=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Tse=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),cA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fP(e,t){const n=Pse(e),r=T3("type",{handlers:{root:Ase,element:Cse,text:Ise,comment:pP,doctype:Rse,raw:Lse},unknown:Mse}),s={parser:n?new aA(cA):aA.getFragmentParser(void 0,cA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),Tu(s,Yi());const i=n?s.parser.document:s.parser.getFragment(),a=Bte(i,{file:s.options.file});return s.stitches&&hh(a,"comment",function(l,c,u){const d=l;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 hP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:St.CHARACTER,chars:e.value,location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Rse(e,t){const n={type:St.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ose(e,t){t.stitches=!0;const n=Bse(e);if("children"in e&&"children"in n){const r=fP({type:"root",children:e.children},t.options);n.children=r.children}pP({type:"comment",value:{stitch:n}},t)}function pP(e,t){const n=e.value,r={type:St.COMMENT,data:n,location:gh(e)};Tu(t,Yi(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Lse(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,mP(t,Yi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Sse,"<$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 Mse(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Ose(n,t);else{let r="";throw Tse.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 Tu(e,t){mP(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=Qn.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 mP(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 jse(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Qn.PLAINTEXT)return;Tu(t,Yi(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Yo.html;s===Yo.html&&n==="svg"&&(s=Yo.svg);const i=zte({...e,children:[]},{space:s===Yo.svg?"svg":"html"}),a={type:St.START_TAG,tagName:n,tagID:Su(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:gh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Dse(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Qte.includes(n)||t.parser.tokenizer.state===Qn.PLAINTEXT)return;Tu(t,w0(e));const r={type:St.END_TAG,tagName:n,tagID:Su(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:gh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Qn.RCDATA||t.parser.tokenizer.state===Qn.RAWTEXT||t.parser.tokenizer.state===Qn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Qn.DATA)}function Pse(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function gh(e){const t=Yi(e)||{line:void 0,column:void 0,offset:void 0},n=w0(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 Bse(e){return"children"in e?tu({...e,children:[]}):tu(e)}function Fse(e){return function(t,n){return fP(t,{...e,file:n})}}const gP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function yP(e){if(!e)return!1;try{const t=e.toLowerCase();return gP.some(n=>t.includes(n))}catch{return!1}}function Use(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(yP(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 gP.some(i=>s.includes(i))}return!1}function $se({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(VX,{remarkPlugins:[rJ],rehypePlugins:n?[Fse,Y2]:[Y2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(yP(d)||Use(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(_M,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Ac,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(Tr,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const yh=E.memo($se),uA=6,dA=7,Hse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ox(e){return Hse[(e||"").trim().toLowerCase()]||"未知"}function fA(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 zse(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 Vse(e){const t=e.replace(/\r\n/g,` +`))}function c(p,m,g,w){const y=g.enter("tableCell"),b=g.enter("phrasing"),x=g.containerPhrasing(p,{...w,before:i,after:i});return b(),y(),x}function u(p,m){return OQ(p,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(p,m,g){const w=p.children;let y=-1;const b=[],x=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DZ={tokenize:VZ,partial:!0};function PZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$Z,continuation:{tokenize:HZ},exit:zZ}},text:{91:{name:"gfmFootnoteCall",tokenize:UZ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BZ,resolveTo:FZ}}}}function BZ(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 l;function l(c){if(!a||!a._balanced)return n(c);const u=xi(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 FZ(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)},l=[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,...l),e}function UZ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(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||un(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(xi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return un(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 $Z(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;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&&!l||m===null||m===91||un(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=xi(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return un(m)||(l=!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),Mt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function HZ(e,t,n){return e.check(dh,t,e.attempt(DZ,t,n))}function zZ(e){e.exit("gfmFootnoteDefinition")}function VZ(e,t,n){const r=this;return Mt(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 KZ(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,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),y=tu(m);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,l(m)}}}class YZ{constructor(){this.map=[]}add(t,n,r){WZ(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 WZ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const L=r.events[j][1].type;if(L==="lineEnding"||L==="linePrefix")j--;else break}const F=j>-1?r.events[j][1].type:null,Y=F==="tableHead"||F==="tableRow"?N:c;return Y===N&&r.parser.lazy[r.now().line]?n(I):Y(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,i+=1),d(I)}function d(I){return I===null?n(I):it(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):Tt(I)?Mt(e,d,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||un(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,Tt(I)?Mt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?w(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),g):k(I)}function g(I){return Tt(I)?Mt(e,w,"whitespace")(I):w(I)}function w(I){return I===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(i+=1,y(I)):I===null||it(I)?_(I):k(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):k(I)}function b(I){return I===45?(e.consume(I),b):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return Tt(I)?Mt(e,_,"whitespace")(I):_(I)}function _(I){return I===124?m(I):I===null||it(I)?!a||s!==i?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function N(I){return e.enter("tableRow"),T(I)}function T(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),T):I===null||it(I)?(e.exit("tableRow"),t(I)):Tt(I)?Mt(e,T,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||un(I)?(e.exit("data"),T(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function QZ(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new YZ;for(;++nn[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},Wl(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function T2(e,t,n,r,s){const i=[],a=Wl(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 Wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZZ={name:"tasklistCheck",tokenize:eJ};function JZ(){return{text:{91:ZZ}}}function eJ(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 un(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"),l):n(c)}function l(c){return it(c)?t(c):Tt(c)?e.check({tokenize:tJ},t,n)(c):n(c)}}function tJ(e,t,n){return Mt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function nJ(e){return t3([TZ(),PZ(),KZ(e),qZ(),JZ()])}const rJ={};function sJ(e){const t=this,n=e||rJ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(nJ(n)),i.push(_Z()),a.push(kZ(n))}const A2=function(e,t,n){const r=fh(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 G3(e,t,n){return e.type==="element"?fJ(e,t,n):e.type==="text"?n.whitespace==="normal"?q3(e,n):hJ(e):[]}function fJ(e,t,n){const r=X3(e,n),s=e.children||[];let i=-1,a=[];if(uJ(e))return a;let l,c;for(tx(e)||O2(e)&&A2(t,e,O2)?c=` +`:cJ(e)?(l=2,c=2):W3(e)&&(l=1,c=1);++i]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function xJ(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=EJ(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 Q3(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"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);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},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["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:g,literal:w,built_in:[...b,...x,"set","shopt",..._,...k]},contains:[p,e.SHEBANG(),m,f,i,a,y,l,c,u,d,n]}}function wJ(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("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},p=t.optional(s)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:y.concat([{begin:/\(/,end:/\)/,keywords:w,contains:y.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function vJ(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("<[^<>]+>")+")",l={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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["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:g,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},k={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[k,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={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,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"",keywords:_,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function _J(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},l=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]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=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"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,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:"("+x+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const kJ=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_-]*/}}),NJ=["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"],SJ=["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"],TJ=[...NJ,...SJ],AJ=["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(),CJ=["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(),IJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RJ=["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 OJ(e){const t=e.regex,n=kJ(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_-]*",l=[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:":("+CJ.join("|")+")"},{begin:":(:)?("+IJ.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RJ.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{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:AJ.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TJ.join("|")+")\\b"}]}}function LJ(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 MJ(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:"J3(e,t,n-1))}function DJ(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+J3("(?:<"+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,L2,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},L2,u]}}const M2="[A-Za-z$_][0-9A-Za-z$_]*",PJ=["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"],BJ=["true","false","null","undefined","NaN","Infinity"],eD=["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"],tD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],FJ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],UJ=[].concat(nD,eD,tD);function rD(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:M2,keyword:PJ,literal:BJ,built_in:UJ,"variable.language":FJ},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...eD,...tD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...nD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function sD(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 ql="[0-9](_*[0-9])*",wp=`\\.(${ql})`,vp="[0-9a-fA-F](_*[0-9a-fA-F])*",$J={className:"number",variants:[{begin:`(\\b(${ql})((${wp})|\\.)?|(${wp}))[eE][+-]?(${ql})[fFdD]?\\b`},{begin:`\\b(${ql})((${wp})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wp})[fFdD]?\\b`},{begin:`\\b(${ql})[fFdD]\\b`},{begin:`\\b0[xX]((${vp})\\.?|(${vp})?\\.(${vp}))[pP][+-]?(${ql})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vp})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function HJ(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 l={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=$J,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,l,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,l,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},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const zJ=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_-]*/}}),VJ=["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"],KJ=["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"],YJ=[...VJ,...KJ],WJ=["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(),iD=["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(),aD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),GJ=["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(),qJ=iD.concat(aD).sort().reverse();function XJ(e){const t=zJ(e),n=qJ,r="and or not only",s="[\\w-]+",i="("+s+"|@\\{"+s+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,_,k){return{className:x,begin:_,relevance:k}},d={$pattern:/[a-z-]+/,keyword:r,attribute:WJ.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.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=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+GJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={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:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={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("+YJ.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:":("+iD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+aD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,w,b,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function QJ(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 oD(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}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),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(y=>{y.contains=y.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 ZJ(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_]*/,l={"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:l,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 JJ(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:/\}/},l={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:[l]},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=(g,w,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,w);return t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,w,y)=>t.concat(t.concat("(?:",g,")"),w,/(?:\\.|[^\\\/])*?/,y,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,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,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 eee(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},l={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,U)=>{U.data._beginMatch=L[1]||L[2]},"on:end":(L,U)=>{U.data._beginMatch!==L[1]&&U.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],y=["__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"],b=["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:y,literal:(L=>{const U=[];return L.forEach(C=>{U.push(C),C.toLowerCase()===C?U.push(C.toUpperCase()):U.push(C.toLowerCase())}),U})(w),built_in:b},k=L=>L.map(U=>U.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",k(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,g,N]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",k(y).join("\\b|"),"|",k(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(j);const F=[R,S,e.C_BLOCK_COMMENT_MODE,m,g,N],Y={begin:t.concat(/#\[\s*\\?/,t.either(s,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:s},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,j,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",Y,a,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{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,g]}}function tee(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 nee(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function cD(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"],l={$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:l,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("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[g,y,f]}]}}function ree(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function see(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 iee(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"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],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"}]},g={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:[g]},{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,g.contains=N;const I=[{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(I).concat(u).concat(N)}}function aee(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))?",l=["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:l,literal:c,built_in:u},illegal:""},i]}}const oee=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_-]*/}}),lee=["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"],cee=["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"],uee=[...lee,...cee],dee=["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(),fee=["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(),hee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pee=["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 mee(e){const t=oee(e),n=hee,r=fee,s="@[a-z-]+",i="and or not only",l={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("+uee.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pee.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,l,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:dee.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function gee(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function yee(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"],l=["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)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(k){return t.concat(/\b/,t.either(...k.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:b(h),relevance:0};function _(k,{exceptions:N,when:T}={}){const S=T;return N=N||[],k.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:k=>k.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:b(a)},x,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function uD(e){return e?typeof e=="string"?e:e.source:null}function sd(e){return tn("(?=",e,")")}function tn(...e){return e.map(n=>uD(n)).join("")}function bee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function zr(...e){return"("+(bee(e).capture?"":"?:")+e.map(r=>uD(r)).join("|")+")"}const n_=e=>tn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Eee=["Protocol","Type"].map(n_),j2=["init","self"].map(n_),xee=["Any","Self"],vb=["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"],D2=["false","nil","true"],wee=["assignment","associativity","higherThan","left","lowerThan","none","right"],vee=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],P2=["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"],dD=zr(/[/=\-+!*%<>&|^~?]/,/[\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]/),fD=zr(dD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),_b=tn(dD,fD,"*"),hD=zr(/[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]/),fg=zr(hD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ii=tn(hD,fg,"*"),_p=tn(/[A-Z]/,fg,"*"),_ee=["attached","autoclosure",tn(/convention\(/,zr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",tn(/objc\(/,Ii,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],kee=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Nee(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,zr(...Eee,...j2)],className:{2:"keyword"}},i={match:tn(/\./,zr(...vb)),relevance:0},a=vb.filter(Re=>typeof Re=="string").concat(["_|0"]),l=vb.filter(Re=>typeof Re!="string").concat(xee).map(n_),c={variants:[{className:"keyword",match:zr(...l,...j2)}]},u={$pattern:zr(/\b\w+/,/#\w+/),keyword:a.concat(vee),literal:D2},d=[s,i,c],f={match:tn(/\./,zr(...P2)),relevance:0},h={className:"built_in",match:tn(/\b/,zr(...P2),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:_b},{match:`\\.(\\.|${fD})+`}]},w=[m,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(Re="")=>({className:"subst",variants:[{match:tn(/\\/,Re,/[0\\tnr"']/)},{match:tn(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(Re="")=>({className:"subst",match:tn(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(Re="")=>({className:"subst",label:"interpol",begin:tn(/\\/,Re,/\(/),end:/\)/}),T=(Re="")=>({begin:tn(Re,/"""/),end:tn(/"""/,Re),contains:[_(Re),k(Re),N(Re)]}),S=(Re="")=>({begin:tn(Re,/"/),end:tn(/"/,Re),contains:[_(Re),N(Re)]}),R={className:"string",variants:[T(),T("#"),T("##"),T("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=Re=>{const Ye=tn(Re,/\//),Le=tn(/\//,Re);return{begin:Ye,end:Le,contains:[...I,{scope:"comment",begin:`#(?!.*${Le})`,end:/$/}]}},Y={scope:"regexp",variants:[F("###"),F("##"),F("#"),j]},L={match:tn(/`/,Ii,/`/)},U={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${fg}+`},M=[L,U,C],O={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:kee,contains:[...w,x,R]}]}},D={scope:"keyword",match:tn(/@/,zr(..._ee),sd(zr(/\(/,/\s+/)))},A={scope:"meta",match:tn(/@/,Ii)},H=[O,D,A],W={match:sd(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:tn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,fg,"+")},{className:"type",match:_p,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:tn(/\s+&\s+/,sd(_p)),relevance:0}]},P={begin://,keywords:u,contains:[...r,...d,...H,m,W]};W.contains.push(P);const te={match:tn(Ii,/\s*:/),keywords:"_|0",relevance:0},X={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",te,...r,Y,...d,...p,...w,x,R,...M,...H,W]},ne={begin://,keywords:"repeat each",contains:[...r,W]},ce={begin:zr(sd(tn(Ii,/\s*:/)),sd(tn(Ii,/\s+/,Ii,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ii}]},J={begin:/\(/,end:/\)/,keywords:u,contains:[ce,...r,...d,...w,x,R,...H,W,X],endsParent:!0,illegal:/["']/},fe={match:[/(func|macro)/,/\s+/,zr(L.match,Ii,_b)],className:{1:"keyword",3:"title.function"},contains:[ne,J,t],illegal:[/\[/,/%/]},ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,J,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,_b],className:{1:"keyword",3:"title"}},ge={begin:[/precedencegroup/,/\s+/,_p],className:{1:"keyword",3:"title"},contains:[W],keywords:[...wee,...D2],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},we={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ae={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ii,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:_p},...d],relevance:0}]};for(const Re of R.variants){const Ye=Re.contains.find(bt=>bt.label==="interpol");Ye.keywords=u;const Le=[...d,...p,...w,x,R,...M];Ye.contains=[...Le,{begin:/\(/,end:/\)/,contains:["self",...Le]}]}return{name:"Swift",keywords:u,contains:[...r,fe,ee,xe,we,Ae,Ee,ge,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...d,...p,...w,x,R,...M,...H,W,X]}}const hg="[A-Za-z$_][0-9A-Za-z$_]*",pD=["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"],mD=["true","false","null","undefined","NaN","Infinity"],gD=["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"],yD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ED=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xD=[].concat(bD,gD,yD);function See(e){const t=e.regex,n=(O,{after:D})=>{const A="",end:""},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,D)=>{const A=O[0].length+O.index,H=O.input[A];if(H==="<"||H===","){D.ignoreMatch();return}H===">"&&(n(O,{after:A})||D.ignoreMatch());let W;const P=O.input.substring(A);if(W=P.match(/^\s*=/)){D.ignoreMatch();return}if((W=P.match(/^\s+extends\s+/))&&W.index===0){D.ignoreMatch();return}}},l={$pattern:hg,keyword:pD,literal:mD,built_in:xD,"variable.language":ED},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:l,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"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},b={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const _=[].concat(b,h.contains),k=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(_)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k},T={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:{_:[...gD,...yD]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(O){return t.concat("(?!",O.join("|"),")")}const Y={match:t.concat(/\b/,F([...bD,"super","import"].map(O=>`${O}\\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},U={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,w,b,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[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]},Y,j,T,U,{match:/\$[(.]/}]}}function wD(e){const t=e.regex,n=See(e),r=hg,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]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:hg,keyword:pD.concat(c),literal:mD,built_in:xD.concat(s),"variable.language":ED},d={className:"meta",begin:"@"+r},f=(g,w,y)=>{const b=g.contains.findIndex(x=>x.label===w);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(g=>g.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",l);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Tee(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)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,s),/ +/,t.either(a,l),/ *#/)}]},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 Aee(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},l={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,l]}}function Cee(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:/\)/}),l=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,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,a,c,l]}]}]},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 vD(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]},l=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},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,i,a],y=[...w];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Iee={arduino:xJ,bash:Q3,c:wJ,cpp:vJ,csharp:_J,css:OJ,diff:LJ,go:MJ,graphql:jJ,ini:Z3,java:DJ,javascript:rD,json:sD,kotlin:HJ,less:XJ,lua:QJ,makefile:oD,markdown:lD,objectivec:ZJ,perl:JJ,php:eee,"php-template":tee,plaintext:nee,python:cD,"python-repl":ree,r:see,ruby:iee,rust:aee,scss:mee,shell:gee,sql:yee,swift:Nee,typescript:wD,vbnet:Tee,wasm:Aee,xml:Cee,yaml:vD};function _D(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)&&_D(n)}),e}let B2=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function kD(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Xa(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 Ree="",F2=e=>!!e.scope,Oee=(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 Lee{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=kD(t)}openNode(t){if(!F2(t))return;const n=Oee(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){F2(t)&&(this.buffer+=Ree)}value(){return this.buffer}span(t){this.buffer+=``}}const U2=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class r_{constructor(){this.rootNode=U2(),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=U2({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=>{r_._collapse(n)}))}}class Mee extends r_{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 Lee(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function jf(e){return e?typeof e=="string"?e:e.source:null}function ND(e){return kl("(?=",e,")")}function jee(e){return kl("(?:",e,")*")}function Dee(e){return kl("(?:",e,")?")}function kl(...e){return e.map(n=>jf(n)).join("")}function Pee(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function s_(...e){return"("+(Pee(e).capture?"":"?:")+e.map(r=>jf(r)).join("|")+")"}function SD(e){return new RegExp(e.toString()+"|").exec("").length-1}function Bee(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Fee=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function i_(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let i=jf(r),a="";for(;i.length>0;){const l=Fee.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const Uee=/\b\B/,TD="[a-zA-Z]\\w*",a_="[a-zA-Z_]\\w*",AD="\\b\\d+(\\.\\d+)?",CD="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ID="\\b(0b[01]+)",$ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Hee=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=kl(t,/.*\b/,e.binary,/\b.*/)),Xa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Df={begin:"\\\\[\\s\\S]",relevance:0},zee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Df]},Vee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Df]},Kee={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/},S0=function(e,t,n={}){const r=Xa({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=s_("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:kl(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Yee=S0("//","$"),Wee=S0("/\\*","\\*/"),Gee=S0("#","$"),qee={scope:"number",begin:AD,relevance:0},Xee={scope:"number",begin:CD,relevance:0},Qee={scope:"number",begin:ID,relevance:0},Zee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Df,{begin:/\[/,end:/\]/,relevance:0,contains:[Df]}]},Jee={scope:"title",begin:TD,relevance:0},ete={scope:"title",begin:a_,relevance:0},tte={begin:"\\.\\s*"+a_,relevance:0},nte=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 kp=Object.freeze({__proto__:null,APOS_STRING_MODE:zee,BACKSLASH_ESCAPE:Df,BINARY_NUMBER_MODE:Qee,BINARY_NUMBER_RE:ID,COMMENT:S0,C_BLOCK_COMMENT_MODE:Wee,C_LINE_COMMENT_MODE:Yee,C_NUMBER_MODE:Xee,C_NUMBER_RE:CD,END_SAME_AS_BEGIN:nte,HASH_COMMENT_MODE:Gee,IDENT_RE:TD,MATCH_NOTHING_RE:Uee,METHOD_GUARD:tte,NUMBER_MODE:qee,NUMBER_RE:AD,PHRASAL_WORDS_MODE:Kee,QUOTE_STRING_MODE:Vee,REGEXP_MODE:Zee,RE_STARTERS_RE:$ee,SHEBANG:Hee,TITLE_MODE:Jee,UNDERSCORE_IDENT_RE:a_,UNDERSCORE_TITLE_MODE:ete});function rte(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function ste(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ite(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=rte,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ate(e,t){Array.isArray(e.illegal)&&(e.illegal=s_(...e.illegal))}function ote(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 lte(e,t){e.relevance===void 0&&(e.relevance=1)}const cte=(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=kl(n.beforeMatch,ND(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ute=["of","and","for","in","not","or","if","then","parent","list","value"],dte="keyword";function RD(e,t,n=dte){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,RD(e[i],t,i))}),r;function s(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[i,fte(c[0],c[1])]})}}function fte(e,t){return t?Number(t):hte(e)?0:1}function hte(e){return ute.includes(e.toLowerCase())}const $2={},el=e=>{console.error(e)},H2=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Fl=(e,t)=>{$2[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$2[`${e}/${t}`]=!0)},pg=new Error;function OD(e,t,{key:n}){let r=0;const s=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+r]=s[l],i[l+r]=!0,r+=SD(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function pte(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw el("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pg;if(typeof e.beginScope!="object"||e.beginScope===null)throw el("beginScope must be object"),pg;OD(e,e.begin,{key:"beginScope"}),e.begin=i_(e.begin,{joinWith:""})}}function mte(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw el("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pg;if(typeof e.endScope!="object"||e.endScope===null)throw el("endScope must be object"),pg;OD(e,e.end,{key:"endScope"}),e.end=i_(e.end,{joinWith:""})}}function gte(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function yte(e){gte(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),pte(e),mte(e)}function bte(e){function t(a,l){return new RegExp(jf(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=SD(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(i_(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);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(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(a){const l=new r;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[ste,ote,yte,cte].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[ite,ate,lte].forEach(d=>d(a,l)),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=RD(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(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=jf(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Ete(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),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=Xa(e.classNameAliases||{}),i(e)}function LD(e){return e?e.endsWithParent||LD(e.starts):!1}function Ete(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Xa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:LD(e)?Xa(e,{starts:e.starts?Xa(e.starts):null}):Object.isFrozen(e)?Xa(e):e}var xte="11.11.1";class wte extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const kb=kD,z2=Xa,V2=Symbol("nomatch"),vte=7,MD=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 l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Mee};function c(C){return l.noHighlightRe.test(C)}function u(C){let M=C.className+" ";M+=C.parentNode?C.parentNode.className:"";const O=l.languageDetectRe.exec(M);if(O){const D=S(O[1]);return D||(H2(i.replace("{}",O[1])),H2("Falling back to no-highlight mode for this block.",C)),D?O[1]:"no-highlight"}return M.split(/\s+/).find(D=>c(D)||S(D))}function d(C,M,O){let D="",A="";typeof M=="object"?(D=C,O=M.ignoreIllegals,A=M.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`),A=C,D=M),O===void 0&&(O=!0);const H={code:D,language:A};L("before:highlight",H);const W=H.result?H.result:f(H.language,H.code,O);return W.code=H.code,L("after:highlight",W),W}function f(C,M,O,D){const A=Object.create(null);function H(G,Z){return G.keywords[Z]}function W(){if(!Le.keywords){Ze.addText(ze);return}let G=0;Le.keywordPatternRe.lastIndex=0;let Z=Le.keywordPatternRe.exec(ze),he="";for(;Z;){he+=ze.substring(G,Z.index);const De=Ae.case_insensitive?Z[0].toLowerCase():Z[0],qe=H(Le,De);if(qe){const[nt,Kt]=qe;if(Ze.addText(he),he="",A[De]=(A[De]||0)+1,A[De]<=vte&&(le+=Kt),nt.startsWith("_"))he+=Z[0];else{const Et=Ae.classNameAliases[nt]||nt;X(Z[0],Et)}}else he+=Z[0];G=Le.keywordPatternRe.lastIndex,Z=Le.keywordPatternRe.exec(ze)}he+=ze.substring(G),Ze.addText(he)}function P(){if(ze==="")return;let G=null;if(typeof Le.subLanguage=="string"){if(!t[Le.subLanguage]){Ze.addText(ze);return}G=f(Le.subLanguage,ze,!0,bt[Le.subLanguage]),bt[Le.subLanguage]=G._top}else G=p(ze,Le.subLanguage.length?Le.subLanguage:null);Le.relevance>0&&(le+=G.relevance),Ze.__addSublanguage(G._emitter,G.language)}function te(){Le.subLanguage!=null?P():W(),ze=""}function X(G,Z){G!==""&&(Ze.startScope(Z),Ze.addText(G),Ze.endScope())}function ne(G,Z){let he=1;const De=Z.length-1;for(;he<=De;){if(!G._emit[he]){he++;continue}const qe=Ae.classNameAliases[G[he]]||G[he],nt=Z[he];qe?X(nt,qe):(ze=nt,W(),ze=""),he++}}function ce(G,Z){return G.scope&&typeof G.scope=="string"&&Ze.openNode(Ae.classNameAliases[G.scope]||G.scope),G.beginScope&&(G.beginScope._wrap?(X(ze,Ae.classNameAliases[G.beginScope._wrap]||G.beginScope._wrap),ze=""):G.beginScope._multi&&(ne(G.beginScope,Z),ze="")),Le=Object.create(G,{parent:{value:Le}}),Le}function J(G,Z,he){let De=Bee(G.endRe,he);if(De){if(G["on:end"]){const qe=new B2(G);G["on:end"](Z,qe),qe.isMatchIgnored&&(De=!1)}if(De){for(;G.endsParent&&G.parent;)G=G.parent;return G}}if(G.endsWithParent)return J(G.parent,Z,he)}function fe(G){return Le.matcher.regexIndex===0?(ze+=G[0],1):(ht=!0,0)}function ee(G){const Z=G[0],he=G.rule,De=new B2(he),qe=[he.__beforeBegin,he["on:begin"]];for(const nt of qe)if(nt&&(nt(G,De),De.isMatchIgnored))return fe(Z);return he.skip?ze+=Z:(he.excludeBegin&&(ze+=Z),te(),!he.returnBegin&&!he.excludeBegin&&(ze=Z)),ce(he,G),he.returnBegin?0:Z.length}function Ee(G){const Z=G[0],he=M.substring(G.index),De=J(Le,G,he);if(!De)return V2;const qe=Le;Le.endScope&&Le.endScope._wrap?(te(),X(Z,Le.endScope._wrap)):Le.endScope&&Le.endScope._multi?(te(),ne(Le.endScope,G)):qe.skip?ze+=Z:(qe.returnEnd||qe.excludeEnd||(ze+=Z),te(),qe.excludeEnd&&(ze=Z));do Le.scope&&Ze.closeNode(),!Le.skip&&!Le.subLanguage&&(le+=Le.relevance),Le=Le.parent;while(Le!==De.parent);return De.starts&&ce(De.starts,G),qe.returnEnd?0:Z.length}function ge(){const G=[];for(let Z=Le;Z!==Ae;Z=Z.parent)Z.scope&&G.unshift(Z.scope);G.forEach(Z=>Ze.openNode(Z))}let xe={};function we(G,Z){const he=Z&&Z[0];if(ze+=G,he==null)return te(),0;if(xe.type==="begin"&&Z.type==="end"&&xe.index===Z.index&&he===""){if(ze+=M.slice(Z.index,Z.index+1),!s){const De=new Error(`0 width match regex (${C})`);throw De.languageName=C,De.badRule=xe.rule,De}return 1}if(xe=Z,Z.type==="begin")return ee(Z);if(Z.type==="illegal"&&!O){const De=new Error('Illegal lexeme "'+he+'" for mode "'+(Le.scope||"")+'"');throw De.mode=Le,De}else if(Z.type==="end"){const De=Ee(Z);if(De!==V2)return De}if(Z.type==="illegal"&&he==="")return ze+=` +`,1;if(ct>1e5&&ct>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=he,he.length}const Ae=S(C);if(!Ae)throw el(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Re=bte(Ae);let Ye="",Le=D||Re;const bt={},Ze=new l.__emitter(l);ge();let ze="",le=0,ve=0,ct=0,ht=!1;try{if(Ae.__emitTokens)Ae.__emitTokens(M,Ze);else{for(Le.matcher.considerAll();;){ct++,ht?ht=!1:Le.matcher.considerAll(),Le.matcher.lastIndex=ve;const G=Le.matcher.exec(M);if(!G)break;const Z=M.substring(ve,G.index),he=we(Z,G);ve=G.index+he}we(M.substring(ve))}return Ze.finalize(),Ye=Ze.toHTML(),{language:C,value:Ye,relevance:le,illegal:!1,_emitter:Ze,_top:Le}}catch(G){if(G.message&&G.message.includes("Illegal"))return{language:C,value:kb(M),illegal:!0,relevance:0,_illegalBy:{message:G.message,index:ve,context:M.slice(ve-100,ve+100),mode:G.mode,resultSoFar:Ye},_emitter:Ze};if(s)return{language:C,value:kb(M),illegal:!1,relevance:0,errorRaised:G,_emitter:Ze,_top:Le};throw G}}function h(C){const M={value:kb(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return M._emitter.addText(C),M}function p(C,M){M=M||l.languages||Object.keys(t);const O=h(C),D=M.filter(S).filter(I).map(te=>f(te,C,!1));D.unshift(O);const A=D.sort((te,X)=>{if(te.relevance!==X.relevance)return X.relevance-te.relevance;if(te.language&&X.language){if(S(te.language).supersetOf===X.language)return 1;if(S(X.language).supersetOf===te.language)return-1}return 0}),[H,W]=A,P=H;return P.secondBest=W,P}function m(C,M,O){const D=M&&n[M]||O;C.classList.add("hljs"),C.classList.add(`language-${D}`)}function g(C){let M=null;const O=u(C);if(c(O))return;if(L("before:highlightElement",{el:C,language:O}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new wte("One of your code blocks includes unescaped HTML.",C.innerHTML);M=C;const D=M.textContent,A=O?d(D,{language:O,ignoreIllegals:!0}):p(D);C.innerHTML=A.value,C.dataset.highlighted="yes",m(C,O,A.language),C.result={language:A.language,re:A.relevance,relevance:A.relevance},A.secondBest&&(C.secondBest={language:A.secondBest.language,relevance:A.secondBest.relevance}),L("after:highlightElement",{el:C,result:A,text:D})}function w(C){l=z2(l,C)}const y=()=>{_(),Fl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){_(),Fl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function C(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",C,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function k(C,M){let O=null;try{O=M(e)}catch(D){if(el("Language definition for '{}' could not be registered.".replace("{}",C)),s)el(D);else throw D;O=a}O.name||(O.name=C),t[C]=O,O.rawDefinition=M.bind(null,e),O.aliases&&R(O.aliases,{languageName:C})}function N(C){delete t[C];for(const M of Object.keys(n))n[M]===C&&delete n[M]}function T(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:M}){typeof C=="string"&&(C=[C]),C.forEach(O=>{n[O.toLowerCase()]=M})}function I(C){const M=S(C);return M&&!M.disableAutodetect}function j(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=M=>{C["before:highlightBlock"](Object.assign({block:M.el},M))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=M=>{C["after:highlightBlock"](Object.assign({block:M.el},M))})}function F(C){j(C),r.push(C)}function Y(C){const M=r.indexOf(C);M!==-1&&r.splice(M,1)}function L(C,M){const O=C;r.forEach(function(D){D[O]&&D[O](M)})}function U(C){return Fl("10.7.0","highlightBlock will be removed entirely in v12.0"),Fl("10.7.0","Please use highlightElement now."),g(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:_,highlightElement:g,highlightBlock:U,configure:w,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:k,unregisterLanguage:N,listLanguages:T,getLanguage:S,registerAliases:R,autoDetection:I,inherit:z2,addPlugin:F,removePlugin:Y}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=xte,e.regex={concat:kl,lookahead:ND,either:s_,optional:Dee,anyNumberOfTimes:jee};for(const C in kp)typeof kp[C]=="object"&&_D(kp[C]);return Object.assign(e,kp),e},ru=MD({});ru.newInstance=()=>MD({});var _te=ru;ru.HighlightJS=ru;ru.default=ru;const ls=Xf(_te),K2={},kte="hljs-";function Nte(e){const t=ls.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:s,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||K2,h=typeof f.prefix=="string"?f.prefix:kte;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:Ste,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,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(c,u){const f=(u||K2).subset||s();let h=-1,p=0,m;for(;++hp&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function s(){return t.listLanguages()}function i(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 l(c){return!!t.getLanguage(c)}}class Ste{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,l){return l?a+"_".repeat(l):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 Tte={};function Y2(e){const t=e||Tte,n=t.aliases,r=t.detect||!1,s=t.languages||Iee,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=Nte(s);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){hh(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=Ate(h);if(g===!1||!g&&!r||g&&i&&i.includes(g))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=dJ(h,{whitespace:"pre"});let y;try{y=g?u.highlight(g,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const x=b;if(g&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!g&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function Ate(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 l=n[a];if(l===void 0){const c=q2(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>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 ene(e){return e>=56320&&e<=57343}function tne(e,t){return(e-55296)*1024+9216+t}function UD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $D(e){return e>=64976&&e<=65007||Jte.has(e)}var de;(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"})(de||(de={}));const nne=65536;class rne{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=nne,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,l=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:l,endOffset:l}}_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(ene(n))return this.pos++,this._addGap(),tne(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(de.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,FD(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){UD(t)?this._err(de.controlCharacterInInputStream):$D(t)&&this._err(de.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 sne=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))),ine=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 ane(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ine.get(e))!==null&&t!==void 0?t:e}var Er;(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"})(Er||(Er={}));const one=32;var Qa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qa||(Qa={}));function rx(e){return e>=Er.ZERO&&e<=Er.NINE}function lne(e){return e>=Er.UPPER_A&&e<=Er.UPPER_F||e>=Er.LOWER_A&&e<=Er.LOWER_F}function cne(e){return e>=Er.UPPER_A&&e<=Er.UPPER_Z||e>=Er.LOWER_A&&e<=Er.LOWER_Z||rx(e)}function une(e){return e===Er.EQUALS||cne(e)}var yr;(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"})(yr||(yr={}));var ia;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ia||(ia={}));class dne{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=yr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ia.Strict}startEntity(t){this.decodeMode=t,this.state=yr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case yr.EntityStart:return t.charCodeAt(n)===Er.NUM?(this.state=yr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=yr.NamedEntity,this.stateNamedEntity(t,n));case yr.NumericStart:return this.stateNumericStart(t,n);case yr.NumericDecimal:return this.stateNumericDecimal(t,n);case yr.NumericHex:return this.stateNumericHex(t,n);case yr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|one)===Er.LOWER_X?(this.state=yr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=yr.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===Er.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ia.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]&Qa.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]&~Qa.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case yr.NamedEntity:return this.result!==0&&(this.decodeMode!==ia.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yr.NumericDecimal:return this.emitNumericEntity(0,2);case yr.NumericHex:return this.emitNumericEntity(0,3);case yr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yr.EntityStart:return 0}}}function fne(e,t,n,r){const s=(t&Qa.BRANCH_LENGTH)>>7,i=t&Qa.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,l=a+s-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(ur)l=c-1;else return e[c+s]}return-1}var ke;(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/"})(ke||(ke={}));var tl;(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"})(tl||(tl={}));var Ps;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ps||(Ps={}));var ie;(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"})(ie||(ie={}));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 hne=new Map([[ie.A,v.A],[ie.ADDRESS,v.ADDRESS],[ie.ANNOTATION_XML,v.ANNOTATION_XML],[ie.APPLET,v.APPLET],[ie.AREA,v.AREA],[ie.ARTICLE,v.ARTICLE],[ie.ASIDE,v.ASIDE],[ie.B,v.B],[ie.BASE,v.BASE],[ie.BASEFONT,v.BASEFONT],[ie.BGSOUND,v.BGSOUND],[ie.BIG,v.BIG],[ie.BLOCKQUOTE,v.BLOCKQUOTE],[ie.BODY,v.BODY],[ie.BR,v.BR],[ie.BUTTON,v.BUTTON],[ie.CAPTION,v.CAPTION],[ie.CENTER,v.CENTER],[ie.CODE,v.CODE],[ie.COL,v.COL],[ie.COLGROUP,v.COLGROUP],[ie.DD,v.DD],[ie.DESC,v.DESC],[ie.DETAILS,v.DETAILS],[ie.DIALOG,v.DIALOG],[ie.DIR,v.DIR],[ie.DIV,v.DIV],[ie.DL,v.DL],[ie.DT,v.DT],[ie.EM,v.EM],[ie.EMBED,v.EMBED],[ie.FIELDSET,v.FIELDSET],[ie.FIGCAPTION,v.FIGCAPTION],[ie.FIGURE,v.FIGURE],[ie.FONT,v.FONT],[ie.FOOTER,v.FOOTER],[ie.FOREIGN_OBJECT,v.FOREIGN_OBJECT],[ie.FORM,v.FORM],[ie.FRAME,v.FRAME],[ie.FRAMESET,v.FRAMESET],[ie.H1,v.H1],[ie.H2,v.H2],[ie.H3,v.H3],[ie.H4,v.H4],[ie.H5,v.H5],[ie.H6,v.H6],[ie.HEAD,v.HEAD],[ie.HEADER,v.HEADER],[ie.HGROUP,v.HGROUP],[ie.HR,v.HR],[ie.HTML,v.HTML],[ie.I,v.I],[ie.IMG,v.IMG],[ie.IMAGE,v.IMAGE],[ie.INPUT,v.INPUT],[ie.IFRAME,v.IFRAME],[ie.KEYGEN,v.KEYGEN],[ie.LABEL,v.LABEL],[ie.LI,v.LI],[ie.LINK,v.LINK],[ie.LISTING,v.LISTING],[ie.MAIN,v.MAIN],[ie.MALIGNMARK,v.MALIGNMARK],[ie.MARQUEE,v.MARQUEE],[ie.MATH,v.MATH],[ie.MENU,v.MENU],[ie.META,v.META],[ie.MGLYPH,v.MGLYPH],[ie.MI,v.MI],[ie.MO,v.MO],[ie.MN,v.MN],[ie.MS,v.MS],[ie.MTEXT,v.MTEXT],[ie.NAV,v.NAV],[ie.NOBR,v.NOBR],[ie.NOFRAMES,v.NOFRAMES],[ie.NOEMBED,v.NOEMBED],[ie.NOSCRIPT,v.NOSCRIPT],[ie.OBJECT,v.OBJECT],[ie.OL,v.OL],[ie.OPTGROUP,v.OPTGROUP],[ie.OPTION,v.OPTION],[ie.P,v.P],[ie.PARAM,v.PARAM],[ie.PLAINTEXT,v.PLAINTEXT],[ie.PRE,v.PRE],[ie.RB,v.RB],[ie.RP,v.RP],[ie.RT,v.RT],[ie.RTC,v.RTC],[ie.RUBY,v.RUBY],[ie.S,v.S],[ie.SCRIPT,v.SCRIPT],[ie.SEARCH,v.SEARCH],[ie.SECTION,v.SECTION],[ie.SELECT,v.SELECT],[ie.SOURCE,v.SOURCE],[ie.SMALL,v.SMALL],[ie.SPAN,v.SPAN],[ie.STRIKE,v.STRIKE],[ie.STRONG,v.STRONG],[ie.STYLE,v.STYLE],[ie.SUB,v.SUB],[ie.SUMMARY,v.SUMMARY],[ie.SUP,v.SUP],[ie.TABLE,v.TABLE],[ie.TBODY,v.TBODY],[ie.TEMPLATE,v.TEMPLATE],[ie.TEXTAREA,v.TEXTAREA],[ie.TFOOT,v.TFOOT],[ie.TD,v.TD],[ie.TH,v.TH],[ie.THEAD,v.THEAD],[ie.TITLE,v.TITLE],[ie.TR,v.TR],[ie.TRACK,v.TRACK],[ie.TT,v.TT],[ie.U,v.U],[ie.UL,v.UL],[ie.SVG,v.SVG],[ie.VAR,v.VAR],[ie.WBR,v.WBR],[ie.XMP,v.XMP]]);function Tu(e){var t;return(t=hne.get(e))!==null&&t!==void 0?t:v.UNKNOWN}const Ie=v,pne={[ke.HTML]:new Set([Ie.ADDRESS,Ie.APPLET,Ie.AREA,Ie.ARTICLE,Ie.ASIDE,Ie.BASE,Ie.BASEFONT,Ie.BGSOUND,Ie.BLOCKQUOTE,Ie.BODY,Ie.BR,Ie.BUTTON,Ie.CAPTION,Ie.CENTER,Ie.COL,Ie.COLGROUP,Ie.DD,Ie.DETAILS,Ie.DIR,Ie.DIV,Ie.DL,Ie.DT,Ie.EMBED,Ie.FIELDSET,Ie.FIGCAPTION,Ie.FIGURE,Ie.FOOTER,Ie.FORM,Ie.FRAME,Ie.FRAMESET,Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6,Ie.HEAD,Ie.HEADER,Ie.HGROUP,Ie.HR,Ie.HTML,Ie.IFRAME,Ie.IMG,Ie.INPUT,Ie.LI,Ie.LINK,Ie.LISTING,Ie.MAIN,Ie.MARQUEE,Ie.MENU,Ie.META,Ie.NAV,Ie.NOEMBED,Ie.NOFRAMES,Ie.NOSCRIPT,Ie.OBJECT,Ie.OL,Ie.P,Ie.PARAM,Ie.PLAINTEXT,Ie.PRE,Ie.SCRIPT,Ie.SECTION,Ie.SELECT,Ie.SOURCE,Ie.STYLE,Ie.SUMMARY,Ie.TABLE,Ie.TBODY,Ie.TD,Ie.TEMPLATE,Ie.TEXTAREA,Ie.TFOOT,Ie.TH,Ie.THEAD,Ie.TITLE,Ie.TR,Ie.TRACK,Ie.UL,Ie.WBR,Ie.XMP]),[ke.MATHML]:new Set([Ie.MI,Ie.MO,Ie.MN,Ie.MS,Ie.MTEXT,Ie.ANNOTATION_XML]),[ke.SVG]:new Set([Ie.TITLE,Ie.FOREIGN_OBJECT,Ie.DESC]),[ke.XLINK]:new Set,[ke.XML]:new Set,[ke.XMLNS]:new Set},sx=new Set([Ie.H1,Ie.H2,Ie.H3,Ie.H4,Ie.H5,Ie.H6]);ie.STYLE,ie.SCRIPT,ie.XMP,ie.IFRAME,ie.NOEMBED,ie.NOFRAMES,ie.PLAINTEXT;var K;(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"})(K||(K={}));const Qn={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function mne(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function vd(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function gne(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function Ba(e){return gne(e)||vd(e)}function Q2(e){return Ba(e)||mne(e)}function Np(e){return e+32}function zD(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function Z2(e){return zD(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function yne(e){return e===$.NULL?de.nullCharacterReference:e>1114111?de.characterReferenceOutsideUnicodeRange:FD(e)?de.surrogateCharacterReference:$D(e)?de.noncharacterCharacterReference:UD(e)||e===$.CARRIAGE_RETURN?de.controlCharacterReference:null}class bne{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=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new rne(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new dne(sne,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(de.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(de.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=yne(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(de.endTagWithAttributes),t.selfClosing&&this._err(de.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 St.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case St.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case St.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:St.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=zD(t)?St.WHITESPACE_CHARACTER:t===$.NULL?St.NULL_CHARACTER:St.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(St.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ia.Attribute:ia.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case K.DATA:{this._stateData(t);break}case K.RCDATA:{this._stateRcdata(t);break}case K.RAWTEXT:{this._stateRawtext(t);break}case K.SCRIPT_DATA:{this._stateScriptData(t);break}case K.PLAINTEXT:{this._statePlaintext(t);break}case K.TAG_OPEN:{this._stateTagOpen(t);break}case K.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case K.TAG_NAME:{this._stateTagName(t);break}case K.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case K.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case K.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case K.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case K.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case K.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case K.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case K.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case K.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case K.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case K.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case K.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case K.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case K.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case K.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case K.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case K.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case K.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case K.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case K.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case K.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case K.BOGUS_COMMENT:{this._stateBogusComment(t);break}case K.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case K.COMMENT_START:{this._stateCommentStart(t);break}case K.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case K.COMMENT:{this._stateComment(t);break}case K.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case K.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case K.COMMENT_END:{this._stateCommentEnd(t);break}case K.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case K.DOCTYPE:{this._stateDoctype(t);break}case K.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case K.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case K.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case K.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case K.CDATA_SECTION:{this._stateCdataSection(t);break}case K.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case K.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case K.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case K.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(de.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=K.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(de.unexpectedNullCharacter),this._emitChars(Tn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ba(t))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=K.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=K.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(de.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(de.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=K.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ba(t))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(de.missingEndTagName),this.state=K.DATA;break}case $.EOF:{this._err(de.eofBeforeTagName),this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ba(t)?(this._emitChars("<"),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ba(t)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case $.NULL:{this._err(de.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Tn);break}case $.EOF:{this._err(de.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(es.SCRIPT,!1)&&Z2(this.preprocessor.peek(es.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])!==ke.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(_ne,ke.HTML)}clearBackToTableBodyContext(){this.clearBackTo(vne,ke.HTML)}clearBackToTableRowContext(){this.clearBackTo(wne,ke.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 ke.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ke.SVG:{if(tA.has(s))return!1;break}case ke.MATHML:{if(eA.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,mg)}hasInListItemScope(t){return this.hasInDynamicScope(t,Ene)}hasInButtonScope(t){return this.hasInDynamicScope(t,xne)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ke.HTML:{if(sx.has(n))return!0;if(mg.has(n))return!1;break}case ke.SVG:{if(tA.has(n))return!1;break}case ke.MATHML:{if(eA.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ke.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])===ke.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])===ke.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&&VD.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&J2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&J2.has(this.currentTagId);)this.pop()}}const Nb=3;var Mi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Mi||(Mi={}));const nA={type:Mi.Marker};class Sne{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 l=0;l[a.name,a.value]));let i=0;for(let a=0;as.get(c.name)===c.value)&&(i+=1,i>=Nb&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(nA)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Mi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Mi.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(nA);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Mi.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Mi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Mi.Element&&n.element===t)}}const Fa={createDocument(){return{nodeName:"#document",mode:Ps.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};Fa.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(Fa.isTextNode(n)){n.value+=t;return}}Fa.appendChild(e,Fa.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Fa.isTextNode(r)?r.value+=t:Fa.insertBefore(e,Fa.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function One(e){return e.name===KD&&e.publicId===null&&(e.systemId===null||e.systemId===Tne)}function Lne(e){if(e.name!==KD)return Ps.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Ane)return Ps.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Ine.has(n))return Ps.QUIRKS;let r=t===null?Cne:YD;if(rA(n,r))return Ps.QUIRKS;if(r=t===null?WD:Rne,rA(n,r))return Ps.LIMITED_QUIRKS}return Ps.NO_QUIRKS}const sA={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Mne="definitionurl",jne="definitionURL",Dne=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])),Pne=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ke.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ke.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ke.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ke.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ke.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ke.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ke.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ke.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ke.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ke.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ke.XMLNS}]]),Bne=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])),Fne=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 Une(e){const t=e.tagID;return t===v.FONT&&e.attrs.some(({name:r})=>r===tl.COLOR||r===tl.SIZE||r===tl.FACE)||Fne.has(t)}function GD(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)===ke.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ke.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Q.TEXT}switchToPlaintextParsing(){this.insertionMode=Q.TEXT,this.originalInsertionMode=Q.IN_BODY,this.tokenizer.state=Qn.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)===ie.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ke.HTML))switch(this.fragmentContextID){case v.TITLE:case v.TEXTAREA:{this.tokenizer.state=Qn.RCDATA;break}case v.STYLE:case v.XMP:case v.IFRAME:case v.NOEMBED:case v.NOFRAMES:case v.NOSCRIPT:{this.tokenizer.state=Qn.RAWTEXT;break}case v.SCRIPT:{this.tokenizer.state=Qn.SCRIPT_DATA;break}case v.PLAINTEXT:{this.tokenizer.state=Qn.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(l=>this.treeAdapter.isDocumentTypeNode(l));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,ke.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ke.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(ie.HTML,ke.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===St.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)===ie.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ke.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===v.MGLYPH||t.tagID===v.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ke.HTML)}_processToken(t){switch(t.type){case St.CHARACTER:{this.onCharacter(t);break}case St.NULL_CHARACTER:{this.onNullCharacter(t);break}case St.COMMENT:{this.onComment(t);break}case St.DOCTYPE:{this.onDoctype(t);break}case St.START_TAG:{this._processStartTag(t);break}case St.END_TAG:{this.onEndTag(t);break}case St.EOF:{this.onEof(t);break}case St.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return Vne(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Mi.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=Q.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=Q.IN_ROW;return}case v.TBODY:case v.THEAD:case v.TFOOT:{this.insertionMode=Q.IN_TABLE_BODY;return}case v.CAPTION:{this.insertionMode=Q.IN_CAPTION;return}case v.COLGROUP:{this.insertionMode=Q.IN_COLUMN_GROUP;return}case v.TABLE:{this.insertionMode=Q.IN_TABLE;return}case v.BODY:{this.insertionMode=Q.IN_BODY;return}case v.FRAMESET:{this.insertionMode=Q.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?Q.AFTER_HEAD:Q.BEFORE_HEAD;return}case v.TD:case v.TH:{if(t>0){this.insertionMode=Q.IN_CELL;return}break}case v.HEAD:{if(t>0){this.insertionMode=Q.IN_HEAD;return}break}}this.insertionMode=Q.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=Q.IN_SELECT_IN_TABLE;return}}this.insertionMode=Q.IN_SELECT}_isElementCausesFosterParenting(t){return XD.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)===ke.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 pne[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kse(this,t);return}switch(this.insertionMode){case Q.INITIAL:{id(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:{ZD(this,t);break}case Q.TEXT:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{sP(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_se(this,t);return}switch(this.insertionMode){case Q.INITIAL:{id(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.TEXT:{this._insertCharacters(t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_COLUMN_GROUP:{gg(this,t);break}case Q.AFTER_BODY:{yg(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ix(this,t);return}switch(this.insertionMode){case Q.INITIAL:case Q.BEFORE_HTML:case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_TEMPLATE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{ix(this,t);break}case Q.IN_TABLE_TEXT:{ad(this,t);break}case Q.AFTER_BODY:{tre(this,t);break}case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{nre(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Q.INITIAL:{rre(this,t);break}case Q.BEFORE_HEAD:case Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:{this._err(t,de.misplacedDoctype);break}case Q.IN_TABLE_TEXT:{ad(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,de.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Nse(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{id(this,t);break}case Q.BEFORE_HTML:{sre(this,t);break}case Q.BEFORE_HEAD:{are(this,t);break}case Q.IN_HEAD:{_i(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{cre(this,t);break}case Q.AFTER_HEAD:{dre(this,t);break}case Q.IN_BODY:{Fr(this,t);break}case Q.IN_TABLE:{su(this,t);break}case Q.IN_TABLE_TEXT:{ad(this,t);break}case Q.IN_CAPTION:{ose(this,t);break}case Q.IN_COLUMN_GROUP:{f_(this,t);break}case Q.IN_TABLE_BODY:{C0(this,t);break}case Q.IN_ROW:{I0(this,t);break}case Q.IN_CELL:{use(this,t);break}case Q.IN_SELECT:{oP(this,t);break}case Q.IN_SELECT_IN_TABLE:{fse(this,t);break}case Q.IN_TEMPLATE:{pse(this,t);break}case Q.AFTER_BODY:{gse(this,t);break}case Q.IN_FRAMESET:{yse(this,t);break}case Q.AFTER_FRAMESET:{Ese(this,t);break}case Q.AFTER_AFTER_BODY:{wse(this,t);break}case Q.AFTER_AFTER_FRAMESET:{vse(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Sse(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Q.INITIAL:{id(this,t);break}case Q.BEFORE_HTML:{ire(this,t);break}case Q.BEFORE_HEAD:{ore(this,t);break}case Q.IN_HEAD:{lre(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{ure(this,t);break}case Q.AFTER_HEAD:{fre(this,t);break}case Q.IN_BODY:{A0(this,t);break}case Q.TEXT:{Qre(this,t);break}case Q.IN_TABLE:{Pf(this,t);break}case Q.IN_TABLE_TEXT:{ad(this,t);break}case Q.IN_CAPTION:{lse(this,t);break}case Q.IN_COLUMN_GROUP:{cse(this,t);break}case Q.IN_TABLE_BODY:{ax(this,t);break}case Q.IN_ROW:{aP(this,t);break}case Q.IN_CELL:{dse(this,t);break}case Q.IN_SELECT:{lP(this,t);break}case Q.IN_SELECT_IN_TABLE:{hse(this,t);break}case Q.IN_TEMPLATE:{mse(this,t);break}case Q.AFTER_BODY:{uP(this,t);break}case Q.IN_FRAMESET:{bse(this,t);break}case Q.AFTER_FRAMESET:{xse(this,t);break}case Q.AFTER_AFTER_BODY:{hm(this,t);break}}}onEof(t){switch(this.insertionMode){case Q.INITIAL:{id(this,t);break}case Q.BEFORE_HTML:{Gd(this,t);break}case Q.BEFORE_HEAD:{qd(this,t);break}case Q.IN_HEAD:{Xd(this,t);break}case Q.IN_HEAD_NO_SCRIPT:{Qd(this,t);break}case Q.AFTER_HEAD:{Zd(this,t);break}case Q.IN_BODY:case Q.IN_TABLE:case Q.IN_CAPTION:case Q.IN_COLUMN_GROUP:case Q.IN_TABLE_BODY:case Q.IN_ROW:case Q.IN_CELL:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:{nP(this,t);break}case Q.TEXT:{Zre(this,t);break}case Q.IN_TABLE_TEXT:{ad(this,t);break}case Q.IN_TEMPLATE:{cP(this,t);break}case Q.AFTER_BODY:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{d_(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 Q.IN_HEAD:case Q.IN_HEAD_NO_SCRIPT:case Q.AFTER_HEAD:case Q.TEXT:case Q.IN_COLUMN_GROUP:case Q.IN_SELECT:case Q.IN_SELECT_IN_TABLE:case Q.IN_FRAMESET:case Q.AFTER_FRAMESET:{this._insertCharacters(t);break}case Q.IN_BODY:case Q.IN_CAPTION:case Q.IN_CELL:case Q.IN_TEMPLATE:case Q.AFTER_BODY:case Q.AFTER_AFTER_BODY:case Q.AFTER_AFTER_FRAMESET:{QD(this,t);break}case Q.IN_TABLE:case Q.IN_TABLE_BODY:case Q.IN_ROW:{Sb(this,t);break}case Q.IN_TABLE_TEXT:{rP(this,t);break}}}};function qne(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):tP(e,t),n}function Xne(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 Qne(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 l=e.activeFormattingElements.getElementEntry(a),c=l&&i>=Wne;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=Zne(e,l),r===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Zne(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 Jne(e,t,n){const r=e.treeAdapter.getTagName(t),s=Tu(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===v.TEMPLATE&&i===ke.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function ere(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 u_(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 rre(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ps.QUIRKS:Lne(t);One(t)||e._err(t,de.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Q.BEFORE_HTML}function id(e,t){e._err(t,de.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ps.QUIRKS),e.insertionMode=Q.BEFORE_HTML,e._processToken(t)}function sre(e,t){t.tagID===v.HTML?(e._insertElement(t,ke.HTML),e.insertionMode=Q.BEFORE_HEAD):Gd(e,t)}function ire(e,t){const n=t.tagID;(n===v.HTML||n===v.HEAD||n===v.BODY||n===v.BR)&&Gd(e,t)}function Gd(e,t){e._insertFakeRootElement(),e.insertionMode=Q.BEFORE_HEAD,e._processToken(t)}function are(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.HEAD:{e._insertElement(t,ke.HTML),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD;break}default:qd(e,t)}}function ore(e,t){const n=t.tagID;n===v.HEAD||n===v.BODY||n===v.HTML||n===v.BR?qd(e,t):e._err(t,de.endTagWithoutMatchingOpenElement)}function qd(e,t){e._insertFakeElement(ie.HEAD,v.HEAD),e.headElement=e.openElements.current,e.insertionMode=Q.IN_HEAD,e._processToken(t)}function _i(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASE:case v.BASEFONT:case v.BGSOUND:case v.LINK:case v.META:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.TITLE:{e._switchToTextParsing(t,Qn.RCDATA);break}case v.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Qn.RAWTEXT):(e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_HEAD_NO_SCRIPT);break}case v.NOFRAMES:case v.STYLE:{e._switchToTextParsing(t,Qn.RAWTEXT);break}case v.SCRIPT:{e._switchToTextParsing(t,Qn.SCRIPT_DATA);break}case v.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Q.IN_TEMPLATE);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Xd(e,t)}}function lre(e,t){switch(t.tagID){case v.HEAD:{e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD;break}case v.BODY:case v.BR:case v.HTML:{Xd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Nl(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==v.TEMPLATE&&e._err(t,de.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,de.endTagWithoutMatchingOpenElement)}function Xd(e,t){e.openElements.pop(),e.insertionMode=Q.AFTER_HEAD,e._processToken(t)}function cre(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BASEFONT:case v.BGSOUND:case v.HEAD:case v.LINK:case v.META:case v.NOFRAMES:case v.STYLE:{_i(e,t);break}case v.NOSCRIPT:{e._err(t,de.nestedNoscriptInHead);break}default:Qd(e,t)}}function ure(e,t){switch(t.tagID){case v.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Q.IN_HEAD;break}case v.BR:{Qd(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Qd(e,t){const n=t.type===St.EOF?de.openElementsLeftAfterEof:de.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Q.IN_HEAD,e._processToken(t)}function dre(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.BODY:{e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_BODY;break}case v.FRAMESET:{e._insertElement(t,ke.HTML),e.insertionMode=Q.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,de.abandonedHeadElementChild),e.openElements.push(e.headElement,v.HEAD),_i(e,t),e.openElements.remove(e.headElement);break}case v.HEAD:{e._err(t,de.misplacedStartTagForHeadElement);break}default:Zd(e,t)}}function fre(e,t){switch(t.tagID){case v.BODY:case v.HTML:case v.BR:{Zd(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:e._err(t,de.endTagWithoutMatchingOpenElement)}}function Zd(e,t){e._insertFakeElement(ie.BODY,v.BODY),e.insertionMode=Q.IN_BODY,T0(e,t)}function T0(e,t){switch(t.type){case St.CHARACTER:{ZD(e,t);break}case St.WHITESPACE_CHARACTER:{QD(e,t);break}case St.COMMENT:{ix(e,t);break}case St.START_TAG:{Fr(e,t);break}case St.END_TAG:{A0(e,t);break}case St.EOF:{nP(e,t);break}}}function QD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ZD(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function hre(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function pre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function mre(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_FRAMESET)}function gre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML)}function yre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&sx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ke.HTML)}function bre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ere(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),n||(e.formElement=e.openElements.current))}function xre(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,ke.HTML)}function wre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.tokenizer.state=Qn.PLAINTEXT}function vre(e,t){e.openElements.hasInScope(v.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(v.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1}function _re(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ie.A);n&&(u_(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function kre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nre(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(v.NOBR)&&(u_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ke.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Sre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Tre(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ps.QUIRKS&&e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=Q.IN_TABLE}function JD(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function eP(e){const t=HD(e,tl.TYPE);return t!=null&&t.toLowerCase()===Kne}function Are(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ke.HTML),eP(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Cre(e,t){e._appendElement(t,ke.HTML),t.ackSelfClosing=!0}function Ire(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._appendElement(t,ke.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Rre(e,t){t.tagName=ie.IMG,t.tagID=v.IMG,JD(e,t)}function Ore(e,t){e._insertElement(t,ke.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Qn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Q.TEXT}function Lre(e,t){e.openElements.hasInButtonScope(v.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function Mre(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Qn.RAWTEXT)}function oA(e,t){e._switchToTextParsing(t,Qn.RAWTEXT)}function jre(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Q.IN_TABLE||e.insertionMode===Q.IN_CAPTION||e.insertionMode===Q.IN_TABLE_BODY||e.insertionMode===Q.IN_ROW||e.insertionMode===Q.IN_CELL?Q.IN_SELECT_IN_TABLE:Q.IN_SELECT}function Dre(e,t){e.openElements.currentTagId===v.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Pre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ke.HTML)}function Bre(e,t){e.openElements.hasInScope(v.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(v.RTC),e._insertElement(t,ke.HTML)}function Fre(e,t){e._reconstructActiveFormattingElements(),GD(t),c_(t),t.selfClosing?e._appendElement(t,ke.MATHML):e._insertElement(t,ke.MATHML),t.ackSelfClosing=!0}function Ure(e,t){e._reconstructActiveFormattingElements(),qD(t),c_(t),t.selfClosing?e._appendElement(t,ke.SVG):e._insertElement(t,ke.SVG),t.ackSelfClosing=!0}function lA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ke.HTML)}function Fr(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:{kre(e,t);break}case v.A:{_re(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{yre(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:{gre(e,t);break}case v.LI:case v.DD:case v.DT:{xre(e,t);break}case v.BR:case v.IMG:case v.WBR:case v.AREA:case v.EMBED:case v.KEYGEN:{JD(e,t);break}case v.HR:{Ire(e,t);break}case v.RB:case v.RTC:{Pre(e,t);break}case v.RT:case v.RP:{Bre(e,t);break}case v.PRE:case v.LISTING:{bre(e,t);break}case v.XMP:{Lre(e,t);break}case v.SVG:{Ure(e,t);break}case v.HTML:{hre(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:{_i(e,t);break}case v.BODY:{pre(e,t);break}case v.FORM:{Ere(e,t);break}case v.NOBR:{Nre(e,t);break}case v.MATH:{Fre(e,t);break}case v.TABLE:{Tre(e,t);break}case v.INPUT:{Are(e,t);break}case v.PARAM:case v.TRACK:case v.SOURCE:{Cre(e,t);break}case v.IMAGE:{Rre(e,t);break}case v.BUTTON:{vre(e,t);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{Sre(e,t);break}case v.IFRAME:{Mre(e,t);break}case v.SELECT:{jre(e,t);break}case v.OPTION:case v.OPTGROUP:{Dre(e,t);break}case v.NOEMBED:case v.NOFRAMES:{oA(e,t);break}case v.FRAMESET:{mre(e,t);break}case v.TEXTAREA:{Ore(e,t);break}case v.NOSCRIPT:{e.options.scriptingEnabled?oA(e,t):lA(e,t);break}case v.PLAINTEXT:{wre(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:lA(e,t)}}function $re(e,t){if(e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Hre(e,t){e.openElements.hasInScope(v.BODY)&&(e.insertionMode=Q.AFTER_BODY,uP(e,t))}function zre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Vre(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 Kre(e){e.openElements.hasInButtonScope(v.P)||e._insertFakeElement(ie.P,v.P),e._closePElement()}function Yre(e){e.openElements.hasInListItemScope(v.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(v.LI),e.openElements.popUntilTagNamePopped(v.LI))}function Wre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Gre(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function qre(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Xre(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ie.BR,v.BR),e.openElements.pop(),e.framesetOk=!1}function tP(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 A0(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:{u_(e,t);break}case v.P:{Kre(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:{zre(e,t);break}case v.LI:{Yre(e);break}case v.DD:case v.DT:{Wre(e,t);break}case v.H1:case v.H2:case v.H3:case v.H4:case v.H5:case v.H6:{Gre(e);break}case v.BR:{Xre(e);break}case v.BODY:{$re(e,t);break}case v.HTML:{Hre(e,t);break}case v.FORM:{Vre(e);break}case v.APPLET:case v.OBJECT:case v.MARQUEE:{qre(e,t);break}case v.TEMPLATE:{Nl(e,t);break}default:tP(e,t)}}function nP(e,t){e.tmplInsertionModeStack.length>0?cP(e,t):d_(e,t)}function Qre(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 Zre(e,t){e._err(t,de.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Sb(e,t){if(e.openElements.currentTagId!==void 0&&XD.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Q.IN_TABLE_TEXT,t.type){case St.CHARACTER:{sP(e,t);break}case St.WHITESPACE_CHARACTER:{rP(e,t);break}}else mh(e,t)}function Jre(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_CAPTION}function ese(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_COLUMN_GROUP}function tse(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.COLGROUP,v.COLGROUP),e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t)}function nse(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ke.HTML),e.insertionMode=Q.IN_TABLE_BODY}function rse(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ie.TBODY,v.TBODY),e.insertionMode=Q.IN_TABLE_BODY,C0(e,t)}function sse(e,t){e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ise(e,t){eP(t)?e._appendElement(t,ke.HTML):mh(e,t),t.ackSelfClosing=!0}function ase(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ke.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function su(e,t){switch(t.tagID){case v.TD:case v.TH:case v.TR:{rse(e,t);break}case v.STYLE:case v.SCRIPT:case v.TEMPLATE:{_i(e,t);break}case v.COL:{tse(e,t);break}case v.FORM:{ase(e,t);break}case v.TABLE:{sse(e,t);break}case v.TBODY:case v.TFOOT:case v.THEAD:{nse(e,t);break}case v.INPUT:{ise(e,t);break}case v.CAPTION:{Jre(e,t);break}case v.COLGROUP:{ese(e,t);break}default:mh(e,t)}}function Pf(e,t){switch(t.tagID){case v.TABLE:{e.openElements.hasInTableScope(v.TABLE)&&(e.openElements.popUntilTagNamePopped(v.TABLE),e._resetInsertionMode());break}case v.TEMPLATE:{Nl(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:mh(e,t)}}function mh(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,T0(e,t),e.fosterParentingEnabled=n}function rP(e,t){e.pendingCharacterTokens.push(t)}function sP(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ad(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:{Nl(e,t);break}}}function fse(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)):oP(e,t)}function hse(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)):lP(e,t)}function pse(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:{_i(e,t);break}case v.CAPTION:case v.COLGROUP:case v.TBODY:case v.TFOOT:case v.THEAD:{e.tmplInsertionModeStack[0]=Q.IN_TABLE,e.insertionMode=Q.IN_TABLE,su(e,t);break}case v.COL:{e.tmplInsertionModeStack[0]=Q.IN_COLUMN_GROUP,e.insertionMode=Q.IN_COLUMN_GROUP,f_(e,t);break}case v.TR:{e.tmplInsertionModeStack[0]=Q.IN_TABLE_BODY,e.insertionMode=Q.IN_TABLE_BODY,C0(e,t);break}case v.TD:case v.TH:{e.tmplInsertionModeStack[0]=Q.IN_ROW,e.insertionMode=Q.IN_ROW,I0(e,t);break}default:e.tmplInsertionModeStack[0]=Q.IN_BODY,e.insertionMode=Q.IN_BODY,Fr(e,t)}}function mse(e,t){t.tagID===v.TEMPLATE&&Nl(e,t)}function cP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(v.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):d_(e,t)}function gse(e,t){t.tagID===v.HTML?Fr(e,t):yg(e,t)}function uP(e,t){var n;if(t.tagID===v.HTML){if(e.fragmentContext||(e.insertionMode=Q.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 yg(e,t)}function yg(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function yse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.FRAMESET:{e._insertElement(t,ke.HTML);break}case v.FRAME:{e._appendElement(t,ke.HTML),t.ackSelfClosing=!0;break}case v.NOFRAMES:{_i(e,t);break}}}function bse(e,t){t.tagID===v.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==v.FRAMESET&&(e.insertionMode=Q.AFTER_FRAMESET))}function Ese(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function xse(e,t){t.tagID===v.HTML&&(e.insertionMode=Q.AFTER_AFTER_FRAMESET)}function wse(e,t){t.tagID===v.HTML?Fr(e,t):hm(e,t)}function hm(e,t){e.insertionMode=Q.IN_BODY,T0(e,t)}function vse(e,t){switch(t.tagID){case v.HTML:{Fr(e,t);break}case v.NOFRAMES:{_i(e,t);break}}}function _se(e,t){t.chars=Tn,e._insertCharacters(t)}function kse(e,t){e._insertCharacters(t),e.framesetOk=!1}function dP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ke.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Nse(e,t){if(Une(t))dP(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ke.MATHML?GD(t):r===ke.SVG&&($ne(t),qD(t)),c_(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Sse(e,t){if(t.tagID===v.P||t.tagID===v.BR){dP(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)===ke.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ie.AREA,ie.BASE,ie.BASEFONT,ie.BGSOUND,ie.BR,ie.COL,ie.EMBED,ie.FRAME,ie.HR,ie.IMG,ie.INPUT,ie.KEYGEN,ie.LINK,ie.META,ie.PARAM,ie.SOURCE,ie.TRACK,ie.WBR;const Tse=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ase=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),cA={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fP(e,t){const n=Bse(e),r=T3("type",{handlers:{root:Cse,element:Ise,text:Rse,comment:pP,doctype:Ose,raw:Mse},unknown:jse}),s={parser:n?new aA(cA):aA.getFragmentParser(void 0,cA),handle(l){r(l,s)},stitches:!1,options:t||{}};r(e,s),Au(s,Yi());const i=n?s.parser.document:s.parser.getFragment(),a=Fte(i,{file:s.options.file});return s.stitches&&hh(a,"comment",function(l,c,u){const d=l;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 hP(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:St.CHARACTER,chars:e.value,location:gh(e)};Au(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ose(e,t){const n={type:St.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:gh(e)};Au(t,Yi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Lse(e,t){t.stitches=!0;const n=Fse(e);if("children"in e&&"children"in n){const r=fP({type:"root",children:e.children},t.options);n.children=r.children}pP({type:"comment",value:{stitch:n}},t)}function pP(e,t){const n=e.value,r={type:St.COMMENT,data:n,location:gh(e)};Au(t,Yi(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Mse(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,mP(t,Yi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Tse,"<$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 jse(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Lse(n,t);else{let r="";throw Ase.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 Au(e,t){mP(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=Qn.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 mP(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 Dse(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Qn.PLAINTEXT)return;Au(t,Yi(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Yo.html;s===Yo.html&&n==="svg"&&(s=Yo.svg);const i=Vte({...e,children:[]},{space:s===Yo.svg?"svg":"html"}),a={type:St.START_TAG,tagName:n,tagID:Tu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:gh(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Pse(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Zte.includes(n)||t.parser.tokenizer.state===Qn.PLAINTEXT)return;Au(t,w0(e));const r={type:St.END_TAG,tagName:n,tagID:Tu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:gh(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Qn.RCDATA||t.parser.tokenizer.state===Qn.RAWTEXT||t.parser.tokenizer.state===Qn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Qn.DATA)}function Bse(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function gh(e){const t=Yi(e)||{line:void 0,column:void 0,offset:void 0},n=w0(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 Fse(e){return"children"in e?nu({...e,children:[]}):nu(e)}function Use(e){return function(t,n){return fP(t,{...e,file:n})}}const gP=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function yP(e){if(!e)return!1;try{const t=e.toLowerCase();return gP.some(n=>t.includes(n))}catch{return!1}}function $se(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(yP(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 gP.some(i=>s.includes(i))}return!1}function Hse({text:e,className:t,allowRawHtml:n=!0}){const[r,s]=E.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 g=d(m);if(g)return g}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"}},l=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 o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(KX,{remarkPlugins:[sJ],rehypePlugins:n?[Use,Y2]:[Y2],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(yP(d)||$se(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>s({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Cc,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(_M,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(Cc,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=i({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>s({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(Cc,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),r&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>s(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:r.title||a(r.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:r.src,download:r.title||a(r.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>s(null),children:o.jsx(Ar,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:r.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const yh=E.memo(Hse),uA=6,dA=7,zse={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function ox(e){return zse[(e||"").trim().toLowerCase()]||"未知"}function fA(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 Vse(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 Kse(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 Kse({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Yse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function hA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 lx(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function pA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(hA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(hA,{direction:"right"})})]})]})}function pm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function Wse({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(Kse,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Yse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ox(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(lx,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(yh,{text:Vse(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(pm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function Gse(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,T]=E.useState(""),[S,R]=E.useState(null),[I,j]=E.useState(null),[F,Y]=E.useState(!1),[L,U]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let H=!0;return u(!0),f(""),QK({region:e,page:s,pageSize:uA}).then(W=>{if(!H)return;const P=W.items||[];r(P),l(W.totalCount||0),p(te=>P.find(X=>X.id===(te==null?void 0:te.id))||null)}).catch(W=>{H&&(r([]),l(0),p(null),f(W instanceof Error?W.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let H=!0;return k(!0),T(""),ZK(h.id,{region:e,page:w,pageSize:dA,project:h.projectName}).then(W=>{H&&(g(W.items||[]),x(W.totalCount||0))}).catch(W=>{H&&(g([]),x(0),T(W instanceof Error?W.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&k(!1)}),()=>{H=!1}},[e,h,w]);const M=H=>{H!==e&&(D(),t(H),i(1),y(1),p(null),g([]))},O=H=>{D(),p(H),y(1)},D=()=>{C.current+=1,R(null),j(null),U(""),Y(!1)},A=async H=>{if(!h)return;const W=C.current+1;C.current=W,R(H),j(null),U(""),Y(!0);try{const P=await JK(h.id,H.skillId,H.version,e,h.projectName);C.current===W&&j(P)}catch(P){C.current===W&&U(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{C.current===W&&Y(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>M("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>M("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(pm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(H=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),o.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.status)}`,children:ox(H.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",zse(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),o.jsx(pA,{page:s,total:a,pageSize:uA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(pm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void A(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.skillStatus)}`,children:ox(H.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),o.jsx(pA,{page:w,total:b,pageSize:dA,onPage:y})]}):o.jsx(pm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(Wse,{skill:S,space:h,region:e,detail:I,loading:F,error:L,onClose:D})]})}function qse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await Nj(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 o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx($t,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function or(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function R0(){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}})}mm.prototype=R0.prototype={constructor:mm,on:function(e,t){var n=this._,r=Qse(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)),gA.hasOwnProperty(t)?{space:gA[t],local:e}:e}function Jse(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cx&&t.documentElement.namespaceURI===cx?t.createElement(e):t.createElementNS(n,e)}}function eie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bP(e){var t=O0(e);return(t.local?eie:Jse)(t)}function tie(){}function h_(e){return e==null?tie:function(){return this.querySelector(e)}}function nie(e){typeof e!="function"&&(e=h_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Tie(e){e||(e=Aie);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 Cie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Iie(){return Array.from(this)}function Rie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Hie:typeof t=="function"?Vie:zie)(e,t,n??"")):su(this.node(),e)}function su(e,t){return e.style.getPropertyValue(t)||_P(e).getComputedStyle(e,null).getPropertyValue(t)}function Yie(e){return function(){delete this[e]}}function Wie(e,t){return function(){this[e]=t}}function Gie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qie(e,t){return arguments.length>1?this.each((t==null?Yie:typeof t=="function"?Gie:Wie)(e,t)):this.node()[e]}function kP(e){return e.trim().split(/^|\s+/)}function p_(e){return e.classList||new NP(e)}function NP(e){this._node=e,this._names=kP(e.getAttribute("class")||"")}NP.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 SP(e,t){for(var n=p_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function _ae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function ux(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ux.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Lae(e){return!e.ctrlKey&&!e.button}function Mae(){return this.parentNode}function jae(e,t){return t??{x:e.x,y:e.y}}function Dae(){return navigator.maxTouchPoints||"ontouchstart"in this}function OP(){var e=Lae,t=Mae,n=jae,r=Dae,s={},i=R0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Oae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(gs(_.view).on("mousemove.drag",m,Bf).on("mouseup.drag",g,Bf),IP(_.view),Tb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Rc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){gs(_.view).on("mousemove.drag mouseup.drag",null),RP(_.view,u),Rc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,T=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tp(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=Bae.exec(e))?new ss(t[1],t[2],t[3],1):(t=Fae.exec(e))?new ss(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Uae.exec(e))?Tp(t[1],t[2],t[3],t[4]):(t=$ae.exec(e))?Tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Hae.exec(e))?_A(t[1],t[2]/100,t[3]/100,1):(t=zae.exec(e))?_A(t[1],t[2]/100,t[3]/100,t[4]):yA.hasOwnProperty(e)?xA(yA[e]):e==="transparent"?new ss(NaN,NaN,NaN,0):null}function xA(e){return new ss(e>>16&255,e>>8&255,e&255,1)}function Tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new ss(e,t,n,r)}function Yae(e){return e instanceof Eh||(e=hl(e)),e?(e=e.rgb(),new ss(e.r,e.g,e.b,e.opacity)):new ss}function dx(e,t,n,r){return arguments.length===1?Yae(e):new ss(e,t,n,r??1)}function ss(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}m_(ss,dx,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ss(nl(this.r),nl(this.g),nl(this.b),xg(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:wA,formatHex:wA,formatHex8:Wae,formatRgb:vA,toString:vA}));function wA(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}`}function Wae(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}${Wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function vA(){const e=xg(this.opacity);return`${e===1?"rgb(":"rgba("}${nl(this.r)}, ${nl(this.g)}, ${nl(this.b)}${e===1?")":`, ${e})`}`}function xg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wo(e){return e=nl(e),(e<16?"0":"")+e.toString(16)}function _A(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fi(e,t,n,r)}function MP(e){if(e instanceof fi)return new fi(e.h,e.s,e.l,e.opacity);if(e instanceof Eh||(e=hl(e)),!e)return new fi;if(e instanceof fi)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new fi(a,l,c,e.opacity)}function Gae(e,t,n,r){return arguments.length===1?MP(e):new fi(e,t,n,r??1)}function fi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}m_(fi,Gae,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new fi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new fi(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 ss(Ab(e>=240?e-240:e+120,s,r),Ab(e,s,r),Ab(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new fi(kA(this.h),Ap(this.s),Ap(this.l),xg(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=xg(this.opacity);return`${e===1?"hsl(":"hsla("}${kA(this.h)}, ${Ap(this.s)*100}%, ${Ap(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kA(e){return e=(e||0)%360,e<0?e+360:e}function Ap(e){return Math.max(0,Math.min(1,e||0))}function Ab(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 g_=e=>()=>e;function qae(e,t){return function(n){return e+n*t}}function Xae(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 Qae(e){return(e=+e)==1?jP:function(t,n){return n-t?Xae(t,n,e):g_(isNaN(t)?n:t)}}function jP(e,t){var n=t-e;return n?qae(e,n):g_(isNaN(e)?t:e)}const wg=function e(t){var n=Qae(t);function r(s,i){var a=n((s=dx(s)).r,(i=dx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=jP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Zae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:ji(r,s)})),n=Cb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:ji(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:ji(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:ji(u,f)},{i:g-2,x:ji(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--iu}function TA(){pl=(_g=$f.now())+L0,iu=_d=0;try{hoe()}finally{iu=0,moe(),pl=0}}function poe(){var e=$f.now(),t=e-_g;t>FP&&(L0-=t,_g=e)}function moe(){for(var e,t=vg,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:vg=n);kd=e,px(r)}function px(e){if(!iu){_d&&(_d=clearTimeout(_d));var t=e-pl;t>24?(e<1/0&&(_d=setTimeout(TA,e-$f.now()-L0)),ad&&(ad=clearInterval(ad))):(ad||(_g=$f.now(),ad=setInterval(poe,FP)),iu=1,UP(TA))}}function AA(e,t,n){var r=new kg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var goe=R0("start","end","cancel","interrupt"),yoe=[],HP=0,CA=1,mx=2,ym=3,IA=4,gx=5,bm=6;function M0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;boe(e,n,{name:t,index:r,group:s,on:goe,tween:yoe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:HP})}function b_(e,t){var n=ki(e,t);if(n.state>HP)throw new Error("too late; already scheduled");return n}function Gi(e,t){var n=ki(e,t);if(n.state>ym)throw new Error("too late; already running");return n}function ki(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function boe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=$P(i,0,n.time);function i(u){n.state=CA,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!==CA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===ym)return AA(a);p.state===IA?(p.state=bm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dmx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Goe(e,t,n){var r,s,i=Woe(t)?b_:Gi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function qoe(e,t){var n=this._id;return arguments.length<2?ki(this.node(),n).on.on(e):this.each(Goe(n,e,t))}function Xoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Qoe(){return this.on("end.remove",Xoe(this._id))}function Zoe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=h_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function _le(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 la(e,t,n){this.k=e,this.x=t,this.y=n}la.prototype={constructor:la,scale:function(e){return e===1?this:new la(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new la(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 j0=new la(1,0,0);YP.prototype=la.prototype;function YP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return j0;return e.__zoom}function Ib(e){e.stopImmediatePropagation()}function od(e){e.preventDefault(),e.stopImmediatePropagation()}function kle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Nle(){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 RA(){return this.__zoom||j0}function Sle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tle(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ale(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 WP(){var e=kle,t=Nle,n=Ale,r=Sle,s=Tle,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=gm,u=R0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(L){L.property("__zoom",RA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,U,C,M){var O=L.selection?L.selection():L;O.property("__zoom",RA),L!==O?k(L,U,C,M):O.interrupt().each(function(){N(this,arguments).event(M).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},y.scaleBy=function(L,U,C,M){y.scaleTo(L,function(){var O=this.__zoom.k,D=typeof U=="function"?U.apply(this,arguments):U;return O*D},C,M)},y.scaleTo=function(L,U,C,M){y.transform(L,function(){var O=t.apply(this,arguments),D=this.__zoom,A=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=D.invert(A),W=typeof U=="function"?U.apply(this,arguments):U;return n(x(b(D,W),A,H),O,a)},C,M)},y.translateBy=function(L,U,C,M){y.transform(L,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(L,U,C,M,O){y.transform(L,function(){var D=t.apply(this,arguments),A=this.__zoom,H=M==null?_(D):typeof M=="function"?M.apply(this,arguments):M;return n(j0.translate(H[0],H[1]).scale(A.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),D,a)},M,O)};function b(L,U){return U=Math.max(i[0],Math.min(i[1],U)),U===L.k?L:new la(U,L.x,L.y)}function x(L,U,C){var M=U[0]-C[0]*L.k,O=U[1]-C[1]*L.k;return M===L.x&&O===L.y?L:new la(L.k,M,O)}function _(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function k(L,U,C,M){L.on("start.zoom",function(){N(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(M).end()}).tween("zoom",function(){var O=this,D=arguments,A=N(O,D).event(M),H=t.apply(O,D),W=C==null?_(H):typeof C=="function"?C.apply(O,D):C,P=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),te=O.__zoom,X=typeof U=="function"?U.apply(O,D):U,ne=c(te.invert(W).concat(P/te.k),X.invert(W).concat(P/X.k));return function(ce){if(ce===1)ce=X;else{var J=ne(ce),fe=P/J[2];ce=new la(fe,W[0]-J[0]*fe,W[1]-J[1]*fe)}A.zoom(null,ce)}})}function N(L,U,C){return!C&&L.__zooming||new T(L,U)}function T(L,U){this.that=L,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,U),this.taps=0}T.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,U){return this.mouse&&L!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var U=gs(this.that).datum();u.call(L,this.that,new _le(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),U)}};function S(L,...U){if(!e.apply(this,arguments))return;var C=N(this,U).event(L),M=this.__zoom,O=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=ci(L);if(C.wheel)(C.mouse[0][0]!==D[0]||C.mouse[0][1]!==D[1])&&(C.mouse[1]=M.invert(C.mouse[0]=D)),clearTimeout(C.wheel);else{if(M.k===O)return;C.mouse=[D,M.invert(D)],Em(this),C.start()}od(L),C.wheel=setTimeout(A,m),C.zoom("mouse",n(x(b(M,O),C.mouse[0],C.mouse[1]),C.extent,a));function A(){C.wheel=null,C.end()}}function R(L,...U){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,M=N(this,U,!0).event(L),O=gs(L.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",P,!0),D=ci(L,C),A=L.clientX,H=L.clientY;IP(L.view),Ib(L),M.mouse=[D,this.__zoom.invert(D)],Em(this),M.start();function W(te){if(od(te),!M.moved){var X=te.clientX-A,ne=te.clientY-H;M.moved=X*X+ne*ne>g}M.event(te).zoom("mouse",n(x(M.that.__zoom,M.mouse[0]=ci(te,C),M.mouse[1]),M.extent,a))}function P(te){O.on("mousemove.zoom mouseup.zoom",null),RP(te.view,M.moved),od(te),M.event(te).end()}}function I(L,...U){if(e.apply(this,arguments)){var C=this.__zoom,M=ci(L.changedTouches?L.changedTouches[0]:L,this),O=C.invert(M),D=C.k*(L.shiftKey?.5:2),A=n(x(b(C,D),M,O),t.apply(this,U),a);od(L),l>0?gs(this).transition().duration(l).call(k,A,M,L):gs(this).call(y.transform,A,M,L)}}function j(L,...U){if(e.apply(this,arguments)){var C=L.touches,M=C.length,O=N(this,U,L.changedTouches.length===M).event(L),D,A,H,W;for(Ib(L),A=0;A`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.`},Hf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GP=["Enter"," ","Escape"],qP={"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 au;(function(e){e.Strict="strict",e.Loose="loose"})(au||(au={}));var rl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rl||(rl={}));var zf;(function(e){e.Partial="partial",e.Full="full"})(zf||(zf={}));const XP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ya;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ya||(Ya={}));var ou;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ou||(ou={}));var He;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(He||(He={}));const OA={[He.Left]:He.Right,[He.Right]:He.Left,[He.Top]:He.Bottom,[He.Bottom]:He.Top};function QP(e){return e===null?null:e?"valid":"invalid"}const ZP=e=>"id"in e&&"source"in e&&"target"in e,Cle=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),x_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xh=(e,t=[0,0])=>{const{width:n,height:r}=_a(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Ile=(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):x_(s)?s:t.nodeLookup.get(s.id));const l=a?Ng(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return D0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P0(n)},wh=(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=D0(n,Ng(s)),r=!0)}),r?P0(n):{x:0,y:0,width:0,height:0}},w_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={...Au(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,g=Vf(l,cu(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},Rle=(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 Ole(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 Lle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Ole(e,a),c=wh(l),u=__(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 JP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",vi.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&gl(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=gl(f)?ml(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",vi.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 Mle({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=Rle(a,c);for(const h of c)l.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 lu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ml=(e={x:0,y:0},t,n)=>({x:lu(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:lu(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function e4(e,t,n){const{width:r,height:s}=_a(n),{x:i,y:a}=n.internals.positionAbsolute;return ml(e,[[i,a],[i+r,a+s]],t)}const LA=(e,t,n)=>en?-lu(Math.abs(e-n),1,t)/t:0,v_=(e,t,n=15,r=40)=>{const s=LA(e.x,r,t.width-r)*n,i=LA(e.y,r,t.height-r)*n;return[s,i]},D0=(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)}),yx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),P0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),cu=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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}},Ng=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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)}},t4=(e,t)=>P0(D0(yx(e),yx(t))),Vf=(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)},MA=e=>pi(e.width)&&pi(e.height)&&pi(e.x)&&pi(e.y),pi=e=>!isNaN(e)&&isFinite(e),n4=(e,t)=>(n,r)=>{},vh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Au=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?vh(l,a):l},uu=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ul(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 jle(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ul(e,n),s=Ul(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ul(e.top??e.y??0,n),s=Ul(e.bottom??e.y??0,n),i=Ul(e.left??e.x??0,t),a=Ul(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 Dle(e,t,n,r,s,i){const{x:a,y:l}=uu(e,[t,n,r]),{x:c,y:u}=uu({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const __=(e,t,n,r,s,i)=>{const a=jle(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=lu(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,g=Dle(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Kf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gl(e){return e!=null&&e!=="parent"}function _a(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 k_(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 r4(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function jA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ple(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Ble(e){return{...qP,...e||{}}}function ef(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=mi(e),l=Au({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?vh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const N_=e=>({width:e.offsetWidth,height:e.offsetHeight}),s4=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Fle=["INPUT","SELECT","TEXTAREA"];function i4(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:Fle.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const a4=e=>"clientX"in e,mi=(e,t)=>{var i,a;const n=a4(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)}},DA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...N_(a)}})};function o4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Rp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function PA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case He.Left:return[t-Rp(t-r,i),n];case He.Right:return[t+Rp(r-t,i),n];case He.Top:return[t,n-Rp(n-s,i)];case He.Bottom:return[t,n+Rp(s-n,i)]}}function l4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top,curvature:a=.25}){const[l,c]=PA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=PA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function c4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const Hle=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,zle=(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)),Vle=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",vi.error006()),t;const r=n.getEdgeId||Hle;let s;return ZP(e)?s={...e}:s={...e,id:r(e)},zle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function u4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=c4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const BA={[He.Left]:{x:-1,y:0},[He.Right]:{x:1,y:0},[He.Top]:{x:0,y:-1},[He.Bottom]:{x:0,y:1}},Kle=({source:e,sourcePosition:t=He.Bottom,target:n})=>t===He.Left||t===He.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Yle({source:e,sourcePosition:t=He.Bottom,target:n,targetPosition:r=He.Top,center:s,offset:i,stepPosition:a}){const l=BA[t],c=BA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=Kle({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=c4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const L=Math.abs(e[h]-n[h]);if(L<=i){const U=Math.min(i-1,i-L);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*U:b[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const L=h==="x"?"y":"x",U=l[h]===c[L],C=u[L]>d[L],M=u[L]=Y?(g=(I.x+j.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function Wle(e,t,n,r){const s=Math.min(FA(e,t)/2,FA(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 bx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function qle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=bx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const d4=1e3,Xle=10,S_={nodeOrigin:[0,0],nodeExtent:Hf,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Qle={...S_,checkEquality:!0};function T_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Zle(e,t,n){const r=T_(S_,n);for(const s of e.values())if(s.parentId)C_(s,e,t,r);else{const i=xh(s,r.nodeOrigin),a=gl(s.extent)?s.extent:r.nodeExtent,l=ml(i,a,_a(s));s.internals.positionAbsolute=l}}function Jle(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 A_(e){return e==="manual"}function Ex(e,t,n,r={}){var d,f;const s=T_(Qle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!A_(s.zIndexMode)?d4: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=xh(h,s.nodeOrigin),g=gl(h.extent)?h.extent:s.nodeExtent,w=ml(m,g,_a(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:Jle(h,p),z:f4(h,l,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&&C_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function ece(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 C_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=T_(S_,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}ece(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*Xle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!A_(c)?d4:0,{x:h,y:p,z:m}=tce(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function f4(e,t,n){const r=pi(e.zIndex)?e.zIndex:0;return A_(n)?r:r+(e.selected?t:0)}function tce(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=_a(e),u=xh(e,n),d=gl(e.extent)?ml(u,e.extent,c):u;let f=ml({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=e4(f,c,t));const h=f4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function I_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??cu(c),d=t4(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=_a(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=I_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function rce({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 zA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 h4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;zA("source",c,d,e,s,a),zA("target",c,u,e,i,l),t.set(r.id,r)}}function p4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:p4(n,t):!1}function VA(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 sce(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!p4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Rb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function ice({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=vh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function ace({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:T=0}){h=gs(_);function S({x:F,y:Y}){const{nodeLookup:L,nodeExtent:U,snapGrid:C,snapToGrid:M,nodeOrigin:O,onNodeDrag:D,onSelectionDrag:A,onError:H,updateNodePositions:W}=t();i={x:F,y:Y};let P=!1;const te=l.size>1,X=te&&U?yx(wh(l)):null,ne=te&&M?ice({dragItems:l,snapGrid:C,x:F,y:Y}):null;for(const[ce,J]of l){if(!L.has(ce))continue;let fe={x:F-J.distance.x,y:Y-J.distance.y};M&&(fe=ne?{x:Math.round(fe.x+ne.x),y:Math.round(fe.y+ne.y)}:vh(fe,C));let ee=null;if(te&&U&&!J.extent&&X){const{positionAbsolute:xe}=J.internals,we=xe.x-X.x+U[0][0],Te=xe.x+J.measured.width-X.x2+U[1][0],Re=xe.y-X.y+U[0][1],Ye=xe.y+J.measured.height-X.y2+U[1][1];ee=[[we,Re],[Te,Ye]]}const{position:Ee,positionAbsolute:ge}=JP({nodeId:ce,nextPosition:fe,nodeLookup:L,nodeExtent:ee||U,nodeOrigin:O,onError:H});P=P||J.position.x!==Ee.x||J.position.y!==Ee.y,J.position=Ee,J.internals.positionAbsolute=ge}if(m=m||P,!!P&&(W(l,!0),g&&(r||D||!N&&A))){const[ce,J]=Rb({nodeId:N,dragItems:l,nodeLookup:L});r==null||r(g,l,ce,J),D==null||D(g,ce,J),N||A==null||A(g,J)}}async function R(){if(!d)return;const{transform:F,panBy:Y,autoPanSpeed:L,autoPanOnNodeDrag:U}=t();if(!U){c=!1,cancelAnimationFrame(a);return}const[C,M]=v_(u,d,L);(C!==0||M!==0)&&(i.x=(i.x??0)-C/F[2],i.y=(i.y??0)-M/F[2],await Y({x:C,y:M})&&S(i)),a=requestAnimationFrame(R)}function I(F){var te;const{nodeLookup:Y,multiSelectionActive:L,nodesDraggable:U,transform:C,snapGrid:M,snapToGrid:O,selectNodesOnDrag:D,onNodeDragStart:A,onSelectionDragStart:H,unselectNodesAndEdges:W}=t();f=!0,(!D||!k)&&!L&&N&&((te=Y.get(N))!=null&&te.selected||W()),k&&D&&N&&(e==null||e(N));const P=ef(F.sourceEvent,{transform:C,snapGrid:M,snapToGrid:O,containerBounds:d});if(i=P,l=sce(Y,U,P,N),l.size>0&&(n||A||!N&&H)){const[X,ne]=Rb({nodeId:N,dragItems:l,nodeLookup:Y});n==null||n(F.sourceEvent,l,X,ne),A==null||A(F.sourceEvent,X,ne),N||H==null||H(F.sourceEvent,ne)}}const j=OP().clickDistance(T).on("start",F=>{const{domNode:Y,nodeDragThreshold:L,transform:U,snapGrid:C,snapToGrid:M}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,g=F.sourceEvent,L===0&&I(F),i=ef(F.sourceEvent,{transform:U,snapGrid:C,snapToGrid:M,containerBounds:d}),u=mi(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:L,snapGrid:U,snapToGrid:C,nodeDragThreshold:M,nodeLookup:O}=t(),D=ef(F.sourceEvent,{transform:L,snapGrid:U,snapToGrid:C,containerBounds:d});if(g=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||N&&!O.has(N))&&(p=!0),!p){if(!c&&Y&&f&&(c=!0,R()),!f){const A=mi(F.sourceEvent,d),H=A.x-u.x,W=A.y-u.y;Math.sqrt(H*H+W*W)>M&&I(F)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&f&&(u=mi(F.sourceEvent,d),S(D))}}).on("end",F=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:Y,updateNodePositions:L,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(L(l,!1),m=!1),s||U||!N&&C){const[M,O]=Rb({nodeId:N,dragItems:l,nodeLookup:Y,dragging:!1});s==null||s(F.sourceEvent,l,M,O),U==null||U(F.sourceEvent,M,O),N||C==null||C(F.sourceEvent,O)}}}).filter(F=>{const Y=F.target;return!F.button&&(!b||!VA(Y,`.${b}`,_))&&(!x||VA(Y,x,_))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function oce(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())Vf(s,cu(i))>0&&r.push(i);return r}const lce=250;function cce(e,t,n,r){var l,c;let s=[],i=1/0;const a=oce(e,n,t+lce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=yl(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 m4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...yl(a,c,c.position,!0)}:c}function g4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function uce(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const y4=()=>!0;function dce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=y4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:S}){const R=s4(e.target);let I=0,j;const{x:F,y:Y}=mi(e),L=g4(i,S),U=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!U||!L)return;const M=m4(s,L,r,c,t);if(!M)return;let O=mi(e,U),D=!1,A=null,H=!1,W=null;function P(){if(!d||!U)return;const[Ee,ge]=v_(O,U,N);h({x:Ee,y:ge}),I=requestAnimationFrame(P)}const te={...M,nodeId:s,type:L,position:M.position},X=c.get(s);let ce={inProgress:!0,isValid:null,from:yl(X,te,He.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:X,to:O,toHandle:null,toPosition:OA[te.position],toNode:null,pointer:O};function J(){C=!0,x(ce),m==null||m(e,{nodeId:s,handleId:r,handleType:L})}T===0&&J();function fe(Ee){if(!C){const{x:Ye,y:Le}=mi(Ee),bt=Ye-F,Ze=Le-Y;if(!(bt*bt+Ze*Ze>T*T))return;J()}if(!k()||!te){ee(Ee);return}const ge=_();O=mi(Ee,U),j=cce(Au(O,ge,!1,[1,1]),n,c,te),D||(P(),D=!0);const xe=b4(Ee,{handle:j,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});W=xe.handleDomNode,A=xe.connection,H=uce(!!j,xe.isValid);const we=c.get(s),Te=we?yl(we,te,He.Left,!0):ce.from,Re={...ce,from:Te,isValid:H,to:xe.toHandle&&H?uu({x:xe.toHandle.x,y:xe.toHandle.y},ge):O,toHandle:xe.toHandle,toPosition:H&&xe.toHandle?xe.toHandle.position:OA[te.position],toNode:xe.toHandle?c.get(xe.toHandle.nodeId):null,pointer:O};x(Re),ce=Re}function ee(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(C){(j||W)&&A&&H&&(g==null||g(A));const{inProgress:ge,...xe}=ce,we={...xe,toPosition:ce.toHandle?ce.toPosition:null};w==null||w(Ee,we),i&&(b==null||b(Ee,we))}p(),cancelAnimationFrame(I),D=!1,H=!1,A=null,W=null,R.removeEventListener("mousemove",fe),R.removeEventListener("mouseup",ee),R.removeEventListener("touchmove",fe),R.removeEventListener("touchend",ee)}}R.addEventListener("mousemove",fe),R.addEventListener("mouseup",ee),R.addEventListener("touchmove",fe),R.addEventListener("touchend",ee)}function b4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=y4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=mi(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=g4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const T={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=T;const R=k&&N&&(n===au.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(T),y.toHandle=m4(x,b,_,d,n,!0)}return y}const xx={onPointerDown:dce,isValid:b4};function fce({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=gs(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Kf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=_[2]*Math.pow(2,N*k);t.scaleTo(T)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const T=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*T,y:_[1]-N[1]*T},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=WP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ci}}const B0=e=>({x:e.x,y:e.y,zoom:e.k}),Ob=({x:e,y:t,zoom:n})=>j0.translate(e,t).scale(n),pc=(e,t)=>e.target.closest(`.${t}`),E4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hce=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lb=(e,t=0,n=hce,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},x4=e=>{const t=e.ctrlKey&&Kf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(pc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ci(d),y=x4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===rl.Vertical?0:d.deltaX*h,m=s===rl.Horizontal?0:d.deltaY*h;!Kf()&&d.shiftKey&&s!==rl.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=B0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function mce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=pc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function gce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=B0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function yce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&E4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,B0(i.transform)))}}function bce({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&E4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=B0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function Ece({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(pc(f,`${u}-flow__node`)||pc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||pc(f,l)&&m||pc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function xce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=WP().scaleExtent([t,n]).translateExtent(r),h=gs(e).call(f);b({x:s.x,y:s.y,zoom:lu(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(x4);async function g(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).transform(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function w({noWheelClassName:j,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:L,panOnScroll:U,panOnDrag:C,panOnScrollMode:M,panOnScrollSpeed:O,preventScrolling:D,zoomOnPinch:A,zoomOnScroll:H,zoomOnDoubleClick:W,zoomActivationKeyPressed:P,lib:te,onTransformChange:X,connectionInProgress:ne,paneClickDistance:ce,selectionOnDrag:J}){L&&!u.isZoomingOrPanning&&y();const fe=U&&!P&&!L;f.clickDistance(J?1/0:!pi(ce)||ce<0?0:ce);const ee=fe?pce({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:O,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):mce({noWheelClassName:j,preventScrolling:D,d3ZoomHandler:p});h.on("wheel.zoom",ee,{passive:!1});const Ee=gce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ee);const ge=yce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:X});f.on("zoom",ge);const xe=bce({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});f.on("end",xe);const we=Ece({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:W,zoomOnPinch:A,userSelectionActive:L,noPanClassName:F,noWheelClassName:j,lib:te,connectionInProgress:ne});f.filter(we),W?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(j,F,Y){const L=Ob(j),U=f==null?void 0:f.constrain()(L,F,Y);return U&&await g(U),U}async function x(j,F){const Y=Ob(j);return await g(Y,F),Y}function _(j){if(h){const F=Ob(j),Y=h.property("__zoom");(Y.k!==j.zoom||Y.x!==j.x||Y.y!==j.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function k(){const j=h?YP(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function N(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleTo(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}async function T(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleBy(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function S(j){f==null||f.scaleExtent(j)}function R(j){f==null||f.translateExtent(j)}function I(j){const F=!pi(j)||j<0?0:j;f==null||f.clickDistance(F)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:T,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var du;(function(e){e.Line="line",e.Handle="handle"})(du||(du={}));function wce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function KA(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 Ma(e,t){return Math.max(0,t-e)}function ja(e,t){return Math.max(0,e-t)}function Op(e,t,n){return Math.max(0,t-e,e-n)}function YA(e,t){return e?!t:t}function vce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:T}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),j=N+(u?-R:R),F=-i[0]*k,Y=-i[1]*N;let L=Op(I,g,w),U=Op(j,y,b);if(a){let O=0,D=0;c&&S<0?O=Ma(x+S+F,a[0][0]):!c&&S>0&&(O=ja(x+I+F,a[1][0])),u&&R<0?D=Ma(_+R+Y,a[0][1]):!u&&R>0&&(D=ja(_+j+Y,a[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(l){let O=0,D=0;c&&S>0?O=ja(x+S,l[0][0]):!c&&S<0&&(O=Ma(x+I,l[1][0])),u&&R>0?D=ja(_+R,l[0][1]):!u&&R<0&&(D=Ma(_+j,l[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(s){if(d){const O=Op(I/T,y,b)*T;if(L=Math.max(L,O),a){let D=0;!c&&!u||c&&!u&&h?D=ja(_+Y+I/T,a[1][1])*T:D=Ma(_+Y+(c?S:-S)/T,a[0][1])*T,L=Math.max(L,D)}if(l){let D=0;!c&&!u||c&&!u&&h?D=Ma(_+I/T,l[1][1])*T:D=ja(_+(c?S:-S)/T,l[0][1])*T,L=Math.max(L,D)}}if(f){const O=Op(j*T,g,w)/T;if(U=Math.max(U,O),a){let D=0;!c&&!u||u&&!c&&h?D=ja(x+j*T+F,a[1][0])/T:D=Ma(x+(u?R:-R)*T+F,a[0][0])/T,U=Math.max(U,D)}if(l){let D=0;!c&&!u||u&&!c&&h?D=Ma(x+j*T,l[1][0])/T:D=ja(x+(u?R:-R)*T,l[0][0])/T,U=Math.max(U,D)}}}R=R+(R<0?U:-U),S=S+(S<0?L:-L),s&&(h?I>j*T?R=(YA(c,u)?-S:S)/T:S=(YA(c,u)?-R:R)*T:d?(R=S/T,u=c):(S=R*T,c=u));const C=c?x+S:x,M=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+M}}const w4={width:0,height:0,x:0,y:0},_ce={...w4,pointerX:0,pointerY:0,aspectRatio:1};function kce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function Nce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=gs(e);let a={controlDirection:KA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...w4},b={..._ce};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:KA(u)};let x,_=null,k=[],N,T,S,R=!1;const I=OP().on("start",j=>{const{nodeLookup:F,transform:Y,snapGrid:L,snapToGrid:U,nodeOrigin:C,paneDomNode:M}=n();if(x=F.get(t),!x)return;_=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:D}=ef(j.sourceEvent,{transform:Y,snapGrid:L,snapToGrid:U,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:O,pointerY:D,aspectRatio:y.width/y.height},N=void 0,T=gl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=F.get(x.parentId)),N&&x.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[A,H]of F)if(H.parentId===t&&(k.push({id:A,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const W=kce(H,x,H.origin??C);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(j,{...y})}).on("drag",j=>{const{transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U}=n(),C=ef(j.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:L,containerBounds:_}),M=[];if(!x)return;const{x:O,y:D,width:A,height:H}=y,W={},P=x.origin??U,{width:te,height:X,x:ne,y:ce}=vce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,T,S),J=te!==A,fe=X!==H,ee=ne!==O&&J,Ee=ce!==D&&fe;if(!ee&&!Ee&&!J&&!fe)return;if((ee||Ee||P[0]===1||P[1]===1)&&(W.x=ee?ne:y.x,W.y=Ee?ce:y.y,y.x=W.x,y.y=W.y,k.length>0)){const Te=ne-O,Re=ce-D;for(const Ye of k)Ye.position={x:Ye.position.x-Te+P[0]*(te-A),y:Ye.position.y-Re+P[1]*(X-H)},M.push(Ye)}if((J||fe)&&(W.width=J&&(!a.resizeDirection||a.resizeDirection==="horizontal")?te:y.width,W.height=fe&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=W.width,y.height=W.height),N&&x.expandParent){const Te=P[0]*(W.width??0);W.x&&W.x{R&&(g==null||g(j,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var v4={exports:{}},_4={},k4={exports:{}},N4={};/** +`,4);return n>=0?t.slice(n+5).trimStart():e}function Yse({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.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 Wse(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function hA({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.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 lx(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function pA({page:e,total:t,pageSize:n,onPage:r}){const s=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(hA,{direction:"left"})}),o.jsxs("span",{children:[e," / ",s]}),o.jsx("button",{type:"button",onClick:()=>r(e+1),disabled:e>=s,"aria-label":"下一页",children:o.jsx(hA,{direction:"right"})})]})]})}function pm({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function Gse({skill:e,space:t,region:n,detail:r,loading:s,error:i,onClose:a}){return E.useEffect(()=>{const l=c=>{c.key==="Escape"&&a()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[a]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:a,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:l=>l.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(Yse,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(r==null?void 0:r.name)||e.skillName}),o.jsx("p",{children:(r==null?void 0:r.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:a,"aria-label":"关闭技能详情",children:o.jsx(Wse,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(r==null?void 0:r.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:ox(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:n==="cn-beijing"?"北京":"上海"})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),s?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(lx,{}),"正在读取技能内容…"]}):i?o.jsx("div",{className:"skillcenter-error",children:i}):r!=null&&r.skillMd?o.jsx(yh,{text:Kse(r.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(pm,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function qse(){const[e,t]=E.useState("cn-beijing"),[n,r]=E.useState([]),[s,i]=E.useState(1),[a,l]=E.useState(0),[c,u]=E.useState(!1),[d,f]=E.useState(""),[h,p]=E.useState(null),[m,g]=E.useState([]),[w,y]=E.useState(1),[b,x]=E.useState(0),[_,k]=E.useState(!1),[N,T]=E.useState(""),[S,R]=E.useState(null),[I,j]=E.useState(null),[F,Y]=E.useState(!1),[L,U]=E.useState(""),C=E.useRef(0);E.useEffect(()=>{let H=!0;return u(!0),f(""),ZK({region:e,page:s,pageSize:uA}).then(W=>{if(!H)return;const P=W.items||[];r(P),l(W.totalCount||0),p(te=>P.find(X=>X.id===(te==null?void 0:te.id))||null)}).catch(W=>{H&&(r([]),l(0),p(null),f(W instanceof Error?W.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{H&&u(!1)}),()=>{H=!1}},[e,s]),E.useEffect(()=>{if(!h){g([]),x(0);return}let H=!0;return k(!0),T(""),JK(h.id,{region:e,page:w,pageSize:dA,project:h.projectName}).then(W=>{H&&(g(W.items||[]),x(W.totalCount||0))}).catch(W=>{H&&(g([]),x(0),T(W instanceof Error?W.message:"读取技能失败,请稍后重试"))}).finally(()=>{H&&k(!1)}),()=>{H=!1}},[e,h,w]);const M=H=>{H!==e&&(D(),t(H),i(1),y(1),p(null),g([]))},O=H=>{D(),p(H),y(1)},D=()=>{C.current+=1,R(null),j(null),U(""),Y(!1)},A=async H=>{if(!h)return;const W=C.current+1;C.current=W,R(H),j(null),U(""),Y(!0);try{const P=await eY(h.id,H.skillId,H.version,e,h.projectName);C.current===W&&j(P)}catch(P){C.current===W&&U(P instanceof Error?P.message:"读取技能详情失败,请稍后重试")}finally{C.current===W&&Y(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:a})]}),o.jsxs("div",{className:"skillcenter-regions","aria-label":"地域",children:[o.jsx("button",{type:"button",className:e==="cn-beijing"?"active":"",onClick:()=>M("cn-beijing"),children:"北京"}),o.jsx("button",{type:"button",className:e==="cn-shanghai"?"active":"",onClick:()=>M("cn-shanghai"),children:"上海"})]})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[c&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能空间…"]}),d?o.jsx("div",{className:"skillcenter-error",children:d}):n.length===0&&!c?o.jsx(pm,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:n.map(H=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(h==null?void 0:h.id)===H.id?"active":""}`,onClick:()=>O(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.name,children:H.name}),o.jsx("span",{className:"skillcenter-item-description",children:H.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.status)}`,children:ox(H.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:H.projectName||"default",children:["Project · ",H.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[H.skillCount??0," 个技能"]}),H.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",Vse(H.updatedAt)]})]})]})},`${H.projectName||"default"}:${H.id}`))})]}),o.jsx(pA,{page:s,total:a,pageSize:uA,onPage:i})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:h.name,children:[h.name," · 技能"]})}),o.jsx("span",{children:b})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(lx,{}),"正在读取技能…"]}),N?o.jsx("div",{className:"skillcenter-error",children:N}):m.length===0&&!_?o.jsx(pm,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:m.map(H=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void A(H),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:H.skillName,children:H.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:H.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${fA(H.skillStatus)}`,children:ox(H.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",H.version||"—"]})]})]})},`${H.skillId}:${H.version}`))})]}),o.jsx(pA,{page:w,total:b,pageSize:dA,onPage:y})]}):o.jsx(pm,{children:"点击 Skill 空间以查看详情"})})]}),S&&h&&o.jsx(Gse,{skill:S,space:h,region:e,detail:I,loading:F,error:L,onClose:D})]})}function Xse({onAdded:e,onCancel:t}){const[n,r]=E.useState(""),[s,i]=E.useState(""),[a,l]=E.useState(""),[c,u]=E.useState(!1),[d,f]=E.useState(""),h=n.trim().length>0&&s.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await Nj(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 o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:s,onChange:m=>i(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx($t,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function or(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function R0(){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}})}mm.prototype=R0.prototype={constructor:mm,on:function(e,t){var n=this._,r=Zse(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)),gA.hasOwnProperty(t)?{space:gA[t],local:e}:e}function eie(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===cx&&t.documentElement.namespaceURI===cx?t.createElement(e):t.createElementNS(n,e)}}function tie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bP(e){var t=O0(e);return(t.local?tie:eie)(t)}function nie(){}function h_(e){return e==null?nie:function(){return this.querySelector(e)}}function rie(e){typeof e!="function"&&(e=h_(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=x&&(x=b+1);!(k=w[x])&&++x=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function Aie(e){e||(e=Cie);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 Iie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Rie(){return Array.from(this)}function Oie(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?zie:typeof t=="function"?Kie:Vie)(e,t,n??"")):iu(this.node(),e)}function iu(e,t){return e.style.getPropertyValue(t)||_P(e).getComputedStyle(e,null).getPropertyValue(t)}function Wie(e){return function(){delete this[e]}}function Gie(e,t){return function(){this[e]=t}}function qie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Xie(e,t){return arguments.length>1?this.each((t==null?Wie:typeof t=="function"?qie:Gie)(e,t)):this.node()[e]}function kP(e){return e.trim().split(/^|\s+/)}function p_(e){return e.classList||new NP(e)}function NP(e){this._node=e,this._names=kP(e.getAttribute("class")||"")}NP.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 SP(e,t){for(var n=p_(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function kae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,i;n()=>e;function ux(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:i,x:a,y:l,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:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ux.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Mae(e){return!e.ctrlKey&&!e.button}function jae(){return this.parentNode}function Dae(e,t){return t??{x:e.x,y:e.y}}function Pae(){return navigator.maxTouchPoints||"ontouchstart"in this}function OP(){var e=Mae,t=jae,n=Dae,r=Pae,s={},i=R0("start","drag","end"),a=0,l,c,u,d,f=0;function h(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",y,Lae).on("touchend.drag touchcancel.drag",b).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=x(this,t.call(this,_,k),_,k,"mouse");N&&(gs(_.view).on("mousemove.drag",m,Bf).on("mouseup.drag",g,Bf),IP(_.view),Tb(_),u=!1,l=_.clientX,c=_.clientY,N("start",_))}}function m(_){if(Oc(_),!u){var k=_.clientX-l,N=_.clientY-c;u=k*k+N*N>f}s.mouse("drag",_)}function g(_){gs(_.view).on("mousemove.drag mouseup.drag",null),RP(_.view,u),Oc(_),s.mouse("end",_)}function w(_,k){if(e.call(this,_,k)){var N=_.changedTouches,T=t.call(this,_,k),S=N.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tp(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=Fae.exec(e))?new ss(t[1],t[2],t[3],1):(t=Uae.exec(e))?new ss(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$ae.exec(e))?Tp(t[1],t[2],t[3],t[4]):(t=Hae.exec(e))?Tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zae.exec(e))?_A(t[1],t[2]/100,t[3]/100,1):(t=Vae.exec(e))?_A(t[1],t[2]/100,t[3]/100,t[4]):yA.hasOwnProperty(e)?xA(yA[e]):e==="transparent"?new ss(NaN,NaN,NaN,0):null}function xA(e){return new ss(e>>16&255,e>>8&255,e&255,1)}function Tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new ss(e,t,n,r)}function Wae(e){return e instanceof Eh||(e=hl(e)),e?(e=e.rgb(),new ss(e.r,e.g,e.b,e.opacity)):new ss}function dx(e,t,n,r){return arguments.length===1?Wae(e):new ss(e,t,n,r??1)}function ss(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}m_(ss,dx,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new ss(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ss(nl(this.r),nl(this.g),nl(this.b),xg(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:wA,formatHex:wA,formatHex8:Gae,formatRgb:vA,toString:vA}));function wA(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}`}function Gae(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}${Wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function vA(){const e=xg(this.opacity);return`${e===1?"rgb(":"rgba("}${nl(this.r)}, ${nl(this.g)}, ${nl(this.b)}${e===1?")":`, ${e})`}`}function xg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wo(e){return e=nl(e),(e<16?"0":"")+e.toString(16)}function _A(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fi(e,t,n,r)}function MP(e){if(e instanceof fi)return new fi(e.h,e.s,e.l,e.opacity);if(e instanceof Eh||(e=hl(e)),!e)return new fi;if(e instanceof fi)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,l=i-s,c=(i+s)/2;return l?(t===i?a=(n-r)/l+(n0&&c<1?0:a,new fi(a,l,c,e.opacity)}function qae(e,t,n,r){return arguments.length===1?MP(e):new fi(e,t,n,r??1)}function fi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}m_(fi,qae,LP(Eh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new fi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ff:Math.pow(Ff,e),new fi(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 ss(Ab(e>=240?e-240:e+120,s,r),Ab(e,s,r),Ab(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new fi(kA(this.h),Ap(this.s),Ap(this.l),xg(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=xg(this.opacity);return`${e===1?"hsl(":"hsla("}${kA(this.h)}, ${Ap(this.s)*100}%, ${Ap(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kA(e){return e=(e||0)%360,e<0?e+360:e}function Ap(e){return Math.max(0,Math.min(1,e||0))}function Ab(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 g_=e=>()=>e;function Xae(e,t){return function(n){return e+n*t}}function Qae(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 Zae(e){return(e=+e)==1?jP:function(t,n){return n-t?Qae(t,n,e):g_(isNaN(t)?n:t)}}function jP(e,t){var n=t-e;return n?Xae(e,n):g_(isNaN(e)?t:e)}const wg=function e(t){var n=Zae(t);function r(s,i){var a=n((s=dx(s)).r,(i=dx(i)).r),l=n(s.g,i.g),c=n(s.b,i.b),u=jP(s.opacity,i.opacity);return function(d){return s.r=a(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function Jae(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),l[a]?l[a]+=i:l[++a]=i),(r=r[0])===(s=s[0])?l[a]?l[a]+=s:l[++a]=s:(l[++a]=null,c.push({i:a,x:ji(r,s)})),n=Cb.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(s(f)+"rotate(",null,r)-2,x:ji(u,d)})):d&&f.push(s(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(s(f)+"skewX(",null,r)-2,x:ji(u,d)}):d&&f.push(s(f)+"skewX("+d+r)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var g=p.push(s(p)+"scale(",null,",",null,")");m.push({i:g-4,x:ji(u,f)},{i:g-2,x:ji(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),l(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,g=h.length,w;++m=0&&e._call.call(void 0,t),e=e._next;--au}function TA(){pl=(_g=$f.now())+L0,au=_d=0;try{poe()}finally{au=0,goe(),pl=0}}function moe(){var e=$f.now(),t=e-_g;t>FP&&(L0-=t,_g=e)}function goe(){for(var e,t=vg,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:vg=n);kd=e,px(r)}function px(e){if(!au){_d&&(_d=clearTimeout(_d));var t=e-pl;t>24?(e<1/0&&(_d=setTimeout(TA,e-$f.now()-L0)),od&&(od=clearInterval(od))):(od||(_g=$f.now(),od=setInterval(moe,FP)),au=1,UP(TA))}}function AA(e,t,n){var r=new kg;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var yoe=R0("start","end","cancel","interrupt"),boe=[],HP=0,CA=1,mx=2,ym=3,IA=4,gx=5,bm=6;function M0(e,t,n,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Eoe(e,n,{name:t,index:r,group:s,on:yoe,tween:boe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:HP})}function b_(e,t){var n=ki(e,t);if(n.state>HP)throw new Error("too late; already scheduled");return n}function Gi(e,t){var n=ki(e,t);if(n.state>ym)throw new Error("too late; already running");return n}function ki(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Eoe(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=$P(i,0,n.time);function i(u){n.state=CA,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!==CA)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===ym)return AA(a);p.state===IA?(p.state=bm,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dmx&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function qoe(e,t,n){var r,s,i=Goe(t)?b_:Gi;return function(){var a=i(this,e),l=a.on;l!==r&&(s=(r=l).copy()).on(t,n),a.on=s}}function Xoe(e,t){var n=this._id;return arguments.length<2?ki(this.node(),n).on.on(e):this.each(qoe(n,e,t))}function Qoe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Zoe(){return this.on("end.remove",Qoe(this._id))}function Joe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=h_(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function kle(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 la(e,t,n){this.k=e,this.x=t,this.y=n}la.prototype={constructor:la,scale:function(e){return e===1?this:new la(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new la(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 j0=new la(1,0,0);YP.prototype=la.prototype;function YP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return j0;return e.__zoom}function Ib(e){e.stopImmediatePropagation()}function ld(e){e.preventDefault(),e.stopImmediatePropagation()}function Nle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Sle(){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 RA(){return this.__zoom||j0}function Tle(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ale(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cle(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 WP(){var e=Nle,t=Sle,n=Cle,r=Tle,s=Ale,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=gm,u=R0("start","zoom","end"),d,f,h,p=500,m=150,g=0,w=10;function y(L){L.property("__zoom",RA).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,U,C,M){var O=L.selection?L.selection():L;O.property("__zoom",RA),L!==O?k(L,U,C,M):O.interrupt().each(function(){N(this,arguments).event(M).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},y.scaleBy=function(L,U,C,M){y.scaleTo(L,function(){var O=this.__zoom.k,D=typeof U=="function"?U.apply(this,arguments):U;return O*D},C,M)},y.scaleTo=function(L,U,C,M){y.transform(L,function(){var O=t.apply(this,arguments),D=this.__zoom,A=C==null?_(O):typeof C=="function"?C.apply(this,arguments):C,H=D.invert(A),W=typeof U=="function"?U.apply(this,arguments):U;return n(x(b(D,W),A,H),O,a)},C,M)},y.translateBy=function(L,U,C,M){y.transform(L,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,M)},y.translateTo=function(L,U,C,M,O){y.transform(L,function(){var D=t.apply(this,arguments),A=this.__zoom,H=M==null?_(D):typeof M=="function"?M.apply(this,arguments):M;return n(j0.translate(H[0],H[1]).scale(A.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof C=="function"?-C.apply(this,arguments):-C),D,a)},M,O)};function b(L,U){return U=Math.max(i[0],Math.min(i[1],U)),U===L.k?L:new la(U,L.x,L.y)}function x(L,U,C){var M=U[0]-C[0]*L.k,O=U[1]-C[1]*L.k;return M===L.x&&O===L.y?L:new la(L.k,M,O)}function _(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function k(L,U,C,M){L.on("start.zoom",function(){N(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(M).end()}).tween("zoom",function(){var O=this,D=arguments,A=N(O,D).event(M),H=t.apply(O,D),W=C==null?_(H):typeof C=="function"?C.apply(O,D):C,P=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),te=O.__zoom,X=typeof U=="function"?U.apply(O,D):U,ne=c(te.invert(W).concat(P/te.k),X.invert(W).concat(P/X.k));return function(ce){if(ce===1)ce=X;else{var J=ne(ce),fe=P/J[2];ce=new la(fe,W[0]-J[0]*fe,W[1]-J[1]*fe)}A.zoom(null,ce)}})}function N(L,U,C){return!C&&L.__zooming||new T(L,U)}function T(L,U){this.that=L,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,U),this.taps=0}T.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,U){return this.mouse&&L!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var U=gs(this.that).datum();u.call(L,this.that,new kle(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),U)}};function S(L,...U){if(!e.apply(this,arguments))return;var C=N(this,U).event(L),M=this.__zoom,O=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,r.apply(this,arguments)))),D=ci(L);if(C.wheel)(C.mouse[0][0]!==D[0]||C.mouse[0][1]!==D[1])&&(C.mouse[1]=M.invert(C.mouse[0]=D)),clearTimeout(C.wheel);else{if(M.k===O)return;C.mouse=[D,M.invert(D)],Em(this),C.start()}ld(L),C.wheel=setTimeout(A,m),C.zoom("mouse",n(x(b(M,O),C.mouse[0],C.mouse[1]),C.extent,a));function A(){C.wheel=null,C.end()}}function R(L,...U){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,M=N(this,U,!0).event(L),O=gs(L.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",P,!0),D=ci(L,C),A=L.clientX,H=L.clientY;IP(L.view),Ib(L),M.mouse=[D,this.__zoom.invert(D)],Em(this),M.start();function W(te){if(ld(te),!M.moved){var X=te.clientX-A,ne=te.clientY-H;M.moved=X*X+ne*ne>g}M.event(te).zoom("mouse",n(x(M.that.__zoom,M.mouse[0]=ci(te,C),M.mouse[1]),M.extent,a))}function P(te){O.on("mousemove.zoom mouseup.zoom",null),RP(te.view,M.moved),ld(te),M.event(te).end()}}function I(L,...U){if(e.apply(this,arguments)){var C=this.__zoom,M=ci(L.changedTouches?L.changedTouches[0]:L,this),O=C.invert(M),D=C.k*(L.shiftKey?.5:2),A=n(x(b(C,D),M,O),t.apply(this,U),a);ld(L),l>0?gs(this).transition().duration(l).call(k,A,M,L):gs(this).call(y.transform,A,M,L)}}function j(L,...U){if(e.apply(this,arguments)){var C=L.touches,M=C.length,O=N(this,U,L.changedTouches.length===M).event(L),D,A,H,W;for(Ib(L),A=0;A`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.`},Hf=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GP=["Enter"," ","Escape"],qP={"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 ou;(function(e){e.Strict="strict",e.Loose="loose"})(ou||(ou={}));var rl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(rl||(rl={}));var zf;(function(e){e.Partial="partial",e.Full="full"})(zf||(zf={}));const XP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ya;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ya||(Ya={}));var lu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lu||(lu={}));var He;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(He||(He={}));const OA={[He.Left]:He.Right,[He.Right]:He.Left,[He.Top]:He.Bottom,[He.Bottom]:He.Top};function QP(e){return e===null?null:e?"valid":"invalid"}const ZP=e=>"id"in e&&"source"in e&&"target"in e,Ile=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),x_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xh=(e,t=[0,0])=>{const{width:n,height:r}=_a(e),s=e.origin??t,i=n*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},Rle=(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):x_(s)?s:t.nodeLookup.get(s.id));const l=a?Ng(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return D0(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return P0(n)},wh=(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=D0(n,Ng(s)),r=!0)}),r?P0(n):{x:0,y:0,width:0,height:0}},w_=(e,t,[n,r,s]=[0,0,1],i=!1,a=!1)=>{const l={...Cu(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,g=Vf(l,uu(u)),w=(p??0)*(m??0),y=i&&g>0;(!u.internals.handleBounds||y||g>=w||u.dragging)&&c.push(u)}return c},Ole=(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 Lle(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 Mle({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const l=Lle(e,a),c=wh(l),u=__(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 JP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",vi.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&gl(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=gl(f)?ml(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",vi.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 jle({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(g=>g.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=Ole(a,c);for(const h of c)l.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 cu=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ml=(e={x:0,y:0},t,n)=>({x:cu(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:cu(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function e4(e,t,n){const{width:r,height:s}=_a(n),{x:i,y:a}=n.internals.positionAbsolute;return ml(e,[[i,a],[i+r,a+s]],t)}const LA=(e,t,n)=>en?-cu(Math.abs(e-n),1,t)/t:0,v_=(e,t,n=15,r=40)=>{const s=LA(e.x,r,t.width-r)*n,i=LA(e.y,r,t.height-r)*n;return[s,i]},D0=(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)}),yx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),P0=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),uu=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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}},Ng=(e,t=[0,0])=>{var s,i;const{x:n,y:r}=x_(e)?e.internals.positionAbsolute:xh(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)}},t4=(e,t)=>P0(D0(yx(e),yx(t))),Vf=(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)},MA=e=>pi(e.width)&&pi(e.height)&&pi(e.x)&&pi(e.y),pi=e=>!isNaN(e)&&isFinite(e),n4=(e,t)=>(n,r)=>{},vh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Cu=({x:e,y:t},[n,r,s],i=!1,a=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return i?vh(l,a):l},du=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Ul(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 Dle(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Ul(e,n),s=Ul(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ul(e.top??e.y??0,n),s=Ul(e.bottom??e.y??0,n),i=Ul(e.left??e.x??0,t),a=Ul(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 Ple(e,t,n,r,s,i){const{x:a,y:l}=du(e,[t,n,r]),{x:c,y:u}=du({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(l),right:Math.floor(d),bottom:Math.floor(f)}}const __=(e,t,n,r,s,i)=>{const a=Dle(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=cu(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,g=Ple(e,p,m,d,t,n),w={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},Kf=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function gl(e){return e!=null&&e!=="parent"}function _a(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 k_(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 r4(e,t={width:0,height:0},n,r,s){const i={...e},a=r.get(n);if(a){const l=a.origin||s;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function jA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ble(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Fle(e){return{...qP,...e||{}}}function ef(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:i,y:a}=mi(e),l=Cu({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=n?vh(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const N_=e=>({width:e.offsetWidth,height:e.offsetHeight}),s4=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Ule=["INPUT","SELECT","TEXTAREA"];function i4(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:Ule.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const a4=e=>"clientX"in e,mi=(e,t)=>{var i,a;const n=a4(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)}},DA=(e,t,n,r,s)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...N_(a)}})};function o4({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+s*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Rp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function PA({pos:e,x1:t,y1:n,x2:r,y2:s,c:i}){switch(e){case He.Left:return[t-Rp(t-r,i),n];case He.Right:return[t+Rp(r-t,i),n];case He.Top:return[t,n-Rp(n-s,i)];case He.Bottom:return[t,n+Rp(s-n,i)]}}function l4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top,curvature:a=.25}){const[l,c]=PA({pos:n,x1:e,y1:t,x2:r,y2:s,c:a}),[u,d]=PA({pos:i,x1:r,y1:s,x2:e,y2:t,c:a}),[f,h,p,m]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${s}`,f,h,p,m]}function c4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,i=n0}const zle=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Vle=(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)),Kle=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",vi.error006()),t;const r=n.getEdgeId||zle;let s;return ZP(e)?s={...e}:s={...e,id:r(e)},Vle(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function u4({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,i,a,l]=c4({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,i,a,l]}const BA={[He.Left]:{x:-1,y:0},[He.Right]:{x:1,y:0},[He.Top]:{x:0,y:-1},[He.Bottom]:{x:0,y:1}},Yle=({source:e,sourcePosition:t=He.Bottom,target:n})=>t===He.Left||t===He.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Wle({source:e,sourcePosition:t=He.Bottom,target:n,targetPosition:r=He.Top,center:s,offset:i,stepPosition:a}){const l=BA[t],c=BA[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=Yle({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],g,w;const y={x:0,y:0},b={x:0,y:0},[,,x,_]=c4({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=s.x??u.x+(d.x-u.x)*a,w=s.y??(u.y+d.y)/2):(g=s.x??(u.x+d.x)/2,w=s.y??u.y+(d.y-u.y)*a);const S=[{x:g,y:u.y},{x:g,y:d.y}],R=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?R:S:m=l.y===p?S:R,t===r){const L=Math.abs(e[h]-n[h]);if(L<=i){const U=Math.min(i-1,i-L);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*U:b[h]=(d[h]>n[h]?-1:1)*U}}if(t!==r){const L=h==="x"?"y":"x",U=l[h]===c[L],C=u[L]>d[L],M=u[L]=Y?(g=(I.x+j.x)/2,w=m[0].y):(g=m[0].x,w=(I.y+j.y)/2)}const k={x:u.x+y.x,y:u.y+y.y},N={x:d.x+b.x,y:d.y+b.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],g,w,x,_]}function Gle(e,t,n,r){const s=Math.min(FA(e,t)/2,FA(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 bx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Xle(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=bx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const d4=1e3,Qle=10,S_={nodeOrigin:[0,0],nodeExtent:Hf,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Zle={...S_,checkEquality:!0};function T_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Jle(e,t,n){const r=T_(S_,n);for(const s of e.values())if(s.parentId)C_(s,e,t,r);else{const i=xh(s,r.nodeOrigin),a=gl(s.extent)?s.extent:r.nodeExtent,l=ml(i,a,_a(s));s.internals.positionAbsolute=l}}function ece(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 A_(e){return e==="manual"}function Ex(e,t,n,r={}){var d,f;const s=T_(Zle,r),i={i:0},a=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!A_(s.zIndexMode)?d4: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=xh(h,s.nodeOrigin),g=gl(h.extent)?h.extent:s.nodeExtent,w=ml(m,g,_a(h));p={...s.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:ece(h,p),z:f4(h,l,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&&C_(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function tce(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 C_(e,t,n,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=T_(S_,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}tce(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*Qle),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const f=i&&!A_(c)?d4:0,{x:h,y:p,z:m}=nce(e,d,a,l,f,c),{positionAbsolute:g}=e.internals,w=h!==g.x||p!==g.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:g,z:m}})}function f4(e,t,n){const r=pi(e.zIndex)?e.zIndex:0;return A_(n)?r:r+(e.selected?t:0)}function nce(e,t,n,r,s,i){const{x:a,y:l}=t.internals.positionAbsolute,c=_a(e),u=xh(e,n),d=gl(e.extent)?ml(u,e.extent,c):u;let f=ml({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=e4(f,c,t));const h=f4(e,s,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function I_(e,t,n,r=[0,0]){var a;const s=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??uu(c),d=t4(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=_a(c),h=c.origin??r,p=l.x0||m>0||y||b)&&(s.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+b}}),(x=n.get(u))==null||x.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=I_(h,t,n,s);u.push(...p)}return{changes:u,updatedInternals:c}}async function sce({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 zA(e,t,n,r,s,i){let a=s;const l=r.get(a)||new Map;r.set(a,l.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 h4(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:i,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:l},u=`${s}-${a}--${i}-${l}`,d=`${i}-${l}--${s}-${a}`;zA("source",c,d,e,s,a),zA("target",c,u,e,i,l),t.set(r.id,r)}}function p4(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:p4(n,t):!1}function VA(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 ice(e,t,n,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!p4(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&s.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function Rb({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,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=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function ace({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=vh(i,t);return{x:a.x-i.x,y:a.y-i.y}}function oce({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,g=null;function w({noDragClassName:b,handleSelector:x,domNode:_,isSelectable:k,nodeId:N,nodeClickDistance:T=0}){h=gs(_);function S({x:F,y:Y}){const{nodeLookup:L,nodeExtent:U,snapGrid:C,snapToGrid:M,nodeOrigin:O,onNodeDrag:D,onSelectionDrag:A,onError:H,updateNodePositions:W}=t();i={x:F,y:Y};let P=!1;const te=l.size>1,X=te&&U?yx(wh(l)):null,ne=te&&M?ace({dragItems:l,snapGrid:C,x:F,y:Y}):null;for(const[ce,J]of l){if(!L.has(ce))continue;let fe={x:F-J.distance.x,y:Y-J.distance.y};M&&(fe=ne?{x:Math.round(fe.x+ne.x),y:Math.round(fe.y+ne.y)}:vh(fe,C));let ee=null;if(te&&U&&!J.extent&&X){const{positionAbsolute:xe}=J.internals,we=xe.x-X.x+U[0][0],Ae=xe.x+J.measured.width-X.x2+U[1][0],Re=xe.y-X.y+U[0][1],Ye=xe.y+J.measured.height-X.y2+U[1][1];ee=[[we,Re],[Ae,Ye]]}const{position:Ee,positionAbsolute:ge}=JP({nodeId:ce,nextPosition:fe,nodeLookup:L,nodeExtent:ee||U,nodeOrigin:O,onError:H});P=P||J.position.x!==Ee.x||J.position.y!==Ee.y,J.position=Ee,J.internals.positionAbsolute=ge}if(m=m||P,!!P&&(W(l,!0),g&&(r||D||!N&&A))){const[ce,J]=Rb({nodeId:N,dragItems:l,nodeLookup:L});r==null||r(g,l,ce,J),D==null||D(g,ce,J),N||A==null||A(g,J)}}async function R(){if(!d)return;const{transform:F,panBy:Y,autoPanSpeed:L,autoPanOnNodeDrag:U}=t();if(!U){c=!1,cancelAnimationFrame(a);return}const[C,M]=v_(u,d,L);(C!==0||M!==0)&&(i.x=(i.x??0)-C/F[2],i.y=(i.y??0)-M/F[2],await Y({x:C,y:M})&&S(i)),a=requestAnimationFrame(R)}function I(F){var te;const{nodeLookup:Y,multiSelectionActive:L,nodesDraggable:U,transform:C,snapGrid:M,snapToGrid:O,selectNodesOnDrag:D,onNodeDragStart:A,onSelectionDragStart:H,unselectNodesAndEdges:W}=t();f=!0,(!D||!k)&&!L&&N&&((te=Y.get(N))!=null&&te.selected||W()),k&&D&&N&&(e==null||e(N));const P=ef(F.sourceEvent,{transform:C,snapGrid:M,snapToGrid:O,containerBounds:d});if(i=P,l=ice(Y,U,P,N),l.size>0&&(n||A||!N&&H)){const[X,ne]=Rb({nodeId:N,dragItems:l,nodeLookup:Y});n==null||n(F.sourceEvent,l,X,ne),A==null||A(F.sourceEvent,X,ne),N||H==null||H(F.sourceEvent,ne)}}const j=OP().clickDistance(T).on("start",F=>{const{domNode:Y,nodeDragThreshold:L,transform:U,snapGrid:C,snapToGrid:M}=t();d=(Y==null?void 0:Y.getBoundingClientRect())||null,p=!1,m=!1,g=F.sourceEvent,L===0&&I(F),i=ef(F.sourceEvent,{transform:U,snapGrid:C,snapToGrid:M,containerBounds:d}),u=mi(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:L,snapGrid:U,snapToGrid:C,nodeDragThreshold:M,nodeLookup:O}=t(),D=ef(F.sourceEvent,{transform:L,snapGrid:U,snapToGrid:C,containerBounds:d});if(g=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||N&&!O.has(N))&&(p=!0),!p){if(!c&&Y&&f&&(c=!0,R()),!f){const A=mi(F.sourceEvent,d),H=A.x-u.x,W=A.y-u.y;Math.sqrt(H*H+W*W)>M&&I(F)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&l&&f&&(u=mi(F.sourceEvent,d),S(D))}}).on("end",F=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:Y,updateNodePositions:L,onNodeDragStop:U,onSelectionDragStop:C}=t();if(m&&(L(l,!1),m=!1),s||U||!N&&C){const[M,O]=Rb({nodeId:N,dragItems:l,nodeLookup:Y,dragging:!1});s==null||s(F.sourceEvent,l,M,O),U==null||U(F.sourceEvent,M,O),N||C==null||C(F.sourceEvent,O)}}}).filter(F=>{const Y=F.target;return!F.button&&(!b||!VA(Y,`.${b}`,_))&&(!x||VA(Y,x,_))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:w,destroy:y}}function lce(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())Vf(s,uu(i))>0&&r.push(i);return r}const cce=250;function uce(e,t,n,r){var l,c;let s=[],i=1/0;const a=lce(e,n,t+cce);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.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}=yl(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 m4(e,t,n,r,s,i=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=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?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...yl(a,c,c.position,!0)}:c}function g4(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function dce(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const y4=()=>!0;function fce(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:g,onConnectEnd:w,isValidConnection:y=y4,onReconnectEnd:b,updateConnection:x,getTransform:_,getFromHandle:k,autoPanSpeed:N,dragThreshold:T=1,handleDomNode:S}){const R=s4(e.target);let I=0,j;const{x:F,y:Y}=mi(e),L=g4(i,S),U=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!U||!L)return;const M=m4(s,L,r,c,t);if(!M)return;let O=mi(e,U),D=!1,A=null,H=!1,W=null;function P(){if(!d||!U)return;const[Ee,ge]=v_(O,U,N);h({x:Ee,y:ge}),I=requestAnimationFrame(P)}const te={...M,nodeId:s,type:L,position:M.position},X=c.get(s);let ce={inProgress:!0,isValid:null,from:yl(X,te,He.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:X,to:O,toHandle:null,toPosition:OA[te.position],toNode:null,pointer:O};function J(){C=!0,x(ce),m==null||m(e,{nodeId:s,handleId:r,handleType:L})}T===0&&J();function fe(Ee){if(!C){const{x:Ye,y:Le}=mi(Ee),bt=Ye-F,Ze=Le-Y;if(!(bt*bt+Ze*Ze>T*T))return;J()}if(!k()||!te){ee(Ee);return}const ge=_();O=mi(Ee,U),j=uce(Cu(O,ge,!1,[1,1]),n,c,te),D||(P(),D=!0);const xe=b4(Ee,{handle:j,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});W=xe.handleDomNode,A=xe.connection,H=dce(!!j,xe.isValid);const we=c.get(s),Ae=we?yl(we,te,He.Left,!0):ce.from,Re={...ce,from:Ae,isValid:H,to:xe.toHandle&&H?du({x:xe.toHandle.x,y:xe.toHandle.y},ge):O,toHandle:xe.toHandle,toPosition:H&&xe.toHandle?xe.toHandle.position:OA[te.position],toNode:xe.toHandle?c.get(xe.toHandle.nodeId):null,pointer:O};x(Re),ce=Re}function ee(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(C){(j||W)&&A&&H&&(g==null||g(A));const{inProgress:ge,...xe}=ce,we={...xe,toPosition:ce.toHandle?ce.toPosition:null};w==null||w(Ee,we),i&&(b==null||b(Ee,we))}p(),cancelAnimationFrame(I),D=!1,H=!1,A=null,W=null,R.removeEventListener("mousemove",fe),R.removeEventListener("mouseup",ee),R.removeEventListener("touchmove",fe),R.removeEventListener("touchend",ee)}}R.addEventListener("mousemove",fe),R.addEventListener("mouseup",ee),R.addEventListener("touchmove",fe),R.addEventListener("touchend",ee)}function b4(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=y4,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-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}=mi(e),g=a.elementFromPoint(p,m),w=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,y={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=g4(void 0,w),x=w.getAttribute("data-nodeid"),_=w.getAttribute("data-handleid"),k=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!x||!b)return y;const T={source:f?x:r,sourceHandle:f?_:s,target:f?r:x,targetHandle:f?s:_};y.connection=T;const R=k&&N&&(n===ou.Strict?f&&b==="source"||!f&&b==="target":x!==r||_!==s);y.isValid=R&&u(T),y.toHandle=m4(x,b,_,d,n,!0)}return y}const xx={onPointerDown:fce,isValid:b4};function hce({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=gs(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const _=n(),k=x.sourceEvent.ctrlKey&&Kf()?10:1,N=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,T=_[2]*Math.pow(2,N*k);t.scaleTo(T)};let g=[0,0];const w=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(g=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const _=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const k=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const T=r()*Math.max(_[2],Math.log(_[2]))*(p?-1:1),S={x:_[0]-N[0]*T,y:_[1]-N[1]*T},R=[[0,0],[c,u]];t.setViewportConstrained({x:S.x,y:S.y,zoom:_[2]},R,l)},b=WP().on("start",w).on("zoom",f?y:null).on("zoom.wheel",h?m:null);s.call(b,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ci}}const B0=e=>({x:e.x,y:e.y,zoom:e.k}),Ob=({x:e,y:t,zoom:n})=>j0.translate(e,t).scale(n),mc=(e,t)=>e.target.closest(`.${t}`),E4=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),pce=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Lb=(e,t=0,n=pce,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},x4=e=>{const t=e.ctrlKey&&Kf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function mce({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(mc(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=ci(d),y=x4(d),b=f*Math.pow(2,y);r.scaleTo(n,b,w,d);return}const h=d.deltaMode===1?20:1;let p=s===rl.Vertical?0:d.deltaX*h,m=s===rl.Horizontal?0:d.deltaY*h;!Kf()&&d.shiftKey&&s!==rl.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const g=B0(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function gce({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const i=r.type==="wheel",a=!t&&i&&!r.ctrlKey,l=mc(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,s)}}function yce({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,a,l;if((i=r.sourceEvent)!=null&&i.internal)return;const s=B0(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function bce({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&E4(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((l=i.sourceEvent)!=null&&l.internal)&&(s==null||s(i.sourceEvent,B0(i.transform)))}}function Ece({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&E4(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=B0(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},n?150:0)}}}function xce({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var w;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(mc(f,`${u}-flow__node`)||mc(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!s&&!i&&!n||a||d&&!m||mc(f,l)&&m||mc(f,c)&&(!m||s&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.length)>1)return f.preventDefault(),!1;if(!h&&!s&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&g}}function wce({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=WP().scaleExtent([t,n]).translateExtent(r),h=gs(e).call(f);b({x:s.x,y:s.y,zoom:cu(s.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(x4);async function g(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).transform(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function w({noWheelClassName:j,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:L,panOnScroll:U,panOnDrag:C,panOnScrollMode:M,panOnScrollSpeed:O,preventScrolling:D,zoomOnPinch:A,zoomOnScroll:H,zoomOnDoubleClick:W,zoomActivationKeyPressed:P,lib:te,onTransformChange:X,connectionInProgress:ne,paneClickDistance:ce,selectionOnDrag:J}){L&&!u.isZoomingOrPanning&&y();const fe=U&&!P&&!L;f.clickDistance(J?1/0:!pi(ce)||ce<0?0:ce);const ee=fe?mce({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:O,zoomOnPinch:A,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):gce({noWheelClassName:j,preventScrolling:D,d3ZoomHandler:p});h.on("wheel.zoom",ee,{passive:!1});const Ee=yce({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ee);const ge=bce({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!Y,onPanZoom:i,onTransformChange:X});f.on("zoom",ge);const xe=Ece({zoomPanValues:u,panOnDrag:C,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:l,onDraggingChange:c});f.on("end",xe);const we=xce({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:H,panOnScroll:U,zoomOnDoubleClick:W,zoomOnPinch:A,userSelectionActive:L,noPanClassName:F,noWheelClassName:j,lib:te,connectionInProgress:ne});f.filter(we),W?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function b(j,F,Y){const L=Ob(j),U=f==null?void 0:f.constrain()(L,F,Y);return U&&await g(U),U}async function x(j,F){const Y=Ob(j);return await g(Y,F),Y}function _(j){if(h){const F=Ob(j),Y=h.property("__zoom");(Y.k!==j.zoom||Y.x!==j.x||Y.y!==j.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function k(){const j=h?YP(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function N(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleTo(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}async function T(j,F){return h?new Promise(Y=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Jd:gm).scaleBy(Lb(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),j)}):!1}function S(j){f==null||f.scaleExtent(j)}function R(j){f==null||f.translateExtent(j)}function I(j){const F=!pi(j)||j<0?0:j;f==null||f.clickDistance(F)}return{update:w,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:k,scaleTo:N,scaleBy:T,setScaleExtent:S,setTranslateExtent:R,syncViewport:_,setClickDistance:I}}var fu;(function(e){e.Line="line",e.Handle="handle"})(fu||(fu={}));function vce({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:i}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&s&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function KA(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 Ma(e,t){return Math.max(0,t-e)}function ja(e,t){return Math.max(0,e-t)}function Op(e,t,n){return Math.max(0,t-e,e-n)}function YA(e,t){return e?!t:t}function _ce(e,t,n,r,s,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:g,maxWidth:w,minHeight:y,maxHeight:b}=r,{x,y:_,width:k,height:N,aspectRatio:T}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=k+(c?-S:S),j=N+(u?-R:R),F=-i[0]*k,Y=-i[1]*N;let L=Op(I,g,w),U=Op(j,y,b);if(a){let O=0,D=0;c&&S<0?O=Ma(x+S+F,a[0][0]):!c&&S>0&&(O=ja(x+I+F,a[1][0])),u&&R<0?D=Ma(_+R+Y,a[0][1]):!u&&R>0&&(D=ja(_+j+Y,a[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(l){let O=0,D=0;c&&S>0?O=ja(x+S,l[0][0]):!c&&S<0&&(O=Ma(x+I,l[1][0])),u&&R>0?D=ja(_+R,l[0][1]):!u&&R<0&&(D=Ma(_+j,l[1][1])),L=Math.max(L,O),U=Math.max(U,D)}if(s){if(d){const O=Op(I/T,y,b)*T;if(L=Math.max(L,O),a){let D=0;!c&&!u||c&&!u&&h?D=ja(_+Y+I/T,a[1][1])*T:D=Ma(_+Y+(c?S:-S)/T,a[0][1])*T,L=Math.max(L,D)}if(l){let D=0;!c&&!u||c&&!u&&h?D=Ma(_+I/T,l[1][1])*T:D=ja(_+(c?S:-S)/T,l[0][1])*T,L=Math.max(L,D)}}if(f){const O=Op(j*T,g,w)/T;if(U=Math.max(U,O),a){let D=0;!c&&!u||u&&!c&&h?D=ja(x+j*T+F,a[1][0])/T:D=Ma(x+(u?R:-R)*T+F,a[0][0])/T,U=Math.max(U,D)}if(l){let D=0;!c&&!u||u&&!c&&h?D=Ma(x+j*T,l[1][0])/T:D=ja(x+(u?R:-R)*T,l[0][0])/T,U=Math.max(U,D)}}}R=R+(R<0?U:-U),S=S+(S<0?L:-L),s&&(h?I>j*T?R=(YA(c,u)?-S:S)/T:S=(YA(c,u)?-R:R)*T:d?(R=S/T,u=c):(S=R*T,c=u));const C=c?x+S:x,M=u?_+R:_;return{width:k+(c?-S:S),height:N+(u?-R:R),x:i[0]*S*(c?-1:1)+C,y:i[1]*R*(u?-1:1)+M}}const w4={width:0,height:0,x:0,y:0},kce={...w4,pointerX:0,pointerY:0,aspectRatio:1};function Nce(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,l=n[0]*i,c=n[1]*a;return[[r-l,s-c],[r+i-l,s+a-c]]}function Sce({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const i=gs(e);let a={controlDirection:KA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:g,shouldResize:w}){let y={...w4},b={...kce};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:KA(u)};let x,_=null,k=[],N,T,S,R=!1;const I=OP().on("start",j=>{const{nodeLookup:F,transform:Y,snapGrid:L,snapToGrid:U,nodeOrigin:C,paneDomNode:M}=n();if(x=F.get(t),!x)return;_=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:D}=ef(j.sourceEvent,{transform:Y,snapGrid:L,snapToGrid:U,containerBounds:_});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},b={...y,pointerX:O,pointerY:D,aspectRatio:y.width/y.height},N=void 0,T=gl(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(N=F.get(x.parentId)),N&&x.extent==="parent"&&(T=[[0,0],[N.measured.width,N.measured.height]]),k=[],S=void 0;for(const[A,H]of F)if(H.parentId===t&&(k.push({id:A,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const W=Nce(H,x,H.origin??C);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(j,{...y})}).on("drag",j=>{const{transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U}=n(),C=ef(j.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:L,containerBounds:_}),M=[];if(!x)return;const{x:O,y:D,width:A,height:H}=y,W={},P=x.origin??U,{width:te,height:X,x:ne,y:ce}=_ce(b,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,T,S),J=te!==A,fe=X!==H,ee=ne!==O&&J,Ee=ce!==D&&fe;if(!ee&&!Ee&&!J&&!fe)return;if((ee||Ee||P[0]===1||P[1]===1)&&(W.x=ee?ne:y.x,W.y=Ee?ce:y.y,y.x=W.x,y.y=W.y,k.length>0)){const Ae=ne-O,Re=ce-D;for(const Ye of k)Ye.position={x:Ye.position.x-Ae+P[0]*(te-A),y:Ye.position.y-Re+P[1]*(X-H)},M.push(Ye)}if((J||fe)&&(W.width=J&&(!a.resizeDirection||a.resizeDirection==="horizontal")?te:y.width,W.height=fe&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=W.width,y.height=W.height),N&&x.expandParent){const Ae=P[0]*(W.width??0);W.x&&W.x{R&&(g==null||g(j,{...y}),s==null||s({...y}),R=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var v4={exports:{}},_4={},k4={exports:{}},N4={};/** * @license React * use-sync-external-store-shim.production.js * @@ -559,7 +559,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),A=C,D=M),O===void 0&&( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fu=E;function Sce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tce=typeof Object.is=="function"?Object.is:Sce,Ace=fu.useState,Cce=fu.useEffect,Ice=fu.useLayoutEffect,Rce=fu.useDebugValue;function Oce(e,t){var n=t(),r=Ace({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Ice(function(){s.value=n,s.getSnapshot=t,Mb(s)&&i({inst:s})},[e,n,t]),Cce(function(){return Mb(s)&&i({inst:s}),e(function(){Mb(s)&&i({inst:s})})},[e]),Rce(n),n}function Mb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tce(e,n)}catch{return!0}}function Lce(e,t){return t()}var Mce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lce:Oce;N4.useSyncExternalStore=fu.useSyncExternalStore!==void 0?fu.useSyncExternalStore:Mce;k4.exports=N4;var jce=k4.exports;/** + */var hu=E;function Tce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ace=typeof Object.is=="function"?Object.is:Tce,Cce=hu.useState,Ice=hu.useEffect,Rce=hu.useLayoutEffect,Oce=hu.useDebugValue;function Lce(e,t){var n=t(),r=Cce({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Rce(function(){s.value=n,s.getSnapshot=t,Mb(s)&&i({inst:s})},[e,n,t]),Ice(function(){return Mb(s)&&i({inst:s}),e(function(){Mb(s)&&i({inst:s})})},[e]),Oce(n),n}function Mb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ace(e,n)}catch{return!0}}function Mce(e,t){return t()}var jce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Mce:Lce;N4.useSyncExternalStore=hu.useSyncExternalStore!==void 0?hu.useSyncExternalStore:jce;k4.exports=N4;var Dce=k4.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -567,24 +567,24 @@ https://github.com/highlightjs/highlight.js/issues/2277`),A=C,D=M),O===void 0&&( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var F0=E,Dce=jce;function Pce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bce=typeof Object.is=="function"?Object.is:Pce,Fce=Dce.useSyncExternalStore,Uce=F0.useRef,$ce=F0.useEffect,Hce=F0.useMemo,zce=F0.useDebugValue;_4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=Uce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Hce(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,Bce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=Fce(e,i[0],i[1]);return $ce(function(){a.hasValue=!0,a.value=l},[l]),zce(l),l};v4.exports=_4;var Vce=v4.exports;const Kce=Xf(Vce),Yce={},WA=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:()=>{(Yce?"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},Wce=e=>e?WA(e):WA,{useDebugValue:Gce}=kt,{useSyncExternalStoreWithSelector:qce}=Kce,Xce=e=>e;function S4(e,t=Xce,n){const r=qce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Gce(r),r}const GA=(e,t)=>{const n=Wce(e),r=(s,i=t)=>S4(n,s,i);return Object.assign(r,n),r},Qce=(e,t)=>e?GA(e,t):GA;function In(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 U0=E.createContext(null),Zce=U0.Provider,T4=vi.error001("react");function Rt(e,t){const n=E.useContext(U0);if(n===null)throw new Error(T4);return S4(n,e,t)}function Rn(){const e=E.useContext(U0);if(e===null)throw new Error(T4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qA={display:"none"},Jce={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},A4="react-flow__node-desc",C4="react-flow__edge-desc",eue="react-flow__aria-live",tue=e=>e.ariaLiveMessage,nue=e=>e.ariaLabelConfig;function rue({rfId:e}){const t=Rt(tue);return o.jsx("div",{id:`${eue}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Jce,children:t})}function sue({rfId:e,disableKeyboardA11y:t}){const n=Rt(nue);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${A4}-${e}`,style:qA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${C4}-${e}`,style:qA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(rue,{rfId:e})]})}const $0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:or(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});$0.displayName="Panel";function iue({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx($0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const aue=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}},Lp=e=>e.id;function oue(e,t){return In(e.selectedNodes.map(Lp),t.selectedNodes.map(Lp))&&In(e.selectedEdges.map(Lp),t.selectedEdges.map(Lp))}function lue({onSelectionChange:e}){const t=Rn(),{selectedNodes:n,selectedEdges:r}=Rt(aue,oue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const cue=e=>!!e.onSelectionChangeHandlers;function uue({onSelectionChange:e}){const t=Rt(cue);return e||t?o.jsx(lue,{onSelectionChange:e}):null}const I4=[0,0],due={x:0,y:0,zoom:1},fue=["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"],XA=[...fue,"rfId"],hue=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}),QA={translateExtent:Hf,nodeOrigin:I4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function pue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Rt(hue,In),u=Rn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=QA,l()}),[]);const d=E.useRef(QA);return E.useEffect(()=>{for(const f of XA){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:Ble(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},XA.map(f=>e[f])),null}function ZA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function mue(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=ZA(),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=ZA())!=null&&r.matches?"dark":"light"}const JA=typeof document<"u"?document:null;function Yf(e=null,t={target:JA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var F0=E,Pce=Dce;function Bce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fce=typeof Object.is=="function"?Object.is:Bce,Uce=Pce.useSyncExternalStore,$ce=F0.useRef,Hce=F0.useEffect,zce=F0.useMemo,Vce=F0.useDebugValue;_4.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=$ce(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=zce(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,Fce(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,f=g)}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 l=Uce(e,i[0],i[1]);return Hce(function(){a.hasValue=!0,a.value=l},[l]),Vce(l),l};v4.exports=_4;var Kce=v4.exports;const Yce=Xf(Kce),Wce={},WA=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:()=>{(Wce?"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},Gce=e=>e?WA(e):WA,{useDebugValue:qce}=kt,{useSyncExternalStoreWithSelector:Xce}=Yce,Qce=e=>e;function S4(e,t=Qce,n){const r=Xce(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qce(r),r}const GA=(e,t)=>{const n=Gce(e),r=(s,i=t)=>S4(n,s,i);return Object.assign(r,n),r},Zce=(e,t)=>e?GA(e,t):GA;function In(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 U0=E.createContext(null),Jce=U0.Provider,T4=vi.error001("react");function Rt(e,t){const n=E.useContext(U0);if(n===null)throw new Error(T4);return S4(n,e,t)}function Rn(){const e=E.useContext(U0);if(e===null)throw new Error(T4);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const qA={display:"none"},eue={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},A4="react-flow__node-desc",C4="react-flow__edge-desc",tue="react-flow__aria-live",nue=e=>e.ariaLiveMessage,rue=e=>e.ariaLabelConfig;function sue({rfId:e}){const t=Rt(nue);return o.jsx("div",{id:`${tue}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:eue,children:t})}function iue({rfId:e,disableKeyboardA11y:t}){const n=Rt(rue);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${A4}-${e}`,style:qA,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${C4}-${e}`,style:qA,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(sue,{rfId:e})]})}const $0=E.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:or(["react-flow__panel",n,...a]),style:r,ref:i,...s,children:t})});$0.displayName="Panel";function aue({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx($0,{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:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oue=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}},Lp=e=>e.id;function lue(e,t){return In(e.selectedNodes.map(Lp),t.selectedNodes.map(Lp))&&In(e.selectedEdges.map(Lp),t.selectedEdges.map(Lp))}function cue({onSelectionChange:e}){const t=Rn(),{selectedNodes:n,selectedEdges:r}=Rt(oue,lue);return E.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[n,r,e]),null}const uue=e=>!!e.onSelectionChangeHandlers;function due({onSelectionChange:e}){const t=Rt(uue);return e||t?o.jsx(cue,{onSelectionChange:e}):null}const I4=[0,0],fue={x:0,y:0,zoom:1},hue=["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"],XA=[...hue,"rfId"],pue=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}),QA={translateExtent:Hf,nodeOrigin:I4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function mue(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Rt(pue,In),u=Rn();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=QA,l()}),[]);const d=E.useRef(QA);return E.useEffect(()=>{for(const f of XA){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:Fle(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},XA.map(f=>e[f])),null}function ZA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function gue(e){var r;const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const s=ZA(),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=ZA())!=null&&r.matches?"dark":"light"}const JA=typeof document<"u"?document:null;function Yf(e=null,t={target:JA,actInsideInputWithModifier:!0}){const[n,r]=E.useState(!1),s=E.useRef(!1),i=E.useRef(new Set([])),[a,l]=E.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 E.useEffect(()=>{const c=(t==null?void 0:t.target)??JA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&i4(p))return!1;const g=tC(p.code,l);if(i.current.add(p[g]),eC(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=tC(p.code,l);eC(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 eC(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function tC(e,t){return t.includes(e)?"code":"key"}const gue=()=>{const e=Rn();return E.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:l}=e.getState(),c=__(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return Au(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=uu(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function R4(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 l={...i};for(const c of a)yue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function yue(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 O4(e,t){return R4(e,t)}function L4(e,t){return R4(e,t)}function Po(e,t){return{id:e,type:"select",selected:t}}function mc(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(Po(i.id,a)))}return r}function nC({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 rC(e){return{id:e.id,type:"remove"}}const bue=n4();function M4(e,t,n={}){return Vle(e,t,{...n,onError:n.onError??bue})}const sC=e=>Cle(e),Eue=e=>ZP(e);function j4(e){return E.forwardRef(e)}const xue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function iC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>wue(()=>n(s=>s+BigInt(1))));return xue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function wue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const D4=E.createContext(null);function vue({children:e}){const t=Rn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=nC({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=iC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(nC({items:p,lookup:h}))},[]),i=iC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(D4.Provider,{value:a,children:e})}function _ue(){const e=E.useContext(D4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const kue=e=>!!e.panZoom;function H0(){const e=gue(),t=Rn(),n=_ue(),r=Rt(kue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=sC(f)?f:h.get(f.id),g=m.parentId?r4(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return cu(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&sC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&Eue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await Mle({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),T=N.length>0,S=k.length>0;if(T){const R=N.map(rC);w==null||w(N),b(R)}if(S){const R=k.map(rC);g==null||g(k),y(R)}return(S||T)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=MA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=cu(w?y:b),_=Vf(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=MA(f)?f:c(f);if(!g)return!1;const w=Vf(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Ile(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??Ple();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const aC=e=>e.selected,Nue=typeof window<"u"?window:void 0;function Sue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Rn(),{deleteElements:r}=H0(),s=Yf(e,{actInsideInputWithModifier:!1}),i=Yf(t,{target:Nue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(aC),edges:a.filter(aC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Tue(e){const t=Rn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=N_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",vi.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 z0={position:"absolute",width:"100%",height:"100%",top:0,left:0},Aue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Cue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=rl.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=Rn(),N=E.useRef(null),{userSelectionActive:T,lib:S,connectionInProgress:R}=Rt(Aue,In),I=Yf(h),j=E.useRef();Tue(N);const F=E.useCallback(Y=>{y==null||y({x:Y[0],y:Y[1],zoom:Y[2]}),b||k.setState({transform:Y})},[y,b]);return E.useEffect(()=>{if(N.current){j.current=xce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(M=>M.paneDragging===C?M:{paneDragging:C}),onPanZoomStart:(C,M)=>{const{onViewportChangeStart:O,onMoveStart:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoom:(C,M)=>{const{onViewportChange:O,onMove:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoomEnd:(C,M)=>{const{onViewportChangeEnd:O,onMoveEnd:D}=k.getState();D==null||D(C,M),O==null||O(M)}});const{x:Y,y:L,zoom:U}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[Y,L,U],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=j.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var Y;(Y=j.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:T,noWheelClassName:g,lib:S,onTransformChange:F,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,T,g,S,F,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:z0,children:m})}const Iue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Rue(){const{userSelectionActive:e,userSelectionRect:t}=Rt(Iue,In);return e&&t?o.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 jb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Oue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Lue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=zf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=Rn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:T}=Rt(Oue,In),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),j=E.useRef(new Set),F=E.useRef(new Set),Y=E.useRef(!1),L=E.useRef({x:0,y:0}),U=E.useRef(!1),C=J=>{if(Y.current||k){Y.current=!1;return}u==null||u(J),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},M=J=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){J.preventDefault();return}d==null||d(J)},O=f?J=>f(J):void 0,D=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},A=J=>{var Ye,Le;const{domNode:fe,transform:ee}=y.getState();if(I.current=fe==null?void 0:fe.getBoundingClientRect(),!I.current)return;const Ee=J.target===R.current;if(!Ee&&!!J.target.closest(".nokey")||!e||!(a&&Ee||t)||J.button!==0||!J.isPrimary)return;(Le=(Ye=J.target)==null?void 0:Ye.setPointerCapture)==null||Le.call(Ye,J.pointerId),Y.current=!1;const{x:we,y:Te}=mi(J.nativeEvent,I.current),Re=Au({x:we,y:Te},ee);y.setState({userSelectionRect:{width:0,height:0,startX:Re.x,startY:Re.y,x:we,y:Te}}),Ee||(J.stopPropagation(),J.preventDefault())};function H(J,fe){const{userSelectionRect:ee}=y.getState();if(!ee)return;const{transform:Ee,nodeLookup:ge,edgeLookup:xe,connectionLookup:we,triggerNodeChanges:Te,triggerEdgeChanges:Re,defaultEdgeOptions:Ye}=y.getState(),Le={x:ee.startX,y:ee.startY},{x:bt,y:Ze}=uu(Le,Ee),ze={startX:Le.x,startY:Le.y,x:Jht.id)),F.current=new Set;const ct=(Ye==null?void 0:Ye.selectable)??!0;for(const ht of j.current){const G=we.get(ht);if(G)for(const{edgeId:Z}of G.values()){const he=xe.get(Z);he&&(he.selectable??ct)&&F.current.add(Z)}}if(!jA(le,j.current)){const ht=mc(ge,j.current,!0);Te(ht)}if(!jA(ve,F.current)){const ht=mc(xe,F.current);Re(ht)}y.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!I.current)return;const[J,fe]=v_(L.current,I.current,T);N({x:J,y:fe}).then(ee=>{if(!Y.current||!ee){w.current=requestAnimationFrame(W);return}const{x:Ee,y:ge}=L.current;H(Ee,ge),w.current=requestAnimationFrame(W)})}const P=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};E.useEffect(()=>()=>P(),[]);const te=J=>{const{userSelectionRect:fe,transform:ee,resetSelectedElements:Ee}=y.getState();if(!I.current||!fe)return;const{x:ge,y:xe}=mi(J.nativeEvent,I.current);L.current={x:ge,y:xe};const we=uu({x:fe.startX,y:fe.startY},ee);if(!Y.current){const Te=t?0:i;if(Math.hypot(ge-we.x,xe-we.y)<=Te)return;Ee(),l==null||l(J)}Y.current=!0,U.current||(W(),U.current=!0),H(ge,xe)},X=J=>{var fe,ee;J.button===0&&((ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),!b&&J.target===R.current&&y.getState().userSelectionRect&&(C==null||C(J)),y.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(c==null||c(J),y.setState({nodesSelectionActive:j.current.size>0})),P())},ne=J=>{var fe,ee;(ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),P()},ce=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:or(["react-flow__pane",{draggable:ce,dragging:_,selection:e}]),onClick:S?void 0:jb(C,R),onContextMenu:jb(M,R),onWheel:jb(O,R),onPointerEnter:S?void 0:h,onPointerMove:S?te:p,onPointerUp:S?X:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?A:void 0,onClickCapture:S?D:void 0,onPointerLeave:m,ref:R,style:z0,children:[g,o.jsx(Rue,{})]})}function wx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",vi.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 P4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=Rn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=ace({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{wx({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 Mue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function B4(){const e=Rn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=Mue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=vh(b,i));const{position:x,positionAbsolute:_}=JP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const R_=E.createContext(null),jue=R_.Provider;R_.Consumer;const F4=()=>E.useContext(R_),Due=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Pue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===au.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Bue({type:e="source",position:t=He.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,g=e==="target",w=Rn(),y=F4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Rt(Due,In),{connectingFrom:k,connectingTo:N,clickConnecting:T,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:j}=Rt(Pue(y,m,e),In);y||(C=(U=w.getState()).onError)==null||C.call(U,"010",vi.error010());const F=M=>{const{defaultEdgeOptions:O,onConnect:D,hasDefaultEdges:A}=w.getState(),H={...O,...M};if(A){const{edges:W,setEdges:P,onError:te}=w.getState();P(M4(H,W,{onError:te}))}D==null||D(H),l==null||l(H)},Y=M=>{if(!y)return;const O=a4(M.nativeEvent);if(s&&(O&&M.button===0||!O)){const D=w.getState();xx.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:g,handleId:m,nodeId:y,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:(...A)=>{var H,W;return(W=(H=w.getState()).onConnectEnd)==null?void 0:W.call(H,...A)},updateConnection:D.updateConnection,onConnect:F,isValidConnection:n||((...A)=>{var H,W;return((W=(H=w.getState()).isValidConnection)==null?void 0:W.call(H,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}O?d==null||d(M):f==null||f(M)},L=M=>{const{onClickConnectStart:O,onClickConnectEnd:D,connectionClickStartHandle:A,connectionMode:H,isValidConnection:W,lib:P,rfId:te,nodeLookup:X,connection:ne}=w.getState();if(!y||!A&&!s)return;if(!A){O==null||O(M.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const ce=s4(M.target),J=n||W,{connection:fe,isValid:ee}=xx.isValid(M.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:H,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:J,flowId:te,doc:ce,lib:P,nodeLookup:X});ee&&fe&&F(fe);const Ee=structuredClone(ne);delete Ee.inProgress,Ee.toPosition=Ee.toHandle?Ee.toHandle.position:null,D==null||D(M,Ee),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:or(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:k,connectingto:N,valid:j,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:b?L:void 0,ref:p,...h,children:c})}const Dr=E.memo(j4(Bue));function Fue({data:e,isConnectable:t,sourcePosition:n=He.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function Uue({data:e,isConnectable:t,targetPosition:n=He.Top,sourcePosition:r=He.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:r,isConnectable:t})]})}function $ue(){return null}function Hue({data:e,isConnectable:t,targetPosition:n=He.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Tg={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oC={input:Fue,default:Uue,output:Hue,group:$ue};function zue(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 Vue=e=>{const{width:t,height:n,x:r,y:s}=wh(e.nodeLookup,{filter:i=>!!i.selected});return{width:pi(t)?t:null,height:pi(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 Kue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Rn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Rt(Vue,In),c=B4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(P4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Tg,p.key)&&(p.preventDefault(),c({direction:Tg[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:or(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 lC=typeof window<"u"?window:void 0,Yue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function U4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,preventScrolling:L,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:D,isControlledViewport:A}){const{nodesSelectionActive:H,userSelectionActive:W}=Rt(Yue,In),P=Yf(u,{target:lC}),te=Yf(g,{target:lC}),X=te||S,ne=te||_,ce=d&&X!==!0,J=P||W||ce;return Sue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(Cue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:ne,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!P&&X,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:L,noWheelClassName:C,noPanClassName:M,onViewportChange:D,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:ce,children:o.jsxs(Lue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:X,autoPanOnSelection:R,isSelecting:!!J,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:ce,children:[e,H&&o.jsx(Kue,{onSelectionContextMenu:U,noPanClassName:M,disableKeyboardA11y:O})]})})}U4.displayName="FlowRenderer";const Wue=E.memo(U4),Gue=e=>t=>e?w_(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 que(e){return Rt(E.useCallback(Gue(e),[e]),In)}const Xue=e=>e.updateNodeInternals;function Que(){const e=Rt(Xue),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Zue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Rn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 Jue({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Rt(J=>{const fe=J.nodeLookup.get(e),ee=J.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:ee}},In);let N=x.type||"default",T=(w==null?void 0:w[N])||oC[N];T===void 0&&(b==null||b("003",vi.error003(N)),N="default",T=(w==null?void 0:w.default)||oC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),j=!!(x.focusable||d&&typeof x.focusable>"u"),F=Rn(),Y=k_(x),L=Zue({node:x,nodeType:N,hasDimensions:Y,resizeObserver:f}),U=P4({nodeRef:L,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=B4();if(x.hidden)return null;const M=_a(x),O=zue(x),D=R||S||t||n||r||s,A=n?J=>n(J,{..._.userNode}):void 0,H=r?J=>r(J,{..._.userNode}):void 0,W=s?J=>s(J,{..._.userNode}):void 0,P=i?J=>i(J,{..._.userNode}):void 0,te=a?J=>a(J,{..._.userNode}):void 0,X=J=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ee}=F.getState();R&&(!fe||!S||ee>0)&&wx({id:e,store:F,nodeRef:L}),t&&t(J,{..._.userNode})},ne=J=>{if(!(i4(J.nativeEvent)||m)){if(GP.includes(J.key)&&R){const fe=J.key==="Escape";wx({id:e,store:F,unselect:fe,nodeRef:L})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(Tg,J.key)){J.preventDefault();const{ariaLabelConfig:fe}=F.getState();F.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Tg[J.key],factor:J.shiftKey?4:1})}}},ce=()=>{var we;if(m||!((we=L.current)!=null&&we.matches(":focus-visible")))return;const{transform:J,width:fe,height:ee,autoPanOnNodeFocus:Ee,setCenter:ge}=F.getState();if(!Ee)return;w_(new Map([[e,x]]),{x:0,y:0,width:fe,height:ee},J,!0).length>0||ge(x.position.x+M.width/2,x.position.y+M.height/2,{zoom:J[2]})};return o.jsx("div",{className:or(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:U}]),ref:L,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:Y?"visible":"hidden",...x.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:H,onMouseLeave:W,onContextMenu:P,onClick:X,onDoubleClick:te,onKeyDown:j?ne:void 0,tabIndex:j?0:void 0,onFocus:j?ce:void 0,role:x.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${A4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(jue,{value:e,children:o.jsx(T,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:U,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...M})})})}var ede=E.memo(Jue);const tde=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Rt(tde,In),a=que(e.onlyRenderVisibleElements),l=Que();return o.jsx("div",{className:"react-flow__nodes",style:z0,children:a.map(c=>o.jsx(ede,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}$4.displayName="NodeRenderer";const nde=E.memo($4);function rde(e){return Rt(E.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&&$le({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),In)}const sde=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ide=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cC={[ou.Arrow]:sde,[ou.ArrowClosed]:ide};function ade(e){const t=Rn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(cC,e)?cC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",vi.error009(e)),null)},[e])}const ode=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=ade(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},H4=({defaultColor:e,rfId:t})=>{const n=Rt(i=>i.edges),r=Rt(i=>i.defaultEdgeOptions),s=E.useMemo(()=>qle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(ode,{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};H4.displayName="MarkerDefinitions";var lde=E.memo(H4);function z4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=or(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}z4.displayName="EdgeText";const cde=E.memo(z4);function _h({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:or(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&pi(t)&&pi(n)?o.jsx(cde,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function uC({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===He.Left||e===He.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function V4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top}){const[a,l]=uC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=uC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function K4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=V4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(_h,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const ude=K4({isInternal:!1}),Y4=K4({isInternal:!0});ude.displayName="SimpleBezierEdge";Y4.displayName="SimpleBezierEdgeInternal";function W4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=He.Bottom,targetPosition:m=He.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=Sg({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const G4=W4({isInternal:!1}),q4=W4({isInternal:!0});G4.displayName="SmoothStepEdge";q4.displayName="SmoothStepEdgeInternal";function X4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(G4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const dde=X4({isInternal:!1}),Q4=X4({isInternal:!0});dde.displayName="StepEdge";Q4.displayName="StepEdgeInternal";function Z4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=u4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(_h,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const fde=Z4({isInternal:!1}),J4=Z4({isInternal:!0});fde.displayName="StraightEdge";J4.displayName="StraightEdgeInternal";function e6(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=He.Bottom,targetPosition:l=He.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=l4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const hde=e6({isInternal:!1}),t6=e6({isInternal:!0});hde.displayName="BezierEdge";t6.displayName="BezierEdgeInternal";const dC={default:t6,straight:J4,step:Q4,smoothstep:q4,simplebezier:Y4},fC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},pde=(e,t,n)=>n===He.Left?e-t:n===He.Right?e+t:e,mde=(e,t,n)=>n===He.Top?e-t:n===He.Bottom?e+t:e,hC="react-flow__edgeupdater";function pC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:or([hC,`${hC}-${l}`]),cx:pde(t,r,e),cy:mde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function gde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Rn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:j,cancelConnection:F,nodeLookup:Y,rfId:L,panBy:U,updateConnection:C}=m.getState(),M=k.type==="target",O=(H,W)=>{h(!1),f==null||f(H,n,k.type,W)},D=H=>u==null?void 0:u(n,H),A=(H,W)=>{h(!0),d==null||d(_,n,k.type),j==null||j(H,W)};xx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:T,handleId:k.id,nodeId:k.nodeId,nodeLookup:Y,isTarget:M,edgeUpdaterType:k.type,lib:I,flowId:L,cancelConnection:F,panBy:U,isValidConnection:(...H)=>{var W,P;return((P=(W=m.getState()).isValidConnection)==null?void 0:P.call(W,...H))??!0},onConnect:D,onConnectStart:A,onConnectEnd:(...H)=>{var W,P;return(P=(W=m.getState()).onConnectEnd)==null?void 0:P.call(W,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(pC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(pC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function yde({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Rt(ge=>ge.edgeLookup.get(e));const _=Rt(ge=>ge.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||dC[k];N===void 0&&(y==null||y("011",vi.error011(k)),k="default",N=(g==null?void 0:g.default)||dC.default);const T=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[j,F]=E.useState(!1),[Y,L]=E.useState(!1),U=Rn(),{zIndex:C,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W}=Rt(E.useCallback(ge=>{const xe=ge.nodeLookup.get(x.source),we=ge.nodeLookup.get(x.target);if(!xe||!we)return{zIndex:x.zIndex,...fC};const Te=Gle({id:e,sourceNode:xe,targetNode:we,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:y});return{zIndex:Ule({selected:x.selected,zIndex:x.zIndex,sourceNode:xe,targetNode:we,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Te||fC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),In),P=E.useMemo(()=>x.markerStart?`url('#${bx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),te=E.useMemo(()=>x.markerEnd?`url('#${bx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||M===null||O===null||D===null||A===null)return null;const X=ge=>{var Re;const{addSelectedEdges:xe,unselectNodesAndEdges:we,multiSelectionActive:Te}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),x.selected&&Te?(we({nodes:[],edges:[x]}),(Re=I.current)==null||Re.blur()):xe([e])),s&&s(ge,x)},ne=i?ge=>{i(ge,{...x})}:void 0,ce=a?ge=>{a(ge,{...x})}:void 0,J=l?ge=>{l(ge,{...x})}:void 0,fe=c?ge=>{c(ge,{...x})}:void 0,ee=u?ge=>{u(ge,{...x})}:void 0,Ee=ge=>{var xe;if(!b&&GP.includes(ge.key)&&R){const{unselectNodesAndEdges:we,addSelectedEdges:Te}=U.getState();ge.key==="Escape"?((xe=I.current)==null||xe.blur(),we({edges:[x]})):Te([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:or(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:j,selectable:R}]),onClick:X,onDoubleClick:ne,onContextMenu:ce,onMouseEnter:J,onMouseMove:fe,onMouseLeave:ee,onKeyDown:T?Ee:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${C4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!Y&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:P,markerEnd:te,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(gde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,setUpdateHover:F,setReconnecting:L})]})})}var bde=E.memo(yde);const Ede=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function n6({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Rt(Ede,In),_=rde(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(lde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(bde,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}n6.displayName="EdgeRenderer";const xde=E.memo(n6),wde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function vde({children:e}){const t=Rt(wde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function _de(e){const t=H0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const kde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Nde(e){const t=Rt(kde),n=Rn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Sde(e){return e.connection.inProgress?{...e.connection,to:Au(e.connection.to,e.transform)}:{...e.connection}}function Tde(e){return Sde}function Ade(e){const t=Tde();return Rt(t,In)}const Cde=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ide({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Rt(Cde,In);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:or(["react-flow__connection",QP(l)]),children:o.jsx(r6,{style:t,type:n,CustomComponent:r,isValid:l})})})}const r6=({style:e,type:t=Ya.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Ade();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:QP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ya.Bezier:[m]=l4(g);break;case Ya.SimpleBezier:[m]=V4(g);break;case Ya.Step:[m]=Sg({...g,borderRadius:0});break;case Ya.SmoothStep:[m]=Sg(g);break;default:[m]=u4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};r6.displayName="ConnectionLine";const Rde={};function mC(e=Rde){E.useRef(e),Rn(),E.useEffect(()=>{},[e])}function Ode(){Rn(),E.useRef(!1),E.useEffect(()=>{},[])}function s6({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,zoomOnDoubleClick:W,panOnDrag:P,autoPanOnSelection:te,onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneScroll:fe,onPaneContextMenu:ee,paneClickDistance:Ee,nodeClickDistance:ge,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ye,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G,viewport:Z,onViewportChange:he}){return mC(e),mC(t),Ode(),_de(n),Nde(Z),o.jsx(Wue,{onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneContextMenu:ee,onPaneScroll:fe,paneClickDistance:Ee,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:M,zoomOnPinch:O,zoomOnDoubleClick:W,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,panOnDrag:P,autoPanOnSelection:te,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,onViewportChange:he,isControlledViewport:!!Z,children:o.jsxs(vde,{children:[o.jsx(xde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,onlyRenderVisibleElements:R,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Te,onEdgeMouseLeave:Re,reconnectRadius:Ye,defaultMarkerColor:C,noPanClassName:ve,disableKeyboardA11y:ct,rfId:G}),o.jsx(Ide,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(nde,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:ve,noDragClassName:ze,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}s6.displayName="GraphView";const Lde=E.memo(s6),Mde=n4(),gC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Hf;h4(g,w,y);const{nodesInitialized:k}=Ex(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const T=wh(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:S,y:R,zoom:I}=__(T,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Hf,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:au.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...XP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Mde,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},jde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Qce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:T}=m();y&&(await Lle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:T},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...gC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:T}=m(),{nodesInitialized:S,hasSelectedNodes:R}=Ex(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=T&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();h4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:T,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:j}=nce(w,b,x,_,k,N,R);j&&(Zle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const j=_.get(R),F=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(j&&N.inProgress&&N.fromNode.id===j.id){const L=yl(j,N.fromHandle,He.Left,!0);T({...N,from:L})}F&&j.parentId&&b.push({id:R,parentId:j.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(Y)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),j=I_(b,_,R,I);x.push(...j)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=O4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=L4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));_(N);return}_(mc(x,new Set([...w]),!0)),k(mc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));k(N);return}k(mc(b,new Set([...w]))),_(mc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),T=w||x,S=y||b,R=[];for(const j of T){if(!j.selected)continue;const F=_.get(j.id);F&&(F.selected=!1),R.push(Po(j.id,!1))}const I=[];for(const j of S)j.selected&&I.push(Po(j.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]),N=w.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:T}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(Ex(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:T}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return rce({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const T=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*T,y:_/2-y*T,zoom:T},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...XP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...gC()})}},Object.is);function O_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>jde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Zce,{value:m,children:o.jsx(vue,{children:p})})}function Dde({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(U0)?o.jsx(o.Fragment,{children:e}):o.jsx(O_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Pde={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Bde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onSelectionChange:Y,onSelectionDragStart:L,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onBeforeDelete:A,connectionMode:H,connectionLineType:W=Ya.Bezier,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,deleteKeyCode:ne="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:J=!1,selectionMode:fe=zf.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:Ee=Kf()?"Meta":"Control",zoomActivationKeyCode:ge=Kf()?"Meta":"Control",snapToGrid:xe,snapGrid:we,onlyRenderVisibleElements:Te=!1,selectNodesOnDrag:Re,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,nodeOrigin:ze=I4,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct=!0,defaultViewport:ht=due,minZoom:G=.5,maxZoom:Z=2,translateExtent:he=Hf,preventScrolling:De=!0,nodeExtent:qe,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:Vt=!0,zoomOnPinch:Et=!0,panOnScroll:Pt=!1,panOnScrollSpeed:Kt=.5,panOnScrollMode:Nt=rl.Free,zoomOnDoubleClick:rn=!0,panOnDrag:sn=!0,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Ae,onPaneContextMenu:pe,paneClickDistance:Je=1,nodeClickDistance:at=0,children:dn,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn=10,onNodesChange:ue,onEdgesChange:Se,noDragClassName:Ce="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ot="nopan",fitView:et,fitViewOptions:Ct,connectOnClick:Yt,attributionPosition:oe,proOptions:be,defaultEdgeOptions:ft,elevateNodesOnSelect:Ve=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:dt=!1,autoPanOnConnect:Wt,autoPanOnNodeDrag:cr,autoPanOnSelection:Yn=!0,autoPanSpeed:hn,connectionRadius:Ln,isValidConnection:Gt,onError:Jt,style:Ot,id:kn,nodeDragThreshold:Nn,connectionDragThreshold:en,viewport:tr,onViewportChange:Wn,width:pr,height:nr,colorMode:Si="light",debug:Xs,onScroll:Zr,ariaLabelConfig:Ar,zIndexMode:Ts="basic",...Qs},ka){const Ur=kn||"1",wo=mue(Si),Na=E.useCallback(Zs=>{Zs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zr==null||Zr(Zs)},[Zr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Qs,onScroll:Na,style:{...Ot,...Pde},ref:ka,className:or(["react-flow",s,wo]),id:kn,role:"application",children:o.jsxs(Dde,{nodes:e,edges:t,width:pr,height:nr,fitView:et,fitViewOptions:Ct,minZoom:G,maxZoom:Z,nodeOrigin:ze,nodeExtent:qe,zIndexMode:Ts,children:[o.jsx(pue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct,elevateNodesOnSelect:Ve,elevateEdgesOnSelect:Ke,minZoom:G,maxZoom:Z,nodeExtent:qe,onNodesChange:ue,onEdgesChange:Se,snapToGrid:xe,snapGrid:we,connectionMode:H,translateExtent:he,connectOnClick:Yt,defaultEdgeOptions:ft,fitView:et,fitViewOptions:Ct,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ot,nodeOrigin:ze,rfId:Ur,autoPanOnConnect:Wt,autoPanOnNodeDrag:cr,autoPanSpeed:hn,onError:Jt,connectionRadius:Ln,isValidConnection:Gt,selectNodesOnDrag:Re,nodeDragThreshold:Nn,connectionDragThreshold:en,onBeforeDelete:A,debug:Xs,ariaLabelConfig:Ar,zIndexMode:Ts}),o.jsx(Lde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,selectionKeyCode:ce,selectionOnDrag:J,selectionMode:fe,deleteKeyCode:ne,multiSelectionKeyCode:Ee,panActivationKeyCode:ee,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Te,defaultViewport:ht,translateExtent:he,minZoom:G,maxZoom:Z,preventScrolling:De,zoomOnScroll:Vt,zoomOnPinch:Et,zoomOnDoubleClick:rn,panOnScroll:Pt,panOnScrollSpeed:Kt,panOnScrollMode:Nt,panOnDrag:sn,autoPanOnSelection:Yn,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Ae,onPaneContextMenu:pe,paneClickDistance:Je,nodeClickDistance:at,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn,defaultMarkerColor:nt,noDragClassName:Ce,noWheelClassName:Qe,noPanClassName:ot,rfId:Ur,disableKeyboardA11y:dt,nodeExtent:qe,viewport:tr,onViewportChange:Wn}),o.jsx(uue,{onSelectionChange:Y}),dn,o.jsx(iue,{proOptions:be,position:oe}),o.jsx(sue,{rfId:Ur,disableKeyboardA11y:dt})]})})}var i6=j4(Bde);const Fde=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Ude({children:e}){const t=Rt(Fde);return t?vs.createPortal(e,t):null}function a6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>O4(s,i)),[]);return[t,n,r]}function o6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>L4(s,i)),[]);return[t,n,r]}const $de=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||!k_(n.userNode))return!1;return!0};function Hde(e={includeHiddenNodes:!1}){return Rt($de(e))}function zde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:or(["react-flow__background-pattern",n,r])})}function Vde({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:or(["react-flow__background-pattern","dots",t])})}var ao;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ao||(ao={}));const Kde={[ao.Dots]:1,[ao.Lines]:1,[ao.Cross]:6},Yde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function l6({id:e,variant:t=ao.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Rt(Yde,In),m=r||Kde[t],g=t===ao.Dots,w=t===ao.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:or(["react-flow__background",u]),style:{...c,...z0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Vde,{radius:x/2,className:d}):o.jsx(zde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}l6.displayName="Background";const c6=E.memo(l6);function Wde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Xde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Mp({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:or(["react-flow__controls-button",t]),...n,children:e})}const Zde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function u6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Rn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Rt(Zde,In),{zoomIn:x,zoomOut:_,fitView:k}=H0(),N=()=>{x(),i==null||i()},T=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs($0,{className:or(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Mp,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Wde,{})}),o.jsx(Mp,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(Gde,{})})]}),n&&o.jsx(Mp,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(qde,{})}),r&&o.jsx(Mp,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Qde,{}):o.jsx(Xde,{})}),d]})}u6.displayName="Controls";const d6=E.memo(u6);function Jde({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:or(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const efe=E.memo(Jde),tfe=e=>e.nodes.map(t=>t.id),Db=e=>e instanceof Function?e:()=>e;function nfe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=efe,onClick:a}){const l=Rt(tfe,In),c=Db(t),u=Db(e),d=Db(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(sfe,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function rfe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Rt(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=_a(w);return{node:w,x:y,y:b,width:x,height:_}},In);return!u||u.hidden||!k_(u)?null:o.jsx(l,{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 sfe=E.memo(rfe);var ife=E.memo(nfe);const afe=200,ofe=150,lfe=e=>!e.hidden,cfe=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?t4(wh(e.nodeLookup,{filter:lfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ufe="react-flow__minimap-desc";function f6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=Rn(),N=E.useRef(null),{boundingRect:T,viewBB:S,rfId:R,panZoom:I,translateExtent:j,flowWidth:F,flowHeight:Y,ariaLabelConfig:L}=Rt(cfe,In),U=(e==null?void 0:e.width)??afe,C=(e==null?void 0:e.height)??ofe,M=T.width/U,O=T.height/C,D=Math.max(M,O),A=D*U,H=D*C,W=_*D,P=T.x-(A-T.width)/2-W,te=T.y-(H-T.height)/2-W,X=A+W*2,ne=H+W*2,ce=`${ufe}-${R}`,J=E.useRef(0),fe=E.useRef();J.current=D,E.useEffect(()=>{if(N.current&&I)return fe.current=fce({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>J.current}),()=>{var xe;(xe=fe.current)==null||xe.destroy()}},[I]),E.useEffect(()=>{var xe;(xe=fe.current)==null||xe.update({translateExtent:j,width:F,height:Y,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,j,F,Y]);const ee=p?xe=>{var Re;const[we,Te]=((Re=fe.current)==null?void 0:Re.pointer(xe))||[0,0];p(xe,{x:we,y:Te})}:void 0,Ee=m?E.useCallback((xe,we)=>{const Te=k.getState().nodeLookup.get(we).internals.userNode;m(xe,Te)},[]):void 0,ge=y??L["minimap.ariaLabel"];return o.jsx($0,{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*D: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:or(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:U,height:C,viewBox:`${P} ${te} ${X} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:N,onClick:ee,children:[ge&&o.jsx("title",{id:ce,children:ge}),o.jsx(ife,{onClick:Ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-W},${te-W}h${X+W*2}v${ne+W*2}h${-X-W*2}z - M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}f6.displayName="MiniMap";const dfe=E.memo(f6),ffe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,hfe={[du.Line]:"right",[du.Handle]:"bottom-right"};function pfe({nodeId:e,position:t,variant:n=du.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=F4(),x=typeof e=="string"?e:b,_=Rn(),k=E.useRef(null),N=n===du.Handle,T=Rt(E.useCallback(ffe(N&&p),[N,p]),In),S=E.useRef(null),R=t??hfe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=Nce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,paneDomNode:C}},onChange:(j,F)=>{const{triggerNodeChanges:Y,nodeLookup:L,parentLookup:U,nodeOrigin:C}=_.getState(),M=[],O={x:j.x,y:j.y},D=L.get(x);if(D&&D.expandParent&&D.parentId){const A=D.origin??C,H=j.width??D.measured.width??0,W=j.height??D.measured.height??0,P={id:D.id,parentId:D.parentId,rect:{width:H,height:W,...r4({x:j.x??D.position.x,y:j.y??D.position.y},{width:H,height:W},D.parentId,L,A)}},te=I_([P],L,U,C);M.push(...te),O.x=j.x?Math.max(A[0]*H,j.x):void 0,O.y=j.y?Math.max(A[1]*W,j.y):void 0}if(O.x!==void 0&&O.y!==void 0){const A={id:x,type:"position",position:{...O}};M.push(A)}if(j.width!==void 0&&j.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};M.push(H)}for(const A of F){const H={...A,type:"position"};M.push(H)}Y(M)},onEnd:({width:j,height:F})=>{const Y={id:x,type:"dimensions",resizing:!1,dimensions:{width:j,height:F}};_.getState().triggerNodeChanges([Y])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var j;(j=S.current)==null||j.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:or(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(pfe);var h6=Object.defineProperty,mfe=(e,t,n)=>t in e?h6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gfe=(e,t)=>{for(var n in t)h6(e,n,{get:t[n],enumerable:!0})},yfe=(e,t,n)=>mfe(e,t+"",n),p6={};gfe(p6,{Graph:()=>qs,alg:()=>L_,json:()=>g6,version:()=>xfe});var bfe=Object.defineProperty,m6=(e,t)=>{for(var n in t)bfe(e,n,{get:t[n],enumerable:!0})},qs=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=Nd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=Efe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,yC(this._preds[i],s),yC(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?Pb(this._isDirected,e):Nd(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?Pb(this._isDirected,e):Nd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Pb(this._isDirected,e):Nd(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],bC(this._preds[a],i),bC(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 yC(e,t){e[t]?e[t]++:e[t]=1}function bC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Nd(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 Efe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function Pb(e,t){return Nd(e,t.v,t.w,t.name)}var xfe="4.0.1",g6={};m6(g6,{read:()=>kfe,write:()=>wfe});function wfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:vfe(e),edges:_fe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function vfe(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 _fe(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 kfe(e){let t=new qs(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 L_={};m6(L_,{CycleException:()=>Cg,bellmanFord:()=>y6,components:()=>Tfe,dijkstra:()=>Ag,dijkstraAll:()=>Ife,findCycles:()=>Rfe,floydWarshall:()=>Lfe,isAcyclic:()=>jfe,postorder:()=>Pfe,preorder:()=>Bfe,prim:()=>Ffe,shortestPaths:()=>Ufe,tarjan:()=>E6,topsort:()=>x6});var Nfe=()=>1;function y6(e,t,n,r){return Sfe(e,String(t),n||Nfe,r||function(s){return e.outEdges(s)})}function Sfe(e,t,n,r){let s={},i,a=0,l=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 Ag(e,t,n,r){let s=function(i){return e.outEdges(i)};return Cfe(e,String(t),n||Afe,r||s)}function Cfe(e,t,n,r){let s={},i=new b6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Ife(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Ag(e,s,t,n),r},{})}function E6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 Rfe(e){return E6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Ofe=()=>1;function Lfe(e,t,n){return Mfe(e,t||Ofe,n||function(r){return e.outEdges(r)})}function Mfe(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=w6(e,l,n==="post",a,i,r,s)}),s}function w6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=w6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function v6(e,t,n){return Dfe(e,t,n,function(r,s){return r.push(s),r},[])}function Pfe(e,t){return v6(e,t,"post")}function Bfe(e,t){return v6(e,t,"pre")}function Ffe(e,t){let n=new qs,r={},s=new b6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function Ufe(e,t,n,r){return $fe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function $fe(e,t,n,r){if(n===void 0)return Ag(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 _6(e){let t=new qs({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 EC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function kh(e){let t=Wf(N6(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 zfe(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=Pi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function Vfe(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Pi(Math.min,t),r=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function xC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),Cu(e,"border",s,t)}function Kfe(e,t=k6){let n=[];for(let r=0;rk6){let n=Kfe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function N6(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Pi(Math.max,t)}function Yfe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function S6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function T6(e,t){return t()}var Wfe=0;function M_(e){let t=++Wfe;return e+(""+t)}function Wf(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 Gfe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var K0="\0",qfe="3.0.0",Xfe=class{constructor(){yfe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return wC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&wC(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,Qfe)),n=n._prev;return"["+e.join(", ")+"]"}};function wC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Qfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Zfe=Xfe,Jfe=()=>1;function ehe(e,t){if(e.nodeCount()<=1)return[];let n=nhe(e,t||Jfe);return the(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function the(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)Bb(e,t,n,l);for(;l=i.dequeue();)Bb(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(Bb(e,t,n,l,!0)||[]);break}}}return s}function Bb(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,vx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,vx(t,n,d)}),e.removeNode(r.v),a}function nhe(e,t){let n=new qs,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=rhe(s+r+3).map(()=>new Zfe),a=r+1;return n.nodes().forEach(l=>{vx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function vx(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 rhe(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,M_("rev"))});function t(n){return r=>n.edge(r).weight}}function ihe(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 ahe(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 ohe(e){e.graph().dummyChains=[],e.edges().forEach(t=>lhe(e,t))}function lhe(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 j_(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):[],l=Pi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function hu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var A6=uhe;function uhe(e){let t=new qs({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(;dhe(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!hu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function fhe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=hu(t,r)),st.node(r).rank+=n)}var{preorder:phe,postorder:mhe}=L_,ghe=Sl;Sl.initLowLimValues=P_;Sl.initCutValues=D_;Sl.calcCutValue=C6;Sl.leaveEdge=R6;Sl.enterEdge=O6;Sl.exchangeEdges=L6;function Sl(e){e=Hfe(e),j_(e);let t=A6(e);P_(t),D_(t,e);let n,r;for(;n=R6(t);)r=O6(t,e,n),L6(t,e,n,r)}function D_(e,t){let n=mhe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>yhe(e,t,r))}function yhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=C6(e,t,n)}function C6(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 l=t.nodeEdges(n);return l&&l.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,Ehe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function P_(e,t){arguments.length<2&&(t=e.nodes()[0]),I6(e,{},1,t)}function I6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=I6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function R6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function O6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===vC(e,e.node(u.v),l)&&c!==vC(e,e.node(u.w),l)).reduce((u,d)=>hu(t,d)!e.node(s).parent);if(!n)return;let r=phe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function Ehe(e,t,n){return e.hasEdge(t,n)}function vC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var xhe=whe;function whe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":_C(e);break;case"tight-tree":_he(e);break;case"longest-path":vhe(e);break;case"none":break;default:_C(e)}}var vhe=j_;function _he(e){j_(e),A6(e)}function _C(e){ghe(e)}var khe=Nhe;function Nhe(e){let t=The(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=She(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 The(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(K0).forEach(r),t}function Ahe(e){let t=Cu(e,"root",{},"_root"),n=Che(e),r=Object.values(n),s=Pi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=Ihe(e)+1;e.children(K0).forEach(l=>M6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function M6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=xC(e,"_bt"),d=xC(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;M6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function Che(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(K0).forEach(r=>n(r,1)),t}function Ihe(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Rhe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Ohe=Lhe;function Lhe(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;iNC(e.node(t))),e.edges().forEach(t=>NC(e.edge(t)))}function NC(e){let t=e.width;e.width=e.height,e.height=t}function Dhe(e){e.nodes().forEach(t=>Fb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Fb),Object.hasOwn(r,"y")&&Fb(r)})}function Fb(e){e.y=-e.y}function Phe(e){e.nodes().forEach(t=>Ub(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Ub),Object.hasOwn(r,"x")&&Ub(r)})}function Ub(e){let t=e.x;e.x=e.y,e.y=t}function Bhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Pi(Math.max,r),i=Wf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function Fhe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function $he(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function Hhe(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 zhe(r)}function zhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Vhe(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=>Ig(s,["vs","i","barycenter","weight"]))}function Vhe(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 Khe(e,t){let n=Yfe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Yhe(!!t)),c=SC(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=SC(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function SC(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 Yhe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function D6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=$he(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=D6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&Ghe(h,p)}});let d=Hhe(u,n);Whe(d,c);let f=Khe(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function Whe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function Ghe(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 qhe(e,t,n,r){r||(r=e.nodes());let s=Xhe(e),i=new qs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function Xhe(e){let t;for(;e.hasNode(t=M_("_root")););return t}function Qhe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function P6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,P6);return}let n=N6(e),r=TC(e,Wf(1,n+1),"inEdges"),s=TC(e,Wf(n-1,-1,-1),"outEdges"),i=Bhe(e);if(AC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Zhe(u%2?r:s,u%4>=2,c),i=kh(e);let f=Fhe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return qhe(e,i,n,r.get(i)||[])})}function Zhe(e,t,n){let r=new qs;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=D6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Qhe(s,r,a.vs)})}function AC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function Jhe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=tpe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&B6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function tpe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function B6(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 npe(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 rpe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function ipe(e,t,n,r){let s=new qs,i=e.graph(),a=upe(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 ape(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=dpe(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=r-Pi(Math.min,u);a!=="l"&&(d=s-Pi(Math.max,u)),d&&(e[l]=V0(c,f=>f+d))})})}function lpe(e,t=void 0){let n=e.ul;return n?V0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function cpe(e){let t=kh(e),n=Object.assign(Jhe(e,t),epe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=rpe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=spe(e,s,c.root,c.align,l==="r");l==="r"&&(u=V0(u,d=>-d)),r[a+l]=u})});let i=ape(e,r);return ope(r,i),lpe(r,e.graph().align)}function upe(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function dpe(e,t){return e.node(t).width}function fpe(e){e=_6(e),hpe(e),Object.entries(cpe(e)).forEach(([t,n])=>e.node(t).x=n)}function hpe(e){let t=kh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function ppe(e,t={}){let n=t.debugTiming?S6:T6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>kpe(e));return n(" runLayout",()=>mpe(r,n,t)),n(" updateInputGraph",()=>gpe(e,r)),r})}function mpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>Npe(e)),t(" removeSelfEdges",()=>Mpe(e)),t(" acyclic",()=>she(e)),t(" nestingGraph.run",()=>Ahe(e)),t(" rank",()=>xhe(_6(e))),t(" injectEdgeLabelProxies",()=>Spe(e)),t(" removeEmptyRanks",()=>Vfe(e)),t(" nestingGraph.cleanup",()=>Rhe(e)),t(" normalizeRanks",()=>zfe(e)),t(" assignRankMinMax",()=>Tpe(e)),t(" removeEdgeLabelProxies",()=>Ape(e)),t(" normalize.run",()=>ohe(e)),t(" parentDummyChains",()=>khe(e)),t(" addBorderSegments",()=>Ohe(e)),t(" order",()=>P6(e,n)),t(" insertSelfEdges",()=>jpe(e)),t(" adjustCoordinateSystem",()=>Mhe(e)),t(" position",()=>fpe(e)),t(" positionSelfEdges",()=>Dpe(e)),t(" removeBorderNodes",()=>Lpe(e)),t(" normalize.undo",()=>che(e)),t(" fixupEdgeLabelCoords",()=>Rpe(e)),t(" undoCoordinateSystem",()=>jhe(e)),t(" translateGraph",()=>Cpe(e)),t(" assignNodeIntersects",()=>Ipe(e)),t(" reversePoints",()=>Ope(e)),t(" acyclic.undo",()=>ahe(e))}function gpe(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 ype=["nodesep","edgesep","ranksep","marginx","marginy"],bpe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Epe=["acyclicer","ranker","rankdir","align","rankalign"],xpe=["width","height","rank"],CC={width:0,height:0},wpe=["minlen","weight","width","height","labeloffset"],vpe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_pe=["labelpos"];function kpe(e){let t=new qs({multigraph:!0,compound:!0}),n=Hb(e.graph());return t.setGraph(Object.assign({},bpe,$b(n,ype),Ig(n,Epe))),e.nodes().forEach(r=>{let s=Hb(e.node(r)),i=$b(s,xpe);Object.keys(CC).forEach(l=>{i[l]===void 0&&(i[l]=CC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Hb(e.edge(r));t.setEdge(r,Object.assign({},vpe,$b(s,wpe),Ig(s,_pe)))}),t}function Npe(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 Spe(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};Cu(e,"edge-proxy",s,"_ep")}})}function Tpe(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 Ape(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 Cpe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function Ipe(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(EC(r,i)),n.points.push(EC(s,a))})}function Rpe(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 Ope(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Lpe(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 Mpe(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 jpe(e){kh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{Cu(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 Dpe(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function $b(e,t){return V0(Ig(e,t),Number)}function Hb(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Ppe(e){let t=kh(e),n=new qs({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Bpe={graphlib:p6,version:qfe,layout:ppe,debug:Ppe,util:{time:S6,notime:T6}},IC=Bpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const Sd={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:cl},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:LM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:NM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:kv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:h0}},_x=220,kx=88,RC=96,OC=34,tf=64,zb=310,gc=24,F6=56,Nx=40,LC=40,Fpe=18,Upe=58,$pe=!1,Hpe=e=>e==="sequential"||e==="parallel"||e==="loop";function Sx(e,t){const n=e.agentType??"llm";return Hpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Tx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!Sx(e,t))return{width:_x,height:kx};if(r&&e.subAgents.length===0)return{width:zb,height:tf};const i=e.subAgents.map((f,h)=>Tx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?F6:gc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?Fpe+LC:s==="loop"?Upe:0:LC;return u?{width:Math.max(zb,i.reduce((f,h)=>f+h.width,0)+Nx*Math.max(0,i.length-1)+c*2),height:tf+gc+l+d+gc}:{width:Math.max(zb,a+gc*2),height:tf+c+i.reduce((f,h)=>f+h.height,0)+Nx*Math.max(0,i.length-1)+d+c}}function ld(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function zpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function MC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function cd(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:ou.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 jC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=ld(f);return Sx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=ld(f),y=Tx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":Sd[g].label),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((T,S)=>Tx(T,[...f,S],t,n)),x=b.length&&g!=="parallel"?F6:gc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((T,S)=>{const R=b[S],I=_?{x:k,y:tf+gc}:{x:(y.width-R.width)/2,y:tf+k};return k+=(_?R.width:R.height)+Nx,i(T,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let T=0;T1&&s.push(cd(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=ld(f);if(Sx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||Sd[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=ld(y);s.push(cd(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=ld([]),u=l(e,[]);return s.push(cd("terminal-input",c)),u.forEach(d=>s.push(cd(d,"terminal-output"))),Vpe(r,s,t)}function Vpe(e,t,n){const r=new IC.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?RC:i.data.layoutWidth??_x,height:a?OC:i.data.layoutHeight??kx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),IC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?RC:i.data.layoutWidth??_x,u=l?OC:i.data.layoutHeight??kx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const Y0=E.createContext(null),W0=E.createContext("horizontal");function Kpe({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(Y0),[h,p]=E.useState(!1),[m,g,w]=Sg({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(_h,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Ude,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(kr,{})})]})})]})}function Ype({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"llm",c=Sd[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Wpe({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(kr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(kr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(kr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(kr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Gpe({data:e}){const t=E.useContext(W0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Dr,{type:"target",position:t==="vertical"?He.Top:He.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Dr,{type:"source",position:t==="vertical"?He.Bottom:He.Right,className:"abc-handle"})]})}const qpe={agent:Ype,group:Wpe,terminal:Gpe},Xpe={insertStep:Kpe};function Qpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>jC(e,c,a),[]),[d,f,h]=a6(u.nodes),[p,m,g]=o6(u.edges),w=Hde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${MC(e)}`),b=E.useRef(null),{fitView:x}=H0(),_=E.useMemo(()=>jC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(T))})},[T,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),j=F=>N(F.matches);return I.addEventListener("change",j),()=>I.removeEventListener("change",j)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${MC(e)}`,j=I!==y.current;y.current=I,m(_.edges),f(F=>{const Y=new Map(F.map(L=>[L.id,L.position]));return _.nodes.map(L=>({...L,position:!j&&Y.get(L.id)?Y.get(L.id):L.position,selected:L.data.kind==="agent"&&!!L.data.path&&zpe(L.data.path,t)}))}),j&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(W0.Provider,{value:c,children:o.jsx(Y0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(i6,{nodes:d,edges:p,nodeTypes:qpe,edgeTypes:Xpe,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,j)=>{!a&&j.data.kind==="agent"&&j.data.path&&n(j.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(d6,{showInteractive:!1}),$pe]})})})})})}function Rg(e){return o.jsx(O_,{children:o.jsx(Qpe,{...e})})}const Zpe="doubao-seed-2-1-pro-260628",Jpe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",eme=`你是一个专业、可靠的智能助手。 +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return E.useEffect(()=>{const c=(t==null?void 0:t.target)??JA,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,y;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!u)&&i4(p))return!1;const g=tC(p.code,l);if(i.current.add(p[g]),eC(a,i.current,!1)){const b=((y=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:y[0])||p.target,x=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(s.current||!x)&&p.preventDefault(),r(!0)}},f=p=>{const m=tC(p.code,l);eC(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 eC(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function tC(e,t){return t.includes(e)?"code":"key"}const yue=()=>{const e=Rn();return E.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:l}=e.getState(),c=__(t,r,s,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.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:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??s,f=n.snapToGrid??i;return Cu(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=du(t,n);return{x:a.x+s,y:a.y+i}}}),[])};function R4(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 l={...i};for(const c of a)bue(c,l);n.push(l)}return s.length&&s.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function bue(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 O4(e,t){return R4(e,t)}function L4(e,t){return R4(e,t)}function Po(e,t){return{id:e,type:"select",selected:t}}function gc(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(Po(i.id,a)))}return r}function nC({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 l=t.get(a.id),c=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;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 rC(e){return{id:e.id,type:"remove"}}const Eue=n4();function M4(e,t,n={}){return Kle(e,t,{...n,onError:n.onError??Eue})}const sC=e=>Ile(e),xue=e=>ZP(e);function j4(e){return E.forwardRef(e)}const wue=typeof window<"u"?E.useLayoutEffect:E.useEffect;function iC(e){const[t,n]=E.useState(BigInt(0)),[r]=E.useState(()=>vue(()=>n(s=>s+BigInt(1))));return wue(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function vue(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const D4=E.createContext(null);function _ue({children:e}){const t=Rn(),n=E.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let g=c;for(const y of l)g=typeof y=="function"?y(g):y;let w=nC({items:g,lookup:h});for(const y of m.values())w=y(w);d&&u(g),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:b,setNodes:x}=t.getState();y&&x(b)})},[]),r=iC(n),s=E.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(nC({items:p,lookup:h}))},[]),i=iC(s),a=E.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return o.jsx(D4.Provider,{value:a,children:e})}function kue(){const e=E.useContext(D4);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Nue=e=>!!e.panZoom;function H0(){const e=yue(),t=Rn(),n=kue(),r=Rt(Nue),s=E.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,b;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=sC(f)?f:h.get(f.id),g=m.parentId?r4(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:g,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((b=m.measured)==null?void 0:b.height)??m.height};return uu(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&sC(w)?w:{...g,...w}}return g}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(g=>{if(g.id===f){const w=typeof h=="function"?h(g):h;return p.replace&&xue(w)?w:{...g,...w}}return g}))};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:l,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,g,w]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:g,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:g,onEdgesDelete:w,triggerNodeChanges:y,triggerEdgeChanges:b,onDelete:x,onBeforeDelete:_}=t.getState(),{nodes:k,edges:N}=await jle({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:_}),T=N.length>0,S=k.length>0;if(T){const R=N.map(rC);w==null||w(N),b(R)}if(S){const R=k.map(rC);g==null||g(k),y(R)}return(S||T)&&(x==null||x({nodes:k,edges:N})),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(f,h=!0,p)=>{const m=MA(f),g=m?f:c(f),w=p!==void 0;return g?(p||t.getState().nodes).filter(y=>{const b=t.getState().nodeLookup.get(y.id);if(b&&!m&&(y.id===f.id||!b.internals.positionAbsolute))return!1;const x=uu(w?y:b),_=Vf(x,g);return h&&_>0||_>=x.width*x.height||_>=g.width*g.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const g=MA(f)?f:c(f);if(!g)return!1;const w=Vf(g,h);return p&&w>0||w>=h.width*h.height||w>=g.width*g.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const g=typeof h=="function"?h(m):h;return p.replace?{...m,data:g}:{...m,data:{...m.data,...g}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Rle(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??Ble();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return E.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const aC=e=>e.selected,Sue=typeof window<"u"?window:void 0;function Tue({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Rn(),{deleteElements:r}=H0(),s=Yf(e,{actInsideInputWithModifier:!1}),i=Yf(t,{target:Sue});E.useEffect(()=>{if(s){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(aC),edges:a.filter(aC)}),n.setState({nodesSelectionActive:!1})}},[s]),E.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Aue(e){const t=Rn();E.useEffect(()=>{const n=()=>{var s,i,a,l;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=N_(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",vi.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 z0={position:"absolute",width:"100%",height:"100%",top:0,left:0},Cue=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Iue({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=rl.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:_}){const k=Rn(),N=E.useRef(null),{userSelectionActive:T,lib:S,connectionInProgress:R}=Rt(Cue,In),I=Yf(h),j=E.useRef();Aue(N);const F=E.useCallback(Y=>{y==null||y({x:Y[0],y:Y[1],zoom:Y[2]}),b||k.setState({transform:Y})},[y,b]);return E.useEffect(()=>{if(N.current){j.current=wce({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>k.setState(M=>M.paneDragging===C?M:{paneDragging:C}),onPanZoomStart:(C,M)=>{const{onViewportChangeStart:O,onMoveStart:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoom:(C,M)=>{const{onViewportChange:O,onMove:D}=k.getState();D==null||D(C,M),O==null||O(M)},onPanZoomEnd:(C,M)=>{const{onViewportChangeEnd:O,onMoveEnd:D}=k.getState();D==null||D(C,M),O==null||O(M)}});const{x:Y,y:L,zoom:U}=j.current.getViewport();return k.setState({panZoom:j.current,transform:[Y,L,U],domNode:N.current.closest(".react-flow")}),()=>{var C;(C=j.current)==null||C.destroy()}}},[]),E.useEffect(()=>{var Y;(Y=j.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:w,userSelectionActive:T,noWheelClassName:g,lib:S,onTransformChange:F,connectionInProgress:R,selectionOnDrag:_,paneClickDistance:x})},[e,t,n,r,s,i,a,l,I,p,w,T,g,S,F,R,_,x]),o.jsx("div",{className:"react-flow__renderer",ref:N,style:z0,children:m})}const Rue=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Oue(){const{userSelectionActive:e,userSelectionRect:t}=Rt(Rue,In);return e&&t?o.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 jb=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Lue=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Mue({isSelecting:e,selectionKeyPressed:t,selectionMode:n=zf.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:g}){const w=E.useRef(0),y=Rn(),{userSelectionActive:b,elementsSelectable:x,dragging:_,connectionInProgress:k,panBy:N,autoPanSpeed:T}=Rt(Lue,In),S=x&&(e||b),R=E.useRef(null),I=E.useRef(),j=E.useRef(new Set),F=E.useRef(new Set),Y=E.useRef(!1),L=E.useRef({x:0,y:0}),U=E.useRef(!1),C=J=>{if(Y.current||k){Y.current=!1;return}u==null||u(J),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},M=J=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){J.preventDefault();return}d==null||d(J)},O=f?J=>f(J):void 0,D=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},A=J=>{var Ye,Le;const{domNode:fe,transform:ee}=y.getState();if(I.current=fe==null?void 0:fe.getBoundingClientRect(),!I.current)return;const Ee=J.target===R.current;if(!Ee&&!!J.target.closest(".nokey")||!e||!(a&&Ee||t)||J.button!==0||!J.isPrimary)return;(Le=(Ye=J.target)==null?void 0:Ye.setPointerCapture)==null||Le.call(Ye,J.pointerId),Y.current=!1;const{x:we,y:Ae}=mi(J.nativeEvent,I.current),Re=Cu({x:we,y:Ae},ee);y.setState({userSelectionRect:{width:0,height:0,startX:Re.x,startY:Re.y,x:we,y:Ae}}),Ee||(J.stopPropagation(),J.preventDefault())};function H(J,fe){const{userSelectionRect:ee}=y.getState();if(!ee)return;const{transform:Ee,nodeLookup:ge,edgeLookup:xe,connectionLookup:we,triggerNodeChanges:Ae,triggerEdgeChanges:Re,defaultEdgeOptions:Ye}=y.getState(),Le={x:ee.startX,y:ee.startY},{x:bt,y:Ze}=du(Le,Ee),ze={startX:Le.x,startY:Le.y,x:Jht.id)),F.current=new Set;const ct=(Ye==null?void 0:Ye.selectable)??!0;for(const ht of j.current){const G=we.get(ht);if(G)for(const{edgeId:Z}of G.values()){const he=xe.get(Z);he&&(he.selectable??ct)&&F.current.add(Z)}}if(!jA(le,j.current)){const ht=gc(ge,j.current,!0);Ae(ht)}if(!jA(ve,F.current)){const ht=gc(xe,F.current);Re(ht)}y.setState({userSelectionRect:ze,userSelectionActive:!0,nodesSelectionActive:!1})}function W(){if(!s||!I.current)return;const[J,fe]=v_(L.current,I.current,T);N({x:J,y:fe}).then(ee=>{if(!Y.current||!ee){w.current=requestAnimationFrame(W);return}const{x:Ee,y:ge}=L.current;H(Ee,ge),w.current=requestAnimationFrame(W)})}const P=()=>{cancelAnimationFrame(w.current),w.current=0,U.current=!1};E.useEffect(()=>()=>P(),[]);const te=J=>{const{userSelectionRect:fe,transform:ee,resetSelectedElements:Ee}=y.getState();if(!I.current||!fe)return;const{x:ge,y:xe}=mi(J.nativeEvent,I.current);L.current={x:ge,y:xe};const we=du({x:fe.startX,y:fe.startY},ee);if(!Y.current){const Ae=t?0:i;if(Math.hypot(ge-we.x,xe-we.y)<=Ae)return;Ee(),l==null||l(J)}Y.current=!0,U.current||(W(),U.current=!0),H(ge,xe)},X=J=>{var fe,ee;J.button===0&&((ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),!b&&J.target===R.current&&y.getState().userSelectionRect&&(C==null||C(J)),y.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(c==null||c(J),y.setState({nodesSelectionActive:j.current.size>0})),P())},ne=J=>{var fe,ee;(ee=(fe=J.target)==null?void 0:fe.releasePointerCapture)==null||ee.call(fe,J.pointerId),P()},ce=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:or(["react-flow__pane",{draggable:ce,dragging:_,selection:e}]),onClick:S?void 0:jb(C,R),onContextMenu:jb(M,R),onWheel:jb(O,R),onPointerEnter:S?void 0:h,onPointerMove:S?te:p,onPointerUp:S?X:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?A:void 0,onClickCapture:S?D:void 0,onPointerLeave:m,ref:R,style:z0,children:[g,o.jsx(Oue,{})]})}function wx({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",vi.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 P4({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const l=Rn(),[c,u]=E.useState(!1),d=E.useRef();return E.useEffect(()=>{d.current=oce({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{wx({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),E.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 jue=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function B4(){const e=Rn();return E.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=jue(a),p=s?i[0]:5,m=s?i[1]:5,g=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let b={x:y.internals.positionAbsolute.x+g,y:y.internals.positionAbsolute.y+w};s&&(b=vh(b,i));const{position:x,positionAbsolute:_}=JP({nodeId:y.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=_,f.set(y.id,y)}c(f)},[])}const R_=E.createContext(null),Due=R_.Provider;R_.Consumer;const F4=()=>E.useContext(R_),Pue=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Bue=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:l,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:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.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===ou.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:d&&u}};function Fue({type:e="source",position:t=He.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var U,C;const m=a||null,g=e==="target",w=Rn(),y=F4(),{connectOnClick:b,noPanClassName:x,rfId:_}=Rt(Pue,In),{connectingFrom:k,connectingTo:N,clickConnecting:T,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:j}=Rt(Bue(y,m,e),In);y||(C=(U=w.getState()).onError)==null||C.call(U,"010",vi.error010());const F=M=>{const{defaultEdgeOptions:O,onConnect:D,hasDefaultEdges:A}=w.getState(),H={...O,...M};if(A){const{edges:W,setEdges:P,onError:te}=w.getState();P(M4(H,W,{onError:te}))}D==null||D(H),l==null||l(H)},Y=M=>{if(!y)return;const O=a4(M.nativeEvent);if(s&&(O&&M.button===0||!O)){const D=w.getState();xx.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:g,handleId:m,nodeId:y,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:(...A)=>{var H,W;return(W=(H=w.getState()).onConnectEnd)==null?void 0:W.call(H,...A)},updateConnection:D.updateConnection,onConnect:F,isValidConnection:n||((...A)=>{var H,W;return((W=(H=w.getState()).isValidConnection)==null?void 0:W.call(H,...A))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}O?d==null||d(M):f==null||f(M)},L=M=>{const{onClickConnectStart:O,onClickConnectEnd:D,connectionClickStartHandle:A,connectionMode:H,isValidConnection:W,lib:P,rfId:te,nodeLookup:X,connection:ne}=w.getState();if(!y||!A&&!s)return;if(!A){O==null||O(M.nativeEvent,{nodeId:y,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const ce=s4(M.target),J=n||W,{connection:fe,isValid:ee}=xx.isValid(M.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:H,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:J,flowId:te,doc:ce,lib:P,nodeLookup:X});ee&&fe&&F(fe);const Ee=structuredClone(ne);delete Ee.inProgress,Ee.toPosition=Ee.toHandle?Ee.toHandle.position:null,D==null||D(M,Ee),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${m}-${e}`,className:or(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!g,target:g,connectable:r,connectablestart:s,connectableend:i,clickconnecting:T,connectingfrom:k,connectingto:N,valid:j,connectionindicator:r&&(!R||S)&&(R||I?i:s)}]),onMouseDown:Y,onTouchStart:Y,onClick:b?L:void 0,ref:p,...h,children:c})}const Dr=E.memo(j4(Fue));function Uue({data:e,isConnectable:t,sourcePosition:n=He.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:n,isConnectable:t})]})}function $ue({data:e,isConnectable:t,targetPosition:n=He.Top,sourcePosition:r=He.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Dr,{type:"source",position:r,isConnectable:t})]})}function Hue(){return null}function zue({data:e,isConnectable:t,targetPosition:n=He.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Dr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Tg={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oC={input:Uue,default:$ue,output:zue,group:Hue};function Vue(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 Kue=e=>{const{width:t,height:n,x:r,y:s}=wh(e.nodeLookup,{filter:i=>!!i.selected});return{width:pi(t)?t:null,height:pi(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 Yue({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Rn(),{width:s,height:i,transformString:a,userSelectionActive:l}=Rt(Kue,In),c=B4(),u=E.useRef(null);E.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&s!==null&&i!==null;if(P4({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(g=>g.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Tg,p.key)&&(p.preventDefault(),c({direction:Tg[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:or(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.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 lC=typeof window<"u"?window:void 0,Wue=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function U4({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,preventScrolling:L,onSelectionContextMenu:U,noWheelClassName:C,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:D,isControlledViewport:A}){const{nodesSelectionActive:H,userSelectionActive:W}=Rt(Wue,In),P=Yf(u,{target:lC}),te=Yf(g,{target:lC}),X=te||S,ne=te||_,ce=d&&X!==!0,J=P||W||ce;return Tue({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(Iue,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:x,panOnScroll:ne,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:T,panOnDrag:!P&&X,defaultViewport:I,translateExtent:j,minZoom:F,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:L,noWheelClassName:C,noPanClassName:M,onViewportChange:D,isControlledViewport:A,paneClickDistance:l,selectionOnDrag:ce,children:o.jsxs(Mue,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:X,autoPanOnSelection:R,isSelecting:!!J,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:ce,children:[e,H&&o.jsx(Yue,{onSelectionContextMenu:U,noPanClassName:M,disableKeyboardA11y:O})]})})}U4.displayName="FlowRenderer";const Gue=E.memo(U4),que=e=>t=>e?w_(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 Xue(e){return Rt(E.useCallback(que(e),[e]),In)}const Que=e=>e.updateNodeInternals;function Zue(){const e=Rt(Que),[t]=E.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 E.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Jue({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=Rn(),i=E.useRef(null),a=E.useRef(null),l=E.useRef(e.sourcePosition),c=E.useRef(e.targetPosition),u=E.useRef(t),d=n&&!!e.internals.handleBounds;return E.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]),E.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),E.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.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 ede({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:x,internals:_,isParent:k}=Rt(J=>{const fe=J.nodeLookup.get(e),ee=J.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:ee}},In);let N=x.type||"default",T=(w==null?void 0:w[N])||oC[N];T===void 0&&(b==null||b("003",vi.error003(N)),N="default",T=(w==null?void 0:w.default)||oC.default);const S=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),I=!!(x.connectable||u&&typeof x.connectable>"u"),j=!!(x.focusable||d&&typeof x.focusable>"u"),F=Rn(),Y=k_(x),L=Jue({node:x,nodeType:N,hasDimensions:Y,resizeObserver:f}),U=P4({nodeRef:L,disabled:x.hidden||!S,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),C=B4();if(x.hidden)return null;const M=_a(x),O=Vue(x),D=R||S||t||n||r||s,A=n?J=>n(J,{..._.userNode}):void 0,H=r?J=>r(J,{..._.userNode}):void 0,W=s?J=>s(J,{..._.userNode}):void 0,P=i?J=>i(J,{..._.userNode}):void 0,te=a?J=>a(J,{..._.userNode}):void 0,X=J=>{const{selectNodesOnDrag:fe,nodeDragThreshold:ee}=F.getState();R&&(!fe||!S||ee>0)&&wx({id:e,store:F,nodeRef:L}),t&&t(J,{..._.userNode})},ne=J=>{if(!(i4(J.nativeEvent)||m)){if(GP.includes(J.key)&&R){const fe=J.key==="Escape";wx({id:e,store:F,unselect:fe,nodeRef:L})}else if(S&&x.selected&&Object.prototype.hasOwnProperty.call(Tg,J.key)){J.preventDefault();const{ariaLabelConfig:fe}=F.getState();F.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),C({direction:Tg[J.key],factor:J.shiftKey?4:1})}}},ce=()=>{var we;if(m||!((we=L.current)!=null&&we.matches(":focus-visible")))return;const{transform:J,width:fe,height:ee,autoPanOnNodeFocus:Ee,setCenter:ge}=F.getState();if(!Ee)return;w_(new Map([[e,x]]),{x:0,y:0,width:fe,height:ee},J,!0).length>0||ge(x.position.x+M.width/2,x.position.y+M.height/2,{zoom:J[2]})};return o.jsx("div",{className:or(["react-flow__node",`react-flow__node-${N}`,{[p]:S},x.className,{selected:x.selected,selectable:R,parent:k,draggable:S,dragging:U}]),ref:L,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:Y?"visible":"hidden",...x.style,...O},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:H,onMouseLeave:W,onContextMenu:P,onClick:X,onDoubleClick:te,onKeyDown:j?ne:void 0,tabIndex:j?0:void 0,onFocus:j?ce:void 0,role:x.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${A4}-${g}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(Due,{value:e,children:o.jsx(T,{id:e,data:x.data,type:N,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:S,deletable:x.deletable??!0,isConnectable:I,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:U,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...M})})})}var tde=E.memo(ede);const nde=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $4(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:i}=Rt(nde,In),a=Xue(e.onlyRenderVisibleElements),l=Zue();return o.jsx("div",{className:"react-flow__nodes",style:z0,children:a.map(c=>o.jsx(tde,{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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}$4.displayName="NodeRenderer";const rde=E.memo($4);function sde(e){return Rt(E.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&&Hle({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),In)}const ide=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ade=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cC={[lu.Arrow]:ide,[lu.ArrowClosed]:ade};function ode(e){const t=Rn();return E.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(cC,e)?cC[e]:((i=(s=t.getState()).onError)==null||i.call(s,"009",vi.error009(e)),null)},[e])}const lde=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=ode(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},H4=({defaultColor:e,rfId:t})=>{const n=Rt(i=>i.edges),r=Rt(i=>i.defaultEdgeOptions),s=E.useMemo(()=>Xle(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?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:s.map(i=>o.jsx(lde,{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};H4.displayName="MarkerDefinitions";var cde=E.memo(H4);function z4({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=E.useState({x:1,y:0,width:0,height:0}),p=or(["react-flow__edge-textwrapper",u]),m=E.useRef(null);return E.useEffect(()=>{if(m.current){const g=m.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[s&&o.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:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),c]}):null}z4.displayName="EdgeText";const ude=E.memo(z4);function _h({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:or(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&pi(t)&&pi(n)?o.jsx(ude,{x:t,y:n,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function uC({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===He.Left||e===He.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function V4({sourceX:e,sourceY:t,sourcePosition:n=He.Bottom,targetX:r,targetY:s,targetPosition:i=He.Top}){const[a,l]=uC({pos:n,x1:e,y1:t,x2:r,y2:s}),[c,u]=uC({pos:i,x1:r,y1:s,x2:e,y2:t}),[d,f,h,p]=o4({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${s}`,d,f,h,p]}function K4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})=>{const[b,x,_]=V4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return o.jsx(_h,{id:k,path:b,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:y})})}const dde=K4({isInternal:!1}),Y4=K4({isInternal:!0});dde.displayName="SimpleBezierEdge";Y4.displayName="SimpleBezierEdgeInternal";function W4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=He.Bottom,targetPosition:m=He.Top,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=Sg({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:i,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:b})})}const G4=W4({isInternal:!1}),q4=W4({isInternal:!0});G4.displayName="SmoothStepEdge";q4.displayName="SmoothStepEdgeInternal";function X4(e){return E.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return o.jsx(G4,{...n,id:r,pathOptions:E.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const fde=X4({isInternal:!1}),Q4=X4({isInternal:!0});fde.displayName="StepEdge";Q4.displayName="StepEdgeInternal";function Z4(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})=>{const[w,y,b]=u4({sourceX:n,sourceY:r,targetX:s,targetY:i}),x=e.isInternal?void 0:t;return o.jsx(_h,{id:x,path:w,labelX:y,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:g})})}const hde=Z4({isInternal:!1}),J4=Z4({isInternal:!0});hde.displayName="StraightEdge";J4.displayName="StraightEdgeInternal";function e6(e){return E.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:i,sourcePosition:a=He.Bottom,targetPosition:l=He.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,pathOptions:y,interactionWidth:b})=>{const[x,_,k]=l4({sourceX:n,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:l,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return o.jsx(_h,{id:N,path:x,labelX:_,labelY:k,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:g,markerStart:w,interactionWidth:b})})}const pde=e6({isInternal:!1}),t6=e6({isInternal:!0});pde.displayName="BezierEdge";t6.displayName="BezierEdgeInternal";const dC={default:t6,straight:J4,step:Q4,smoothstep:q4,simplebezier:Y4},fC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},mde=(e,t,n)=>n===He.Left?e-t:n===He.Right?e+t:e,gde=(e,t,n)=>n===He.Top?e-t:n===He.Bottom?e+t:e,hC="react-flow__edgeupdater";function pC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:or([hC,`${hC}-${l}`]),cx:mde(t,r,e),cy:gde(n,r,e),r,stroke:"transparent",fill:"transparent"})}function yde({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Rn(),g=(_,k)=>{if(_.button!==0)return;const{autoPanOnConnect:N,domNode:T,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:j,cancelConnection:F,nodeLookup:Y,rfId:L,panBy:U,updateConnection:C}=m.getState(),M=k.type==="target",O=(H,W)=>{h(!1),f==null||f(H,n,k.type,W)},D=H=>u==null?void 0:u(n,H),A=(H,W)=>{h(!0),d==null||d(_,n,k.type),j==null||j(H,W)};xx.onPointerDown(_.nativeEvent,{autoPanOnConnect:N,connectionMode:S,connectionRadius:R,domNode:T,handleId:k.id,nodeId:k.nodeId,nodeLookup:Y,isTarget:M,edgeUpdaterType:k.type,lib:I,flowId:L,cancelConnection:F,panBy:U,isValidConnection:(...H)=>{var W,P;return((P=(W=m.getState()).isValidConnection)==null?void 0:P.call(W,...H))??!0},onConnect:D,onConnectStart:A,onConnectEnd:(...H)=>{var W,P;return(P=(W=m.getState()).onConnectEnd)==null?void 0:P.call(W,...H)},onReconnectEnd:O,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},w=_=>g(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>g(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>p(!0),x=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(pC,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(pC,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:y,onMouseEnter:b,onMouseOut:x,type:"target"})]})}function bde({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let x=Rt(ge=>ge.edgeLookup.get(e));const _=Rt(ge=>ge.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",N=(g==null?void 0:g[k])||dC[k];N===void 0&&(y==null||y("011",vi.error011(k)),k="default",N=(g==null?void 0:g.default)||dC.default);const T=!!(x.focusable||t&&typeof x.focusable>"u"),S=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||r&&typeof x.selectable>"u"),I=E.useRef(null),[j,F]=E.useState(!1),[Y,L]=E.useState(!1),U=Rn(),{zIndex:C,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W}=Rt(E.useCallback(ge=>{const xe=ge.nodeLookup.get(x.source),we=ge.nodeLookup.get(x.target);if(!xe||!we)return{zIndex:x.zIndex,...fC};const Ae=qle({id:e,sourceNode:xe,targetNode:we,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:y});return{zIndex:$le({selected:x.selected,zIndex:x.zIndex,sourceNode:xe,targetNode:we,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Ae||fC}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),In),P=E.useMemo(()=>x.markerStart?`url('#${bx(x.markerStart,m)}')`:void 0,[x.markerStart,m]),te=E.useMemo(()=>x.markerEnd?`url('#${bx(x.markerEnd,m)}')`:void 0,[x.markerEnd,m]);if(x.hidden||M===null||O===null||D===null||A===null)return null;const X=ge=>{var Re;const{addSelectedEdges:xe,unselectNodesAndEdges:we,multiSelectionActive:Ae}=U.getState();R&&(U.setState({nodesSelectionActive:!1}),x.selected&&Ae?(we({nodes:[],edges:[x]}),(Re=I.current)==null||Re.blur()):xe([e])),s&&s(ge,x)},ne=i?ge=>{i(ge,{...x})}:void 0,ce=a?ge=>{a(ge,{...x})}:void 0,J=l?ge=>{l(ge,{...x})}:void 0,fe=c?ge=>{c(ge,{...x})}:void 0,ee=u?ge=>{u(ge,{...x})}:void 0,Ee=ge=>{var xe;if(!b&&GP.includes(ge.key)&&R){const{unselectNodesAndEdges:we,addSelectedEdges:Ae}=U.getState();ge.key==="Escape"?((xe=I.current)==null||xe.blur(),we({edges:[x]})):Ae([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:or(["react-flow__edge",`react-flow__edge-${k}`,x.className,w,{selected:x.selected,animated:x.animated,inactive:!R&&!s,updating:j,selectable:R}]),onClick:X,onDoubleClick:ne,onContextMenu:ce,onMouseEnter:J,onMouseMove:fe,onMouseLeave:ee,onKeyDown:T?Ee:void 0,tabIndex:T?0:void 0,role:x.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":T?`${C4}-${m}`:void 0,ref:I,...x.domAttributes,children:[!Y&&o.jsx(N,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:P,markerEnd:te,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),S&&o.jsx(yde,{edge:x,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:M,sourceY:O,targetX:D,targetY:A,sourcePosition:H,targetPosition:W,setUpdateHover:F,setReconnecting:L})]})})}var Ede=E.memo(bde);const xde=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function n6({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:x}=Rt(xde,In),_=sde(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(cde,{defaultColor:e,rfId:n}),_.map(k=>o.jsx(Ede,{id:k,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:x,edgeTypes:r,disableKeyboardA11y:g},k))]})}n6.displayName="EdgeRenderer";const wde=E.memo(n6),vde=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function _de({children:e}){const t=Rt(vde);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function kde(e){const t=H0(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Nde=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Sde(e){const t=Rt(Nde),n=Rn();return E.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Tde(e){return e.connection.inProgress?{...e.connection,to:Cu(e.connection.to,e.transform)}:{...e.connection}}function Ade(e){return Tde}function Cde(e){const t=Ade();return Rt(t,In)}const Ide=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Rde({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:l,inProgress:c}=Rt(Ide,In);return!(i&&s&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:or(["react-flow__connection",QP(l)]),children:o.jsx(r6,{style:t,type:n,CustomComponent:r,isValid:l})})})}const r6=({style:e,type:t=Ya.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=Cde();if(!s)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:QP(r),toNode:d,toHandle:f,pointer:p});let m="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ya.Bezier:[m]=l4(g);break;case Ya.SimpleBezier:[m]=V4(g);break;case Ya.Step:[m]=Sg({...g,borderRadius:0});break;case Ya.SmoothStep:[m]=Sg(g);break;default:[m]=u4(g)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};r6.displayName="ConnectionLine";const Ode={};function mC(e=Ode){E.useRef(e),Rn(),E.useEffect(()=>{},[e])}function Lde(){Rn(),E.useRef(!1),E.useEffect(()=>{},[])}function s6({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,preventScrolling:U,defaultMarkerColor:C,zoomOnScroll:M,zoomOnPinch:O,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,zoomOnDoubleClick:W,panOnDrag:P,autoPanOnSelection:te,onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneScroll:fe,onPaneContextMenu:ee,paneClickDistance:Ee,nodeClickDistance:ge,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Ae,onEdgeMouseLeave:Re,reconnectRadius:Ye,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G,viewport:Z,onViewportChange:he}){return mC(e),mC(t),Lde(),kde(n),Sde(Z),o.jsx(Gue,{onPaneClick:X,onPaneMouseEnter:ne,onPaneMouseMove:ce,onPaneMouseLeave:J,onPaneContextMenu:ee,onPaneScroll:fe,paneClickDistance:Ee,deleteKeyCode:S,selectionKeyCode:b,selectionOnDrag:x,selectionMode:_,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:T,elementsSelectable:I,zoomOnScroll:M,zoomOnPinch:O,zoomOnDoubleClick:W,panOnScroll:D,panOnScrollSpeed:A,panOnScrollMode:H,panOnDrag:P,autoPanOnSelection:te,defaultViewport:j,translateExtent:F,minZoom:Y,maxZoom:L,onSelectionContextMenu:f,preventScrolling:U,noDragClassName:ze,noWheelClassName:le,noPanClassName:ve,disableKeyboardA11y:ct,onViewportChange:he,isControlledViewport:!!Z,children:o.jsxs(_de,{children:[o.jsx(wde,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Le,onReconnectStart:bt,onReconnectEnd:Ze,onlyRenderVisibleElements:R,onEdgeContextMenu:xe,onEdgeMouseEnter:we,onEdgeMouseMove:Ae,onEdgeMouseLeave:Re,reconnectRadius:Ye,defaultMarkerColor:C,noPanClassName:ve,disableKeyboardA11y:ct,rfId:G}),o.jsx(Rde,{style:g,type:m,component:w,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(rde,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:ve,noDragClassName:ze,disableKeyboardA11y:ct,nodeExtent:ht,rfId:G}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}s6.displayName="GraphView";const Mde=E.memo(s6),jde=n4(),gC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,g=new Map,w=new Map,y=r??t??[],b=n??e??[],x=d??[0,0],_=f??Hf;h4(g,w,y);const{nodesInitialized:k}=Ex(b,p,m,{nodeOrigin:x,nodeExtent:_,zIndexMode:h});let N=[0,0,1];if(a&&s&&i){const T=wh(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:S,y:R,zoom:I}=__(T,s,i,c,u,(l==null?void 0:l.padding)??.1);N=[S,R,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:b,nodesInitialized:k,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:w,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Hf,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ou.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:l,fitViewResolver:null,connection:{...XP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:jde,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qP,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Dde=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Zce((p,m)=>{async function g(){const{nodeLookup:w,panZoom:y,fitViewOptions:b,fitViewResolver:x,width:_,height:k,minZoom:N,maxZoom:T}=m();y&&(await Mle({nodes:w,width:_,height:k,panZoom:y,minZoom:N,maxZoom:T},b),x==null||x.resolve(!0),p({fitViewResolver:null}))}return{...gC({nodes:e,edges:t,width:s,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:w=>{const{nodeLookup:y,parentLookup:b,nodeOrigin:x,elevateNodesOnSelect:_,fitViewQueued:k,zIndexMode:N,nodesSelectionActive:T}=m(),{nodesInitialized:S,hasSelectedNodes:R}=Ex(w,y,b,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:N}),I=T&&R;k&&S?(g(),p({nodes:w,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:w,nodesInitialized:S,nodesSelectionActive:I})},setEdges:w=>{const{connectionLookup:y,edgeLookup:b}=m();h4(y,b,w),p({edges:w})},setDefaultNodesAndEdges:(w,y)=>{if(w){const{setNodes:b}=m();b(w),p({hasDefaultNodes:!0})}if(y){const{setEdges:b}=m();b(y),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:y,nodeLookup:b,parentLookup:x,domNode:_,nodeOrigin:k,nodeExtent:N,debug:T,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:j}=rce(w,b,x,_,k,N,R);j&&(Jle(b,x,{nodeOrigin:k,nodeExtent:N,zIndexMode:R}),S?(g(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(T&&console.log("React Flow: trigger node changes",I),y==null||y(I)))},updateNodePositions:(w,y=!1)=>{const b=[];let x=[];const{nodeLookup:_,triggerNodeChanges:k,connection:N,updateConnection:T,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of w){const j=_.get(R),F=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(I!=null&&I.position)),Y={id:R,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:y};if(j&&N.inProgress&&N.fromNode.id===j.id){const L=yl(j,N.fromHandle,He.Left,!0);T({...N,from:L})}F&&j.parentId&&b.push({id:R,parentId:j.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),x.push(Y)}if(b.length>0){const{parentLookup:R,nodeOrigin:I}=m(),j=I_(b,_,R,I);x.push(...j)}for(const R of S.values())x=R(x);k(x)},triggerNodeChanges:w=>{const{onNodesChange:y,setNodes:b,nodes:x,hasDefaultNodes:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=O4(w,x);b(N)}k&&console.log("React Flow: trigger node changes",w),y==null||y(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:y,setEdges:b,edges:x,hasDefaultEdges:_,debug:k}=m();if(w!=null&&w.length){if(_){const N=L4(w,x);b(N)}k&&console.log("React Flow: trigger edge changes",w),y==null||y(w)}},addSelectedNodes:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));_(N);return}_(gc(x,new Set([...w]),!0)),k(gc(b))},addSelectedEdges:w=>{const{multiSelectionActive:y,edgeLookup:b,nodeLookup:x,triggerNodeChanges:_,triggerEdgeChanges:k}=m();if(y){const N=w.map(T=>Po(T,!0));k(N);return}k(gc(b,new Set([...w]))),_(gc(x,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:y}={})=>{const{edges:b,nodes:x,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:N}=m(),T=w||x,S=y||b,R=[];for(const j of T){if(!j.selected)continue;const F=_.get(j.id);F&&(F.selected=!1),R.push(Po(j.id,!1))}const I=[];for(const j of S)j.selected&&I.push(Po(j.id,!1));k(R),N(I)},setMinZoom:w=>{const{panZoom:y,maxZoom:b}=m();y==null||y.setScaleExtent([w,b]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:y,minZoom:b}=m();y==null||y.setScaleExtent([b,w]),p({maxZoom:w})},setTranslateExtent:w=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:y,triggerNodeChanges:b,triggerEdgeChanges:x,elementsSelectable:_}=m();if(!_)return;const k=y.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]),N=w.reduce((T,S)=>S.selected?[...T,Po(S.id,!1)]:T,[]);b(k),x(N)},setNodeExtent:w=>{const{nodes:y,nodeLookup:b,parentLookup:x,nodeOrigin:_,elevateNodesOnSelect:k,nodeExtent:N,zIndexMode:T}=m();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(Ex(y,b,x,{nodeOrigin:_,nodeExtent:w,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:T}),p({nodeExtent:w}))},panBy:w=>{const{transform:y,width:b,height:x,panZoom:_,translateExtent:k}=m();return sce({delta:w,panZoom:_,transform:y,translateExtent:k,width:b,height:x})},setCenter:async(w,y,b)=>{const{width:x,height:_,maxZoom:k,panZoom:N}=m();if(!N)return!1;const T=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:k;return await N.setViewport({x:x/2-w*T,y:_/2-y*T,zoom:T},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{p({connection:{...XP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...gC()})}},Object.is);function O_({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=E.useState(()=>Dde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Jce,{value:m,children:o.jsx(_ue,{children:p})})}function Pde({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return E.useContext(U0)?o.jsx(o.Fragment,{children:e}):o.jsx(O_,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Bde={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Fde({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onSelectionChange:Y,onSelectionDragStart:L,onSelectionDrag:U,onSelectionDragStop:C,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onBeforeDelete:A,connectionMode:H,connectionLineType:W=Ya.Bezier,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,deleteKeyCode:ne="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:J=!1,selectionMode:fe=zf.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:Ee=Kf()?"Meta":"Control",zoomActivationKeyCode:ge=Kf()?"Meta":"Control",snapToGrid:xe,snapGrid:we,onlyRenderVisibleElements:Ae=!1,selectNodesOnDrag:Re,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,nodeOrigin:ze=I4,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct=!0,defaultViewport:ht=fue,minZoom:G=.5,maxZoom:Z=2,translateExtent:he=Hf,preventScrolling:De=!0,nodeExtent:qe,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:Kt=!0,zoomOnPinch:Et=!0,panOnScroll:Pt=!1,panOnScrollSpeed:Yt=.5,panOnScrollMode:Nt=rl.Free,zoomOnDoubleClick:rn=!0,panOnDrag:sn=!0,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Se,onPaneContextMenu:pe,paneClickDistance:Je=1,nodeClickDistance:at=0,children:dn,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn=10,onNodesChange:ue,onEdgesChange:Te,noDragClassName:Ce="nodrag",noWheelClassName:Qe="nowheel",noPanClassName:ot="nopan",fitView:et,fitViewOptions:Ct,connectOnClick:Wt,attributionPosition:oe,proOptions:be,defaultEdgeOptions:dt,elevateNodesOnSelect:Ve=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:ft=!1,autoPanOnConnect:Gt,autoPanOnNodeDrag:cr,autoPanOnSelection:Yn=!0,autoPanSpeed:hn,connectionRadius:Ln,isValidConnection:Ht,onError:Jt,style:Ot,id:kn,nodeDragThreshold:Nn,connectionDragThreshold:en,viewport:tr,onViewportChange:Wn,width:pr,height:nr,colorMode:Si="light",debug:Xs,onScroll:Zr,ariaLabelConfig:wr,zIndexMode:Ts="basic",...Qs},ka){const Ur=kn||"1",wo=gue(Si),Na=E.useCallback(Zs=>{Zs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zr==null||Zr(Zs)},[Zr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Qs,onScroll:Na,style:{...Ot,...Bde},ref:ka,className:or(["react-flow",s,wo]),id:kn,role:"application",children:o.jsxs(Pde,{nodes:e,edges:t,width:pr,height:nr,fitView:et,fitViewOptions:Ct,minZoom:G,maxZoom:Z,nodeOrigin:ze,nodeExtent:qe,zIndexMode:Ts,children:[o.jsx(mue,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:Ye,autoPanOnNodeFocus:Le,nodesConnectable:bt,nodesFocusable:Ze,edgesFocusable:le,edgesReconnectable:ve,elementsSelectable:ct,elevateNodesOnSelect:Ve,elevateEdgesOnSelect:Ke,minZoom:G,maxZoom:Z,nodeExtent:qe,onNodesChange:ue,onEdgesChange:Te,snapToGrid:xe,snapGrid:we,connectionMode:H,translateExtent:he,connectOnClick:Wt,defaultEdgeOptions:dt,fitView:et,fitViewOptions:Ct,onNodesDelete:I,onEdgesDelete:j,onDelete:F,onNodeDragStart:T,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:U,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ot,nodeOrigin:ze,rfId:Ur,autoPanOnConnect:Gt,autoPanOnNodeDrag:cr,autoPanSpeed:hn,onError:Jt,connectionRadius:Ln,isValidConnection:Ht,selectNodesOnDrag:Re,nodeDragThreshold:Nn,connectionDragThreshold:en,onBeforeDelete:A,debug:Xs,ariaLabelConfig:wr,zIndexMode:Ts}),o.jsx(Mde,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:W,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:X,selectionKeyCode:ce,selectionOnDrag:J,selectionMode:fe,deleteKeyCode:ne,multiSelectionKeyCode:Ee,panActivationKeyCode:ee,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ae,defaultViewport:ht,translateExtent:he,minZoom:G,maxZoom:Z,preventScrolling:De,zoomOnScroll:Kt,zoomOnPinch:Et,zoomOnDoubleClick:rn,panOnScroll:Pt,panOnScrollSpeed:Yt,panOnScrollMode:Nt,panOnDrag:sn,autoPanOnSelection:Yn,onPaneClick:_t,onPaneMouseEnter:rt,onPaneMouseMove:Oe,onPaneMouseLeave:gt,onPaneScroll:Se,onPaneContextMenu:pe,paneClickDistance:Je,nodeClickDistance:at,onSelectionContextMenu:M,onSelectionStart:O,onSelectionEnd:D,onReconnect:an,onReconnectStart:pt,onReconnectEnd:Lt,onEdgeContextMenu:on,onEdgeDoubleClick:On,onEdgeMouseEnter:lr,onEdgeMouseMove:fn,onEdgeMouseLeave:Bt,reconnectRadius:Kn,defaultMarkerColor:nt,noDragClassName:Ce,noWheelClassName:Qe,noPanClassName:ot,rfId:Ur,disableKeyboardA11y:ft,nodeExtent:qe,viewport:tr,onViewportChange:Wn}),o.jsx(due,{onSelectionChange:Y}),dn,o.jsx(aue,{proOptions:be,position:oe}),o.jsx(iue,{rfId:Ur,disableKeyboardA11y:ft})]})})}var i6=j4(Fde);const Ude=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function $de({children:e}){const t=Rt(Ude);return t?vs.createPortal(e,t):null}function a6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>O4(s,i)),[]);return[t,n,r]}function o6(e){const[t,n]=E.useState(e),r=E.useCallback(s=>n(i=>L4(s,i)),[]);return[t,n,r]}const Hde=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||!k_(n.userNode))return!1;return!0};function zde(e={includeHiddenNodes:!1}){return Rt(Hde(e))}function Vde({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:or(["react-flow__background-pattern",n,r])})}function Kde({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:or(["react-flow__background-pattern","dots",t])})}var ao;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ao||(ao={}));const Yde={[ao.Dots]:1,[ao.Lines]:1,[ao.Cross]:6},Wde=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function l6({id:e,variant:t=ao.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=E.useRef(null),{transform:h,patternId:p}=Rt(Wde,In),m=r||Yde[t],g=t===ao.Dots,w=t===ao.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*h[2]||1,y[1]*h[2]||1],x=m*h[2],_=Array.isArray(i)?i:[i,i],k=w?[x,x]:b,N=[_[0]*h[2]||1+k[0]/2,_[1]*h[2]||1+k[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:or(["react-flow__background",u]),style:{...c,...z0,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%b[0],y:h[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?o.jsx(Kde,{radius:x/2,className:d}):o.jsx(Vde,{dimensions:k,lineWidth:s,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}l6.displayName="Background";const c6=E.memo(l6);function Gde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Xde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Qde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Zde(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Mp({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:or(["react-flow__controls-button",t]),...n,children:e})}const Jde=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function u6({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Rn(),{isInteractive:g,minZoomReached:w,maxZoomReached:y,ariaLabelConfig:b}=Rt(Jde,In),{zoomIn:x,zoomOut:_,fitView:k}=H0(),N=()=>{x(),i==null||i()},T=()=>{_(),a==null||a()},S=()=>{k(s),l==null||l()},R=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},I=h==="horizontal"?"horizontal":"vertical";return o.jsxs($0,{className:or(["react-flow__controls",I,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Mp,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Gde,{})}),o.jsx(Mp,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(qde,{})})]}),n&&o.jsx(Mp,{className:"react-flow__controls-fitview",onClick:S,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(Xde,{})}),r&&o.jsx(Mp,{className:"react-flow__controls-interactive",onClick:R,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:g?o.jsx(Zde,{}):o.jsx(Qde,{})}),d]})}u6.displayName="Controls";const d6=E.memo(u6);function efe({id:e,x:t,y:n,width:r,height:s,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:g}=i||{},w=a||m||g;return o.jsx("rect",{className:or(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:s,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const tfe=E.memo(efe),nfe=e=>e.nodes.map(t=>t.id),Db=e=>e instanceof Function?e:()=>e;function rfe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=tfe,onClick:a}){const l=Rt(nfe,In),c=Db(t),u=Db(e),d=Db(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(ife,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function sfe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Rt(m=>{const g=m.nodeLookup.get(e);if(!g)return{node:void 0,x:0,y:0,width:0,height:0};const w=g.internals.userNode,{x:y,y:b}=g.internals.positionAbsolute,{width:x,height:_}=_a(w);return{node:w,x:y,y:b,width:x,height:_}},In);return!u||u.hidden||!k_(u)?null:o.jsx(l,{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 ife=E.memo(sfe);var afe=E.memo(rfe);const ofe=200,lfe=150,cfe=e=>!e.hidden,ufe=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?t4(wh(e.nodeLookup,{filter:cfe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},dfe="react-flow__minimap-desc";function f6({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:x=1,offsetScale:_=5}){const k=Rn(),N=E.useRef(null),{boundingRect:T,viewBB:S,rfId:R,panZoom:I,translateExtent:j,flowWidth:F,flowHeight:Y,ariaLabelConfig:L}=Rt(ufe,In),U=(e==null?void 0:e.width)??ofe,C=(e==null?void 0:e.height)??lfe,M=T.width/U,O=T.height/C,D=Math.max(M,O),A=D*U,H=D*C,W=_*D,P=T.x-(A-T.width)/2-W,te=T.y-(H-T.height)/2-W,X=A+W*2,ne=H+W*2,ce=`${dfe}-${R}`,J=E.useRef(0),fe=E.useRef();J.current=D,E.useEffect(()=>{if(N.current&&I)return fe.current=hce({domNode:N.current,panZoom:I,getTransform:()=>k.getState().transform,getViewScale:()=>J.current}),()=>{var xe;(xe=fe.current)==null||xe.destroy()}},[I]),E.useEffect(()=>{var xe;(xe=fe.current)==null||xe.update({translateExtent:j,width:F,height:Y,inversePan:b,pannable:g,zoomStep:x,zoomable:w})},[g,w,b,x,j,F,Y]);const ee=p?xe=>{var Re;const[we,Ae]=((Re=fe.current)==null?void 0:Re.pointer(xe))||[0,0];p(xe,{x:we,y:Ae})}:void 0,Ee=m?E.useCallback((xe,we)=>{const Ae=k.getState().nodeLookup.get(we).internals.userNode;m(xe,Ae)},[]):void 0,ge=y??L["minimap.ariaLabel"];return o.jsx($0,{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*D: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:or(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:U,height:C,viewBox:`${P} ${te} ${X} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:N,onClick:ee,children:[ge&&o.jsx("title",{id:ce,children:ge}),o.jsx(afe,{onClick:Ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-W},${te-W}h${X+W*2}v${ne+W*2}h${-X-W*2}z + M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}f6.displayName="MiniMap";const ffe=E.memo(f6),hfe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,pfe={[fu.Line]:"right",[fu.Handle]:"bottom-right"};function mfe({nodeId:e,position:t,variant:n=fu.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:l=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:g,onResize:w,onResizeEnd:y}){const b=F4(),x=typeof e=="string"?e:b,_=Rn(),k=E.useRef(null),N=n===fu.Handle,T=Rt(E.useCallback(hfe(N&&p),[N,p]),In),S=E.useRef(null),R=t??pfe[n];E.useEffect(()=>{if(!(!k.current||!x))return S.current||(S.current=Sce({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,domNode:C}=_.getState();return{nodeLookup:j,transform:F,snapGrid:Y,snapToGrid:L,nodeOrigin:U,paneDomNode:C}},onChange:(j,F)=>{const{triggerNodeChanges:Y,nodeLookup:L,parentLookup:U,nodeOrigin:C}=_.getState(),M=[],O={x:j.x,y:j.y},D=L.get(x);if(D&&D.expandParent&&D.parentId){const A=D.origin??C,H=j.width??D.measured.width??0,W=j.height??D.measured.height??0,P={id:D.id,parentId:D.parentId,rect:{width:H,height:W,...r4({x:j.x??D.position.x,y:j.y??D.position.y},{width:H,height:W},D.parentId,L,A)}},te=I_([P],L,U,C);M.push(...te),O.x=j.x?Math.max(A[0]*H,j.x):void 0,O.y=j.y?Math.max(A[1]*W,j.y):void 0}if(O.x!==void 0&&O.y!==void 0){const A={id:x,type:"position",position:{...O}};M.push(A)}if(j.width!==void 0&&j.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};M.push(H)}for(const A of F){const H={...A,type:"position"};M.push(H)}Y(M)},onEnd:({width:j,height:F})=>{const Y={id:x,type:"dimensions",resizing:!1,dimensions:{width:j,height:F}};_.getState().triggerNodeChanges([Y])}})),S.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:m}),()=>{var j;(j=S.current)==null||j.destroy()}},[R,l,c,u,d,f,g,w,y,m]);const I=R.split("-");return o.jsx("div",{className:or(["react-flow__resize-control","nodrag",...I,n,r]),ref:k,style:{...s,scale:T,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:i})}E.memo(mfe);var h6=Object.defineProperty,gfe=(e,t,n)=>t in e?h6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yfe=(e,t)=>{for(var n in t)h6(e,n,{get:t[n],enumerable:!0})},bfe=(e,t,n)=>gfe(e,t+"",n),p6={};yfe(p6,{Graph:()=>qs,alg:()=>L_,json:()=>g6,version:()=>wfe});var Efe=Object.defineProperty,m6=(e,t)=>{for(var n in t)Efe(e,n,{get:t[n],enumerable:!0})},qs=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,l,c=!1;typeof e=="object"&&e!==null&&"v"in e?(s=e.v,i=e.w,a=e.name,arguments.length===2&&(l=t,c=!0)):(s=e,i=t,a=r,arguments.length>2&&(l=n,c=!0)),s=""+s,i=""+i,a!==void 0&&(a=""+a);let u=Nd(this._isDirected,s,i,a);if(u in this._edgeLabels)return c&&(this._edgeLabels[u]=l),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?l:this._defaultEdgeLabelFn(s,i,a);let d=xfe(this._isDirected,s,i,a);return s=d.v,i=d.w,Object.freeze(d),this._edgeObjs[u]=d,yC(this._preds[i],s),yC(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?Pb(this._isDirected,e):Nd(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?Pb(this._isDirected,e):Nd(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Pb(this._isDirected,e):Nd(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],bC(this._preds[a],i),bC(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 yC(e,t){e[t]?e[t]++:e[t]=1}function bC(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Nd(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 xfe(e,t,n,r){let s=""+t,i=""+n;if(!e&&s>i){let l=s;s=i,i=l}let a={v:s,w:i};return r&&(a.name=r),a}function Pb(e,t){return Nd(e,t.v,t.w,t.name)}var wfe="4.0.1",g6={};m6(g6,{read:()=>Nfe,write:()=>vfe});function vfe(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:_fe(e),edges:kfe(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function _fe(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 kfe(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 Nfe(e){let t=new qs(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 L_={};m6(L_,{CycleException:()=>Cg,bellmanFord:()=>y6,components:()=>Afe,dijkstra:()=>Ag,dijkstraAll:()=>Rfe,findCycles:()=>Ofe,floydWarshall:()=>Mfe,isAcyclic:()=>Dfe,postorder:()=>Bfe,preorder:()=>Ffe,prim:()=>Ufe,shortestPaths:()=>$fe,tarjan:()=>E6,topsort:()=>x6});var Sfe=()=>1;function y6(e,t,n,r){return Tfe(e,String(t),n||Sfe,r||function(s){return e.outEdges(s)})}function Tfe(e,t,n,r){let s={},i,a=0,l=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 Ag(e,t,n,r){let s=function(i){return e.outEdges(i)};return Ife(e,String(t),n||Cfe,r||s)}function Ife(e,t,n,r){let s={},i=new b6,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=s[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=i.removeMin(),l=s[a],l.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}function Rfe(e,t,n){return e.nodes().reduce(function(r,s){return r[s]=Ag(e,s,t,n),r},{})}function E6(e){let t=0,n=[],r={},s=[];function i(a){let l=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in r?r[c].onStack&&(l.lowlink=Math.min(l.lowlink,r[c].index)):(i(c),l.lowlink=Math.min(l.lowlink,r[c].lowlink))}),l.lowlink===l.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 Ofe(e){return E6(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Lfe=()=>1;function Mfe(e,t,n){return jfe(e,t||Lfe,n||function(r){return e.outEdges(r)})}function jfe(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 l=a.v===i?a.w:a.v,c=t(a);r[i][l]={distance:c,predecessor:i}})}),s.forEach(function(i){let a=r[i];s.forEach(function(l){let c=r[l];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(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);s=w6(e,l,n==="post",a,i,r,s)}),s}function w6(e,t,n,r,s,i,a){return t in r||(r[t]=!0,n||(a=i(a,t)),s(t).forEach(function(l){a=w6(e,l,n,r,s,i,a)}),n&&(a=i(a,t))),a}function v6(e,t,n){return Pfe(e,t,n,function(r,s){return r.push(s),r},[])}function Bfe(e,t){return v6(e,t,"post")}function Ffe(e,t){return v6(e,t,"pre")}function Ufe(e,t){let n=new qs,r={},s=new b6,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(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(a)}return n}function $fe(e,t,n,r){return Hfe(e,t,n,r??(s=>{let i=e.outEdges(s);return i??[]}))}function Hfe(e,t,n,r){if(n===void 0)return Ag(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 _6(e){let t=new qs({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 EC(e,t){let n=e.x,r=e.y,s=t.x-n,i=t.y-r,a=e.width/2,l=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)*l?(i<0&&(l=-l),c=l*s/i,u=l):(s<0&&(a=-a),c=a,u=a*i/s),{x:n+c,y:r+u}}function kh(e){let t=Wf(N6(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 Vfe(e){let t=e.nodes().map(r=>{let s=e.node(r).rank;return s===void 0?Number.MAX_VALUE:s}),n=Pi(Math.min,t);e.nodes().forEach(r=>{let s=e.node(r);Object.hasOwn(s,"rank")&&(s.rank-=n)})}function Kfe(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Pi(Math.min,t),r=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;r[l]||(r[l]=[]),r[l].push(a)});let s=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((a,l)=>{a===void 0&&l%i!==0?--s:a!==void 0&&s&&a.forEach(c=>e.node(c).rank+=s)})}function xC(e,t,n,r){let s={width:0,height:0};return arguments.length>=4&&(s.rank=n,s.order=r),Iu(e,"border",s,t)}function Yfe(e,t=k6){let n=[];for(let r=0;rk6){let n=Yfe(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function N6(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return Pi(Math.max,t)}function Wfe(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function S6(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function T6(e,t){return t()}var Gfe=0;function M_(e){let t=++Gfe;return e+(""+t)}function Wf(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 qfe(e,t){return e.reduce((n,r,s)=>(n[r]=t[s],n),{})}var K0="\0",Xfe="3.0.0",Qfe=class{constructor(){bfe(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return wC(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&wC(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,Zfe)),n=n._prev;return"["+e.join(", ")+"]"}};function wC(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Zfe(e,t){if(e!=="_next"&&e!=="_prev")return t}var Jfe=Qfe,ehe=()=>1;function the(e,t){if(e.nodeCount()<=1)return[];let n=rhe(e,t||ehe);return nhe(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function nhe(e,t,n){var r;let s=[],i=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)Bb(e,t,n,l);for(;l=i.dequeue();)Bb(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(r=t[c])==null?void 0:r.dequeue(),l){s=s.concat(Bb(e,t,n,l,!0)||[]);break}}}return s}function Bb(e,t,n,r,s){let i=[],a=s?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);s&&i.push({v:l.v,w:l.w}),u.out-=c,vx(t,n,u)}),(e.outEdges(r.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,vx(t,n,d)}),e.removeNode(r.v),a}function rhe(e,t){let n=new qs,r=0,s=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);s=Math.max(s,f.out+=u),r=Math.max(r,h.in+=u)});let i=she(s+r+3).map(()=>new Jfe),a=r+1;return n.nodes().forEach(l=>{vx(i,a,n.node(l))}),{graph:n,buckets:i,zeroIdx:a}}function vx(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 she(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,M_("rev"))});function t(n){return r=>n.edge(r).weight}}function ahe(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 ohe(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 lhe(e){e.graph().dummyChains=[],e.edges().forEach(t=>che(e,t))}function che(e,t){let n=t.v,r=e.node(n).rank,s=t.w,i=e.node(s).rank,a=t.name,l=e.edge(t),c=l.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 j_(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):[],l=Pi(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),s.rank=l}e.sources().forEach(n)}function pu(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var A6=dhe;function dhe(e){let t=new qs({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(;fhe(t,e){let a=i.v,l=r===a?i.w:a;!e.hasNode(l)&&!pu(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function hhe(e,t){return t.edges().reduce((n,r)=>{let s=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(s=pu(t,r)),st.node(r).rank+=n)}var{preorder:mhe,postorder:ghe}=L_,yhe=Sl;Sl.initLowLimValues=P_;Sl.initCutValues=D_;Sl.calcCutValue=C6;Sl.leaveEdge=R6;Sl.enterEdge=O6;Sl.exchangeEdges=L6;function Sl(e){e=zfe(e),j_(e);let t=A6(e);P_(t),D_(t,e);let n,r;for(;n=R6(t);)r=O6(t,e,n),L6(t,e,n,r)}function D_(e,t){let n=ghe(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>bhe(e,t,r))}function bhe(e,t,n){let r=e.node(n).parent,s=e.edge(n,r);s.cutvalue=C6(e,t,n)}function C6(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 l=t.nodeEdges(n);return l&&l.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,xhe(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function P_(e,t){arguments.length<2&&(t=e.nodes()[0]),I6(e,{},1,t)}function I6(e,t,n,r,s){let i=n,a=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=I6(e,t,n,c,r))}),a.low=i,a.lim=n++,s?a.parent=s:delete a.parent,n}function R6(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function O6(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),l=i,c=!1;return i.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===vC(e,e.node(u.v),l)&&c!==vC(e,e.node(u.w),l)).reduce((u,d)=>pu(t,d)!e.node(s).parent);if(!n)return;let r=mhe(e,[n]);r=r.slice(1),r.forEach(s=>{let i=e.node(s).parent,a=t.edge(s,i),l=!1;a||(a=t.edge(i,s),l=!0),t.node(s).rank=t.node(i).rank+(l?a.minlen:-a.minlen)})}function xhe(e,t,n){return e.hasEdge(t,n)}function vC(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var whe=vhe;function vhe(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":_C(e);break;case"tight-tree":khe(e);break;case"longest-path":_he(e);break;case"none":break;default:_C(e)}}var _he=j_;function khe(e){j_(e),A6(e)}function _C(e){yhe(e)}var Nhe=She;function She(e){let t=Ahe(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),s=r.edgeObj,i=The(e,t,s.v,s.w),a=i.path,l=i.lca,c=0,u=a[c],d=!0;for(;n!==s.w;){if(r=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>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 Ahe(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(K0).forEach(r),t}function Che(e){let t=Iu(e,"root",{},"_root"),n=Ihe(e),r=Object.values(n),s=Pi(Math.max,r)-1,i=2*s+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let a=Rhe(e)+1;e.children(K0).forEach(l=>M6(e,t,i,a,s,n,l)),e.graph().nodeRankFactor=i}function M6(e,t,n,r,s,i,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=xC(e,"_bt"),d=xC(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;M6(e,t,n,r,s,i,h);let m=e.node(h),g=m.borderTop?m.borderTop:h,w=m.borderBottom?m.borderBottom:h,y=m.borderTop?r:2*r,b=g!==w?1:s-((p=i[a])!=null?p:0)+1;e.setEdge(u,g,{weight:y,minlen:b,nestingEdge:!0}),e.setEdge(w,d,{weight:y,minlen:b,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:s+((l=i[a])!=null?l:0)})}function Ihe(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(K0).forEach(r=>n(r,1)),t}function Rhe(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Ohe(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var Lhe=Mhe;function Mhe(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;iNC(e.node(t))),e.edges().forEach(t=>NC(e.edge(t)))}function NC(e){let t=e.width;e.width=e.height,e.height=t}function Phe(e){e.nodes().forEach(t=>Fb(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Fb),Object.hasOwn(r,"y")&&Fb(r)})}function Fb(e){e.y=-e.y}function Bhe(e){e.nodes().forEach(t=>Ub(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Ub),Object.hasOwn(r,"x")&&Ub(r)})}function Ub(e){let t=e.x;e.x=e.y,e.y=t}function Fhe(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),s=Pi(Math.max,r),i=Wf(s+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);i[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),i}function Uhe(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;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Hhe(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 l=e.edge(a),c=e.node(a.v);return{sum:i.sum+l.weight*c.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:s.sum/s.weight,weight:s.weight}}})}function zhe(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 Vhe(r)}function Vhe(e){let t=[];function n(s){return i=>{i.merged||(i.barycenter===void 0||s.barycenter===void 0||i.barycenter>=s.barycenter)&&Khe(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=>Ig(s,["vs","i","barycenter","weight"]))}function Khe(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 Yhe(e,t){let n=Wfe(e,d=>Object.hasOwn(d,"barycenter")),r=n.lhs,s=n.rhs.sort((d,f)=>f.i-d.i),i=[],a=0,l=0,c=0;r.sort(Whe(!!t)),c=SC(i,s,c),r.forEach(d=>{c+=d.vs.length,i.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=SC(i,s,c)});let u={vs:i.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function SC(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 Whe(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function D6(e,t,n,r){let s=e.children(t),i=e.node(t),a=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,c={};a&&(s=s.filter(h=>h!==a&&h!==l));let u=Hhe(e,s);u.forEach(h=>{if(e.children(h.v).length){let p=D6(e,h.v,n,r);c[h.v]=p,Object.hasOwn(p,"barycenter")&&qhe(h,p)}});let d=zhe(u,n);Ghe(d,c);let f=Yhe(d,r);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),g=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}}return f}function Ghe(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function qhe(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 Xhe(e,t,n,r){r||(r=e.nodes());let s=Qhe(e),i=new qs({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(a=>e.node(a));return r.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.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(l,"minRank")&&i.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function Qhe(e){let t;for(;e.hasNode(t=M_("_root")););return t}function Zhe(e,t,n){let r={},s;n.forEach(i=>{let a=e.parent(i),l,c;for(;a;){if(l=e.parent(a),l?(c=r[l],r[l]=a):(c=s,s=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function P6(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,P6);return}let n=N6(e),r=TC(e,Wf(1,n+1),"inEdges"),s=TC(e,Wf(n-1,-1,-1),"outEdges"),i=Fhe(e);if(AC(e,i),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Jhe(u%2?r:s,u%4>=2,c),i=kh(e);let f=Uhe(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 l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&s(l,i)}return t.map(function(i){return Xhe(e,i,n,r.get(i)||[])})}function Jhe(e,t,n){let r=new qs;e.forEach(function(s){n.forEach(l=>r.setEdge(l.left,l.right));let i=s.graph().root,a=D6(s,i,r,t);a.vs.forEach((l,c)=>s.node(l).order=c),Zhe(s,r,a.vs)})}function AC(e,t){Object.values(t).forEach(n=>n.forEach((r,s)=>e.node(r).order=s))}function epe(e,t){let n={};function r(s,i){let a=0,l=0,c=s.length,u=i[i.length-1];return i.forEach((d,f)=>{let h=npe(e,d),p=h?e.node(h).order:c;(h||d===u)&&(i.slice(l,f+1).forEach(m=>{let g=e.predecessors(m);g&&g.forEach(w=>{let y=e.node(w),b=y.order;(b{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)&&B6(n,p,f)})}})}function s(i,a){let l=-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,l,c),u=f,l=c}}r(a,u,a.length,c,i.length)}),a}return t.length&&t.reduce(s),n}function npe(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function B6(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 rpe(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 spe(e,t,n,r){let s={},i={},a={};return t.forEach(l=>{l.forEach((c,u)=>{s[c]=c,i[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=r(u);if(d&&d.length){let f=d.sort((p,m)=>{let g=a[p],w=a[m];return(g!==void 0?g:0)-(w!==void 0?w:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let g=f[p];if(g===void 0)continue;let w=a[g];if(w!==void 0&&i[u]===u&&c{var y;let b=(y=i[w.v])!=null?y:0,x=a.edge(w);return Math.max(g,b+(x!==void 0?x:0))},0):i[p]=0}function d(p){let m=a.outEdges(p),g=Number.POSITIVE_INFINITY;m&&(g=m.reduce((y,b)=>{let x=i[b.w],_=a.edge(b);return Math.min(y,(x!==void 0?x:0)-(_!==void 0?_:0))},Number.POSITIVE_INFINITY));let w=e.node(p);g!==Number.POSITIVE_INFINITY&&w.borderType!==l&&(i[p]=Math.max(i[p]!==void 0?i[p]:0,g))}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 g=n[p];g!==void 0&&(i[p]=(m=i[g])!=null?m:0)}),i}function ape(e,t,n,r){let s=new qs,i=e.graph(),a=dpe(i.nodesep,i.edgesep,r);return t.forEach(l=>{let c;l.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 ope(e,t){return Object.values(t).reduce((n,r)=>{let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,c])=>{let u=fpe(e,l)/2;s=Math.max(c+u,s),i=Math.min(c-u,i)});let a=s-i;return a{["l","r"].forEach(a=>{let l=i+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=r-Pi(Math.min,u);a!=="l"&&(d=s-Pi(Math.max,u)),d&&(e[l]=V0(c,f=>f+d))})})}function cpe(e,t=void 0){let n=e.ul;return n?V0(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 l=Object.values(e).map(c=>{let u=c[s];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((i=l[1])!=null?i:0)+((a=l[2])!=null?a:0))/2}):{}}function upe(e){let t=kh(e),n=Object.assign(epe(e,t),tpe(e,t)),r={},s;["u","d"].forEach(a=>{s=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(s=s.map(d=>Object.values(d).reverse()));let c=spe(e,s,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=ipe(e,s,c.root,c.align,l==="r");l==="r"&&(u=V0(u,d=>-d)),r[a+l]=u})});let i=ope(e,r);return lpe(r,i),cpe(r,e.graph().align)}function dpe(e,t,n){return(r,s,i)=>{let a=r.node(s),l=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+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function fpe(e,t){return e.node(t).width}function hpe(e){e=_6(e),ppe(e),Object.entries(upe(e)).forEach(([t,n])=>e.node(t).x=n)}function ppe(e){let t=kh(e),n=e.graph(),r=n.ranksep,s=n.rankalign,i=0;t.forEach(a=>{let l=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+l-u.height/2:u.y=i+l/2}),i+=l+r})}function mpe(e,t={}){let n=t.debugTiming?S6:T6;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>Npe(e));return n(" runLayout",()=>gpe(r,n,t)),n(" updateInputGraph",()=>ype(e,r)),r})}function gpe(e,t,n){t(" makeSpaceForEdgeLabels",()=>Spe(e)),t(" removeSelfEdges",()=>jpe(e)),t(" acyclic",()=>ihe(e)),t(" nestingGraph.run",()=>Che(e)),t(" rank",()=>whe(_6(e))),t(" injectEdgeLabelProxies",()=>Tpe(e)),t(" removeEmptyRanks",()=>Kfe(e)),t(" nestingGraph.cleanup",()=>Ohe(e)),t(" normalizeRanks",()=>Vfe(e)),t(" assignRankMinMax",()=>Ape(e)),t(" removeEdgeLabelProxies",()=>Cpe(e)),t(" normalize.run",()=>lhe(e)),t(" parentDummyChains",()=>Nhe(e)),t(" addBorderSegments",()=>Lhe(e)),t(" order",()=>P6(e,n)),t(" insertSelfEdges",()=>Dpe(e)),t(" adjustCoordinateSystem",()=>jhe(e)),t(" position",()=>hpe(e)),t(" positionSelfEdges",()=>Ppe(e)),t(" removeBorderNodes",()=>Mpe(e)),t(" normalize.undo",()=>uhe(e)),t(" fixupEdgeLabelCoords",()=>Ope(e)),t(" undoCoordinateSystem",()=>Dhe(e)),t(" translateGraph",()=>Ipe(e)),t(" assignNodeIntersects",()=>Rpe(e)),t(" reversePoints",()=>Lpe(e)),t(" acyclic.undo",()=>ohe(e))}function ype(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 bpe=["nodesep","edgesep","ranksep","marginx","marginy"],Epe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},xpe=["acyclicer","ranker","rankdir","align","rankalign"],wpe=["width","height","rank"],CC={width:0,height:0},vpe=["minlen","weight","width","height","labeloffset"],_pe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},kpe=["labelpos"];function Npe(e){let t=new qs({multigraph:!0,compound:!0}),n=Hb(e.graph());return t.setGraph(Object.assign({},Epe,$b(n,bpe),Ig(n,xpe))),e.nodes().forEach(r=>{let s=Hb(e.node(r)),i=$b(s,wpe);Object.keys(CC).forEach(l=>{i[l]===void 0&&(i[l]=CC[l])}),t.setNode(r,i);let a=e.parent(r);a!==void 0&&t.setParent(r,a)}),e.edges().forEach(r=>{let s=Hb(e.edge(r));t.setEdge(r,Object.assign({},_pe,$b(s,vpe),Ig(s,kpe)))}),t}function Spe(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 Tpe(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};Iu(e,"edge-proxy",s,"_ep")}})}function Ape(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 Cpe(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 Ipe(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,s=0,i=e.graph(),a=i.marginx||0,l=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-=l,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+l}function Rpe(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(EC(r,i)),n.points.push(EC(s,a))})}function Ope(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 Lpe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Mpe(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 jpe(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 Dpe(e){kh(e).forEach(t=>{let n=0;t.forEach((r,s)=>{let i=e.node(r);i.order=s+n,(i.selfEdges||[]).forEach(a=>{Iu(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 Ppe(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,l=n.x-i,c=s.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:a-c},{x:i+5*l/6,y:a-c},{x:i+l,y:a},{x:i+5*l/6,y:a+c},{x:i+2*l/3,y:a+c}],r.label.x=n.x,r.label.y=n.y}})}function $b(e,t){return V0(Ig(e,t),Number)}function Hb(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function Bpe(e){let t=kh(e),n=new qs({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,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var Fpe={graphlib:p6,version:Xfe,layout:mpe,debug:Bpe,util:{time:S6,notime:T6}},IC=Fpe;/*! For license information please see dagre.esm.js.LEGAL.txt */const Sd={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:cl},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:LM},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:NM},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:kv},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:h0}},_x=220,kx=88,RC=96,OC=34,tf=64,zb=310,yc=24,F6=56,Nx=40,LC=40,Upe=18,$pe=58,Hpe=!1,zpe=e=>e==="sequential"||e==="parallel"||e==="loop";function Sx(e,t){const n=e.agentType??"llm";return zpe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function Tx(e,t=[],n="horizontal",r=!1){const s=e.agentType??"llm";if(!Sx(e,t))return{width:_x,height:kx};if(r&&e.subAgents.length===0)return{width:zb,height:tf};const i=e.subAgents.map((f,h)=>Tx(f,[...t,h],n,r)),a=i.length?Math.max(...i.map(f=>f.width)):0,l=i.length?Math.max(...i.map(f=>f.height)):0,c=i.length&&s!=="parallel"?F6:yc,u=n==="horizontal"?s!=="parallel":s==="parallel",d=i.length?s==="parallel"?Upe+LC:s==="loop"?$pe:0:LC;return u?{width:Math.max(zb,i.reduce((f,h)=>f+h.width,0)+Nx*Math.max(0,i.length-1)+c*2),height:tf+yc+l+d+yc}:{width:Math.max(zb,a+yc*2),height:tf+c+i.reduce((f,h)=>f+h.height,0)+Nx*Math.max(0,i.length-1)+d+c}}function cd(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Vpe(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function MC(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function ud(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:lu.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 jC(e,t,n=!1){const r=[{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}],s=[];function i(d,f,h,p,m){const g=d.agentType??"llm",w=cd(f);return Sx(d,f)?(a(d,f,h,p,m),w):(r.push({id:w,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:g==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m}}),w)}function a(d,f,h,p={x:0,y:0},m){const g=d.agentType??"sequential",w=cd(f),y=Tx(d,f,t,n);r.push({id:w,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":Sd[g].label),pattern:g,description:d.description.trim()||Sd[g].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const b=d.subAgents.map((T,S)=>Tx(T,[...f,S],t,n)),x=b.length&&g!=="parallel"?F6:yc,_=t==="horizontal"?g!=="parallel":g==="parallel";let k=x;const N=d.subAgents.map((T,S)=>{const R=b[S],I=_?{x:k,y:tf+yc}:{x:(y.width-R.width)/2,y:tf+k};return k+=(_?R.width:R.height)+Nx,i(T,[...f,S],w,I,g)});if(g==="sequential"||g==="loop"){for(let T=0;T1&&s.push(ud(N[N.length-1],N[0],"继续循环",{loop:!0,tone:"loop"}))}return w}const l=(d,f)=>{const h=d.agentType??"llm",p=cd(f);if(Sx(d,f))return a(d,f),[p];if(r.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||Sd[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((g,w)=>{const y=[...f,w],b=cd(y);s.push(ud(p,b,"调用",{insert:{parentPath:f,index:w}})),m.push(...l(g,y))}),m},c=cd([]),u=l(e,[]);return s.push(ud("terminal-input",c)),u.forEach(d=>s.push(ud(d,"terminal-output"))),Kpe(r,s,t)}function Kpe(e,t,n){const r=new IC.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?RC:i.data.layoutWidth??_x,height:a?OC:i.data.layoutHeight??kx})}),t.filter(i=>s.has(i.source)&&s.has(i.target)).forEach(i=>r.setEdge(i.source,i.target)),IC.layout(r),{nodes:e.map(i=>{if(i.parentId)return i;const a=r.node(i.id),l=i.data.kind==="terminal",c=l?RC:i.data.layoutWidth??_x,u=l?OC:i.data.layoutHeight??kx;return{...i,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const Y0=E.createContext(null),W0=E.createContext("horizontal");function Ype({id:e,sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=E.useContext(Y0),[h,p]=E.useState(!1),[m,g,w]=Sg({sourceX:t,sourceY:n,targetX:r,targetY:s,sourcePosition:i,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(_h,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx($de,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${g}px, ${w}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(Nr,{})})]})})]})}function Wpe({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"llm",c=Sd[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Gpe({data:e,selected:t}){const n=E.useContext(Y0),r=E.useContext(W0),s=r==="vertical"?He.Top:He.Left,i=r==="vertical"?He.Bottom:He.Right,a=r==="vertical"?He.Right:He.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Dr,{type:"target",position:s,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(Nr,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(Nr,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(Nr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(Nr,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.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:o.jsx(Vi,{})}),o.jsx(Dr,{type:"source",position:i,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Dr,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Dr,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function qpe({data:e}){const t=E.useContext(W0);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Dr,{type:"target",position:t==="vertical"?He.Top:He.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Dr,{type:"source",position:t==="vertical"?He.Bottom:He.Right,className:"abc-handle"})]})}const Xpe={agent:Wpe,group:Gpe,terminal:qpe},Qpe={insertStep:Ype};function Zpe({draft:e,selectedPath:t,onSelect:n,onAdd:r,onInsert:s,onDelete:i,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=E.useMemo(()=>jC(e,c,a),[]),[d,f,h]=a6(u.nodes),[p,m,g]=o6(u.edges),w=zde(),y=E.useRef(`${c}:${a?"readonly":"editable"}:${MC(e)}`),b=E.useRef(null),{fitView:x}=H0(),_=E.useMemo(()=>jC(e,c,a),[c,e,a]),[k,N]=E.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=E.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=E.useCallback(()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>void x(T))})},[T,x]);E.useEffect(()=>{const I=window.matchMedia("(max-width: 860px)"),j=F=>N(F.matches);return I.addEventListener("change",j),()=>I.removeEventListener("change",j)},[]),E.useEffect(()=>{const I=`${c}:${a?"readonly":"editable"}:${MC(e)}`,j=I!==y.current;y.current=I,m(_.edges),f(F=>{const Y=new Map(F.map(L=>[L.id,L.position]));return _.nodes.map(L=>({...L,position:!j&&Y.get(L.id)?Y.get(L.id):L.position,selected:L.data.kind==="agent"&&!!L.data.path&&Vpe(L.data.path,t)}))}),j&&S()},[_,e,S,t,m,f]),E.useEffect(()=>{S()},[k,S]),E.useEffect(()=>{w&&S()},[_,S,w]),E.useEffect(()=>{if(!a||!b.current)return;const I=new ResizeObserver(()=>S());return I.observe(b.current),S(),()=>I.disconnect()},[S,a]);const R=E.useMemo(()=>a?null:{onAdd:r,onInsert:s,onDelete:i},[r,i,s,a]);return o.jsx(W0.Provider,{value:c,children:o.jsx(Y0.Provider,{value:R,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:b,className:"abc-canvas",children:o.jsxs(i6,{nodes:d,edges:p,nodeTypes:Xpe,edgeTypes:Qpe,onNodesChange:h,onEdgesChange:g,onNodeClick:(I,j)=>{!a&&j.data.kind==="agent"&&j.data.path&&n(j.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(d6,{showInteractive:!1}),Hpe]})})})})})}function Rg(e){return o.jsx(O_,{children:o.jsx(Zpe,{...e})})}const Jpe="doubao-seed-2-1-pro-260628",eme="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",tme=`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Wr(){return{name:"",description:Jpe,instruction:eme,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:Zpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Zc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}function tme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function nme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function U6({title:e,description:t,confirmLabel:n,cancelLabel:r="取消",closeLabel:s="关闭确认框",variant:i="warning",busy:a=!1,onCancel:l,onConfirm:c}){const u=E.useId(),d=E.useId(),f=E.useRef(null),h=E.useRef(a),p=E.useRef(l);return E.useEffect(()=>{h.current=a,p.current=l},[a,l]),E.useEffect(()=>{var y;const m=document.body.style.overflow,g=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(y=f.current)==null||y.focus();const w=b=>{b.key==="Escape"&&!h.current&&p.current()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=m,window.removeEventListener("keydown",w),g!=null&&g.isConnected&&g.focus()}},[]),vs.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&!a&&l()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${i}`,role:"alertdialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":d,"aria-busy":a||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(tme,{})}),o.jsx("h2",{id:u,children:e})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:l,disabled:a,"aria-label":s,children:o.jsx(nme,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:d,children:t})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:f,type:"button",onClick:l,disabled:a,children:r}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:c,disabled:a,children:n})]})]})}),document.body)}const rme=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],sme=[{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"}]}],ime=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function $6(e){const t=e.tools??[],n=dl.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Wr(),name:e.name,description:e.description,instruction:e.instruction||Wr().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($6)}}function ame(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?$6(e.graph):{...Wr(),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 H6(e){return e?1+e.children.reduce((t,n)=>t+H6(n),0):1}function z6(e){return 1+e.subAgents.reduce((t,n)=>t+z6(n),0)}function Ax(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function ome(e){const t=Ax(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function lme(e,t){return e.find(n=>n.kind===t)}function cme(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Og=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],ume=Og.findIndex(e=>e.phase==="build");function V6(e){if(e.status==="success")return Og.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Og.findIndex(r=>r.phase===t);return n<0?0:n}function dme(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function fme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&V6(e)===ume,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` +- 保持礼貌、专业的语气。`;function Wr(){return{name:"",description:eme,instruction:tme,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:Jpe,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:Jc,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}function nme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function rme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function U6({title:e,description:t,confirmLabel:n,cancelLabel:r="取消",closeLabel:s="关闭确认框",variant:i="warning",busy:a=!1,onCancel:l,onConfirm:c}){const u=E.useId(),d=E.useId(),f=E.useRef(null),h=E.useRef(a),p=E.useRef(l);return E.useEffect(()=>{h.current=a,p.current=l},[a,l]),E.useEffect(()=>{var y;const m=document.body.style.overflow,g=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(y=f.current)==null||y.focus();const w=b=>{b.key==="Escape"&&!h.current&&p.current()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=m,window.removeEventListener("keydown",w),g!=null&&g.isConnected&&g.focus()}},[]),vs.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&!a&&l()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${i}`,role:"alertdialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":d,"aria-busy":a||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(nme,{})}),o.jsx("h2",{id:u,children:e})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:l,disabled:a,"aria-label":s,children:o.jsx(rme,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:d,children:t})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:f,type:"button",onClick:l,disabled:a,children:r}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:c,disabled:a,children:n})]})]})}),document.body)}const sme=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率"}],ime=[{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"}]}],ame=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"}];function $6(e){const t=e.tools??[],n=dl.filter(s=>s.toolNames.some(i=>t.includes(i))),r=new Set(n.flatMap(s=>s.toolNames));return{...Wr(),name:e.name,description:e.description,instruction:e.instruction||Wr().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($6)}}function ome(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?$6(e.graph):{...Wr(),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 H6(e){return e?1+e.children.reduce((t,n)=>t+H6(n),0):1}function z6(e){return 1+e.subAgents.reduce((t,n)=>t+z6(n),0)}function Ax(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function lme(e){const t=Ax(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function cme(e,t){return e.find(n=>n.kind===t)}function ume(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(r=>r.name),(n.mcpTools??[]).map(r=>r.name),n.skills??[],(n.selectedSkills??[]).map(r=>r.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Og=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],dme=Og.findIndex(e=>e.phase==="build");function V6(e){if(e.status==="success")return Og.length-1;const t=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",部署完成:"complete"}[e.label],n=Og.findIndex(r=>r.phase===t);return n<0?0:n}function fme(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function hme({task:e}){const t=e.buildLog,n=E.useRef(null),r=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&V6(e)===dme,[s,i]=E.useState(r),[a,l]=E.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` `),f=s?u:d.slice(-36).join(` -`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=dme(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Gs,{"aria-hidden":!0}):o.jsx(d0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function hme({task:e}){const t=V6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx($t,{className:"spin"}):e.status==="success"?o.jsx(CM,{}):e.status==="error"?o.jsx(u0,{}):o.jsx(TE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Og.map((s,i)=>{const a=e.status==="success"||inew Set),[ze,le]=E.useState(()=>new Set),[ve,ct]=E.useState(!1),[ht,G]=E.useState(""),[Z,he]=E.useState(null),[De,qe]=E.useState([]),[nt,Vt]=E.useState([]),[Et,Pt]=E.useState(!1),[Kt,Nt]=E.useState(""),[rn,sn]=E.useState(0),[_t,rt]=E.useState(!1),[Oe,gt]=E.useState(()=>new Set),[Ae,pe]=E.useState(!1),[Je,at]=E.useState(""),[dn,an]=E.useState(""),[pt,Lt]=E.useState(()=>new Set),on=E.useRef(!1),On=E.useRef(""),lr=E.useRef(null),[fn,Bt]=E.useState(sme),[Kn,ue]=E.useState("");E.useEffect(()=>{e.length!==0&&Bt(z=>z.map((se,ye)=>ye===0&&se.agentIds.length===0?{...se,agentIds:e.slice(0,2).map(Ue=>Ue.id)}:se))},[e]);const Se=E.useMemo(()=>{const z=new Map;for(const se of e)se.runtimeId&&z.set(se.runtimeId,se);return z},[e]),Ce=E.useMemo(()=>{var se;const z=new Map;for(const ye of t){const Ue=(se=ye.deploymentTarget)==null?void 0:se.runtimeId;if(!Ue||!Se.has(Ue))continue;const It=z.get(Ue);(!It||ye.updatedAt>It.updatedAt)&&z.set(Ue,ye)}return z},[Se,t]),Qe=E.useMemo(()=>{const z=new Map;for(const se of d){if(!se.runtimeId)continue;const ye=z.get(se.runtimeId);(!ye||se.startedAt>ye.startedAt)&&z.set(se.runtimeId,se)}return z},[d]),ot=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?e.filter(se=>{const ye=se.runtimeId?Ce.get(se.runtimeId):void 0,Ue=se.runtimeId?Qe.get(se.runtimeId):void 0;return[se.label,se.app,se.host??"",(ye==null?void 0:ye.draft.name)??"",(ye==null?void 0:ye.draft.description)??"",(Ue==null?void 0:Ue.runtimeName)??""].join(" ").toLowerCase().includes(z)}):e},[e,Qe,X,Ce]),et=E.useMemo(()=>{const z=X.trim().toLowerCase();return t.filter(se=>{var Ue;const ye=(Ue=se.deploymentTarget)==null?void 0:Ue.runtimeId;return ye&&Se.has(ye)?!1:z?`${se.draft.name} ${se.draft.description}`.toLowerCase().includes(z):!0})},[Se,t,X]),Ct=E.useMemo(()=>t.filter(z=>{var ye;const se=(ye=z.deploymentTarget)==null?void 0:ye.runtimeId;return!se||!Se.has(se)}).length,[Se,t]),Yt=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?fn.filter(se=>se.name.toLowerCase().includes(z)):fn},[fn,X]),oe=e.find(z=>z.id===U),be=t.find(z=>z.id===M),ft=f?d.find(z=>z.id===f):void 0,Ve=oe!=null&&oe.runtimeId?Ce.get(oe.runtimeId):void 0,Ke=g?H:U&&s===U?r:null,dt=E.useMemo(()=>{const z=new Map(e.map((ye,Ue)=>[ye.id,Ue])),se=new Map(n.map((ye,Ue)=>[ye,Ue]));return[...ot].sort((ye,Ue)=>{const It=ye.runtimeId?Qe.get(ye.runtimeId):void 0,Qt=Ue.runtimeId?Qe.get(Ue.runtimeId):void 0,Sn=(It==null?void 0:It.status)==="running"?It.startedAt:0,Mn=(Qt==null?void 0:Qt.status)==="running"?Qt.startedAt:0;if(Sn!==Mn)return Mn-Sn;const Ft=se.get(ye.id),qt=se.get(Ue.id);return Ft!=null&&qt!=null?Ft-qt:Ft!=null?-1:qt!=null?1:(z.get(ye.id)??0)-(z.get(Ue.id)??0)})},[n,e,ot,Qe]),Wt=(oe==null?void 0:oe.label)||(Ke==null?void 0:Ke.name)||(be==null?void 0:be.draft.name)||(ft==null?void 0:ft.runtimeName)||"未选择智能体",cr=fn.find(z=>z.id===Kn),Yn=dt.filter(z=>z.canDelete===!0),hn=dt.filter(z=>bt.has(z.id)&&z.canDelete===!0),Ln=et.filter(z=>ze.has(z.id)),Gt=Yn.length+et.length,Jt=hn.length+Ln.length,Ot=E.useMemo(()=>(ft==null?void 0:ft.agentDraft)??(be==null?void 0:be.draft)??(Ve==null?void 0:Ve.draft)??ame(Ke,(oe==null?void 0:oe.label)??"agent"),[Ke,oe==null?void 0:oe.label,Ve==null?void 0:Ve.draft,be==null?void 0:be.draft,ft==null?void 0:ft.agentDraft]),kn=E.useMemo(()=>{if(Ke)return Ke.tools;const z=(Ot.builtinTools??[]).map(se=>{var ye;return((ye=dl.find(Ue=>Ue.id===se))==null?void 0:ye.label)??se});return Array.from(new Set([...Ot.tools,...z,...(Ot.customTools??[]).map(se=>se.name),...(Ot.mcpTools??[]).map(se=>se.name)].filter(Boolean)))},[Ot,Ke]),Nn=E.useMemo(()=>Ke?Ke.skillsPreviewSupported?Ke.skills.map(z=>z.name):null:Array.from(new Set([...(Ot.selectedSkills??[]).map(z=>z.name),...Ot.skills].filter(Boolean))),[Ot,Ke]),en=E.useMemo(()=>{if(ft)return ft;if(be)return d.filter(z=>{var se,ye;return((se=z.agentDraft)==null?void 0:se.name)===be.draft.name||z.runtimeName===be.draft.name||!!((ye=be.deploymentTarget)!=null&&ye.runtimeId)&&z.runtimeId===be.deploymentTarget.runtimeId}).sort((z,se)=>se.startedAt-z.startedAt)[0];if(oe)return d.filter(z=>!!oe.runtimeId&&z.runtimeId===oe.runtimeId||z.runtimeName===oe.label).sort((z,se)=>se.startedAt-z.startedAt)[0]},[d,oe,be,ft]),tr=!!(f&&en&&en.id===f),Wn=!!(en&&(en.status!=="success"||tr)),pr=E.useMemo(()=>cme(Ot),[Ot]),nr=(oe==null?void 0:oe.currentVersion)??(D==null?void 0:D.currentVersion)??null,Si=nr??(ft==null?void 0:ft.startedAt)??"unknown",Xs=Ke?`runtime:${(oe==null?void 0:oe.runtimeId)??Ke.name}:v${Si}:${pr}`:`draft:${(ft==null?void 0:ft.id)??(be==null?void 0:be.id)??(oe==null?void 0:oe.id)??Wt}:${pr}`,Zr=!!(g&&(oe!=null&&oe.runtimeId)&&!P);E.useEffect(()=>{if(!f)return;const z=d.find(ye=>ye.id===f),se=z!=null&&z.runtimeId?Se.get(z.runtimeId):void 0;if(se){O(""),C(se.id),L("basic");return}C(""),O(""),L("basic")},[Se,d,f]),E.useEffect(()=>{if(!h){On.current="";return}const z=`${h}:${p}:${m}`;On.current!==z&&e.some(se=>se.id===h)&&(On.current=z,O(""),C(h),L(p),p==="evaluations"&&(J(m),ee("")))},[e,h,p,m]),E.useEffect(()=>{let z=!1;if(W(null),te(!g||!(oe!=null&&oe.runtimeId)||!oe.region),!(!g||!(oe!=null&&oe.runtimeId)||!oe.region))return jv(oe.runtimeId,oe.region,oe.runtimeApp).then(se=>{z||W(se)}).catch(()=>{z||W(null)}).finally(()=>{z||te(!0)}),()=>{z=!0}},[g,oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeApp,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(A(null),!(!(oe!=null&&oe.runtimeId)||!oe.region))return Dv(oe.runtimeId,oe.region).then(se=>{z||A(se)}).catch(()=>{z||A(null)}),()=>{z=!0}},[oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(qe([]),Vt([]),Nt(""),Y!=="evaluations"||!(oe!=null&&oe.runtimeId)||!oe.region){Pt(!1);return}return Pt(!0),WM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,pageSize:100}).then(se=>{z||(Vt(se.sets),qe(se.items.map(ye=>({...ye,tag:ye.kind==="good"?"Good case":"Bad case"})).sort((ye,Ue)=>Ax(Ue.createdAt)-Ax(ye.createdAt))))}).catch(se=>{z||Nt(se instanceof Error?se.message:String(se))}).finally(()=>{z||Pt(!1)}),()=>{z=!0}},[rn,Y,oe==null?void 0:oe.app,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(De.map(se=>se.id));gt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),Lt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),dn&&!z.has(dn)&&an("")},[De,dn]),E.useEffect(()=>{rt(!1),gt(new Set),Lt(new Set),at(""),an("")},[oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(dt.filter(se=>se.canDelete===!0).map(se=>se.id));Ze(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[dt]),E.useEffect(()=>{const z=new Set(et.map(se=>se.id));le(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[et]);const Ar=oe!=null&&oe.runtimeId?De:rme,Ts=Ar.filter(z=>{if(z.kind!==ce)return!1;const se=fe.trim().toLowerCase();return se?[z.input,z.output,z.referenceOutput,z.comment,z.tag??"",z.sessionId,z.messageId,z.userId,z.evaluationSetName].join(" ").toLowerCase().includes(se):!0}),Qs=Ts.filter(z=>Oe.has(z.id)),ka=!!(oe!=null&&oe.runtimeId),Ur=z=>{J(z),ee(""),at("");const se=Ar.find(ye=>ye.kind===z);an((se==null?void 0:se.id)??""),window.setTimeout(()=>{var ye;(ye=lr.current)==null||ye.scrollIntoView({behavior:"smooth",block:"start"})},0)},wo=z=>{at(""),gt(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},Na=()=>{at(""),gt(new Set(Ts.map(z=>z.id)))},Zs=()=>{at(""),gt(new Set),rt(!1)},Cl=z=>{Lt(se=>{const ye=new Set(se);return ye.has(z)?ye.delete(z):ye.add(z),ye})},Js=z=>{an(z.id),at(""),!(!z.sessionId||!z.messageId)&&(N==null||N(z))},Il=async z=>{if(!(oe!=null&&oe.runtimeId)||!oe.region||Ae||z.length===0)return;const se=z.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${z.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(se))return;const ye=z.map(It=>It.id),Ue=new Set(ye);pe(!0),at("");try{await GM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,itemIds:ye});const It=new Map;for(const Qt of z)It.set(Qt.kind,(It.get(Qt.kind)??0)+1);qe(Qt=>Qt.filter(Sn=>!Ue.has(Sn.id))),Vt(Qt=>Qt.map(Sn=>({...Sn,itemCount:Math.max(0,Sn.itemCount-(It.get(Sn.kind)??0))}))),gt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),Lt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),dn&&Ue.has(dn)&&an(""),z.length>1&&rt(!1),T==null||T(z)}catch(It){at(It instanceof Error?It.message:String(It))}finally{pe(!1)}},vo=z=>{Bt(se=>se.map(ye=>ye.id===z.id?z:ye))},_o=()=>{const z=new Set(e.map(Ue=>Ue.id)),se=n.filter(Ue=>z.has(Ue)),ye=new Set(se);return[...se,...e.filter(Ue=>!ye.has(Ue.id)).map(Ue=>Ue.id)]},Sa=(z,se,ye)=>{if(!y||z===se)return;const Ue=_o().filter(Sn=>Sn!==z),It=Ue.indexOf(se),Qt=It<0?Ue.length:ye==="after"?It+1:It;Ue.splice(Qt,0,z),y(Ue)},mr=(z,se)=>{if(!Ee||Ee===se)return;const ye=z.currentTarget.getBoundingClientRect();we(se),Re(z.clientY>ye.top+ye.height/2?"after":"before")},ko=(z,se)=>{if(!y)return;const ye=_o(),Ue=ye.indexOf(z),It=Math.max(0,Math.min(ye.length-1,Ue+se));Ue<0||Ue===It||(ye.splice(Ue,1),ye.splice(It,0,z),y(ye))},No=z=>{z.canDelete===!0&&(G(""),Ze(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye}))},Rl=z=>{G(""),le(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},ju=()=>{G(""),Ze(new Set(Yn.map(z=>z.id))),le(new Set(et.map(z=>z.id)))},As=()=>{G(""),Ze(new Set),le(new Set),Le(!1)},Cs=()=>{if(Jt===0||ve)return;const z=hn.length,se=Ln.length;G(""),he({kind:"selection",title:z===1&&se===0?"删除 Agent?":z===0&&se===1?"删除草稿?":"删除所选项目?",description:z===1&&se===0?`"${hn[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:z===0&&se===1?`"${Ln[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${Jt} 个项目。${z>0?`${z} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:z===0&&se===1?"删除草稿":"删除所选",agents:hn,drafts:Ln})},Ta=async()=>{if(!(!Z||ve)){ct(!0),G("");try{if(Z.kind==="selection"){const{agents:z,drafts:se}=Z;if(z.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(z)}se.length>0&&(x==null||x(se)),Ze(new Set),le(new Set),Le(!1),z.some(ye=>ye.id===U)&&C(""),se.some(ye=>ye.id===M)&&O("")}else if(Z.kind==="agent"){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b([Z.agent]),U===Z.agent.id&&C("")}else{if(!x)throw new Error("当前页面不支持删除草稿。");x([Z.draft]),M===Z.draft.id&&O("")}he(null)}catch(z){G(z instanceof Error?z.message:String(z))}finally{ct(!1)}}},Ol=z=>{!b||z.canDelete!==!0||ve||(G(""),he({kind:"agent",title:"删除 Agent?",description:`"${z.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:z}))},So=z=>{if(!x||ve)return;const se=z.draft.name||"未命名 Agent";G(""),he({kind:"draft",title:"删除草稿?",description:`"${se}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:z})},ei=()=>{const z=`eval-${Date.now()}`,se={id:z,name:`新评测组 ${fn.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Bt(ye=>[se,...ye]),ue(z)},xt=z=>{vo({...z,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+z.history.length%7,status:"completed"},...z.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:j==="library"?"is-active":"","aria-pressed":j==="library",onClick:()=>{F("library"),ne("")},children:"智能体库"}),o.jsx("button",{type:"button",className:j==="evaluation"?"is-active":"","aria-pressed":j==="evaluation",onClick:()=>{F("evaluation"),ne("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":j==="evaluation"||void 0,ref:z=>z==null?void 0:z.toggleAttribute("inert",j==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":j==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{value:X,onChange:z=>ne(z.currentTarget.value),placeholder:j==="library"?"搜索智能体":"搜索评测组","aria-label":j==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:j==="library"?S:ei,disabled:j==="library"&&!a,children:[o.jsx(kr,{"aria-hidden":!0}),o.jsx("span",{children:j==="library"?"新建 Agent":"新建评测组"})]}),j==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${Ye?" is-active":""}`,children:Ye?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Jt," 个"]}),o.jsx("button",{type:"button",onClick:ju,disabled:Gt===0||ve,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Cs(),disabled:Jt===0||ve,children:ve?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:As,disabled:ve,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{G(""),Le(!0)},disabled:Gt===0,children:"选择"})}),j==="library"&&ht&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ht}),o.jsx("div",{className:"aw-agent-list",children:j==="evaluation"?Yt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Yt.map(z=>o.jsxs("button",{type:"button",className:`aw-agent-item${z.id===Kn?" is-active":""}`,onClick:()=>ue(z.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:z.name}),o.jsxs("small",{children:[z.agentIds.length," 个智能体 · ",z.history.length," 次运行"]})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)):c&&dt.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&dt.length===0&&et.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):dt.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[et.map(z=>{const se=d.filter(Ue=>{var It,Qt;return((It=Ue.agentDraft)==null?void 0:It.name)===z.draft.name||Ue.runtimeName===z.draft.name||!!((Qt=z.deploymentTarget)!=null&&Qt.runtimeId)&&Ue.runtimeId===z.deploymentTarget.runtimeId}).sort((Ue,It)=>It.startedAt-Ue.startedAt)[0],ye=ze.has(z.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Ye?"is-selecting":"",ye?"is-selected-for-delete":"",z.id===M?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Ye?ye:void 0,onClick:()=>{if(Ye){Rl(z);return}C(""),O(z.id),L("basic")},children:[Ye&&o.jsx("span",{className:`aw-select-marker${ye?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(se==null?void 0:se.status)==="running"?" is-deploying":""}`,children:(se==null?void 0:se.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:z.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)}),dt.map(z=>{const se=z.runtimeId?Qe.get(z.runtimeId):void 0,ye=z.runtimeId?Ce.get(z.runtimeId):void 0,Ue=bt.has(z.id),It=z.canDelete===!0,Qt=(se==null?void 0:se.status)==="running"?{label:"部署中",className:" is-deploying"}:(se==null?void 0:se.status)==="error"?{label:"失败",className:" is-error"}:(se==null?void 0:se.status)==="cancelled"?{label:"已取消",className:" is-muted"}:ye?{label:"待更新",className:""}:null,Sn=(se==null?void 0:se.status)==="running"?"正在更新部署":ye?"待更新":z.remote?z.host||"远程智能体":"本地智能体",Mn=["aw-agent-item","aw-agent-item--sortable",z.id===U?"is-active":"",Ye?"is-selecting":"",Ue?"is-selected-for-delete":"",Ye&&!It?"is-selection-disabled":"",z.id===Ee?"is-dragging":"",z.id===xe&&z.id!==Ee?`is-drop-target is-drop-${Te}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!Ye,className:Mn,"aria-pressed":Ye?Ue:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ft=>{y&&(on.current=!0,ge(z.id),Ft.dataTransfer.effectAllowed="move",Ft.dataTransfer.setData("text/plain",z.id))},onDragEnter:Ft=>{mr(Ft,z.id)},onDragOver:Ft=>{!Ee||Ee===z.id||(Ft.preventDefault(),Ft.dataTransfer.dropEffect="move",mr(Ft,z.id))},onDragLeave:Ft=>{const qt=Ft.relatedTarget;qt instanceof Node&&Ft.currentTarget.contains(qt)||xe===z.id&&we("")},onDrop:Ft=>{Ft.preventDefault();const qt=Ft.dataTransfer.getData("text/plain")||Ee;Sa(qt,z.id,Te),ge(""),we(""),Re("before")},onDragEnd:()=>{ge(""),we(""),Re("before"),window.setTimeout(()=>{on.current=!1},0)},onKeyDown:Ft=>{Ft.altKey&&(Ft.key==="ArrowUp"?(Ft.preventDefault(),ko(z.id,-1)):Ft.key==="ArrowDown"&&(Ft.preventDefault(),ko(z.id,1)))},onClick:Ft=>{if(Ye){Ft.preventDefault(),No(z);return}if(on.current){Ft.preventDefault(),on.current=!1;return}O(""),C(z.id),L("basic"),_(z.id)},children:[Ye&&o.jsx("span",{className:`aw-select-marker${Ue?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.label}),z.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",z.currentVersion]}),Qt&&o.jsx("span",{className:`aw-draft-badge${Qt.className}`,children:Qt.label})]}),o.jsx("small",{children:Sn})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",j==="library"?e.length+Ct:fn.length," 个"]})]}),j==="evaluation"&&cr?o.jsx(gme,{group:cr,agents:e,cases:Ar,onChange:vo,onRun:xt}):j==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!oe&&!be&&!ft?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[oe&&!Ke&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Wt}),nr!=null&&o.jsxs("span",{children:["v",nr]}),be&&o.jsx("span",{children:"草稿"}),Ve&&o.jsx("span",{children:"待更新"}),!oe&&!be&&ft&&o.jsx("span",{children:ft.label})]}),o.jsx("p",{children:Ot.description||(i||g&&!P?"正在读取智能体信息…":"暂无描述")})]}),(be||Ve||(oe==null?void 0:oe.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(be||Ve)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const z=be??Ve;z&&So(z)},disabled:ve,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(oe==null?void 0:oe.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void Ol(oe),disabled:ve,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:ve?"删除中…":"删除 Agent"})]})]})]}),en&&Wn&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(hme,{task:en})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:ime.map(z=>o.jsx("button",{type:"button",className:Y===z.id?"is-active":"","aria-pressed":Y===z.id,onClick:()=>L(z.id),children:z.label},z.id))}),o.jsxs("div",{className:"aw-content",children:[Y==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(D==null?void 0:D.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(D==null?void 0:D.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(D==null?void 0:D.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(D==null?void 0:D.region)||(oe==null?void 0:oe.region)||(en==null?void 0:en.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:D!=null&&D.networkTypes.length?D.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:Zr?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Rg,{draft:Ot,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Xs)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(Ke==null?void 0:Ke.model)||Ot.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:Ke!=null&&Ke.graph?H6(Ke.graph):z6(Ot)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:kn.length?kn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:Nn===null?"暂不支持预览":Nn.length?Nn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:nr!=null?`v${nr}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:be?"草稿":(en==null?void 0:en.status)==="error"?"部署失败":(en==null?void 0:en.status)==="cancelled"?"已取消":Ve?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([z,se])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:z}),o.jsx("small",{children:se})]})]},z))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),Y==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[oe!=null&&oe.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(z=>{const se=lme(nt,z),ye=(se==null?void 0:se.itemCount)??De.filter(Ue=>Ue.kind===z).length;return o.jsxs("button",{type:"button",onClick:()=>Ur(z),children:[o.jsx("strong",{children:ye}),o.jsx("span",{children:z==="good"?"Good cases":"Bad cases"})]},z)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(z=>o.jsx("button",{type:"button",className:ce===z?"is-active":"","aria-pressed":ce===z,onClick:()=>J(z),children:z==="good"?"Good case":"Bad case"},z))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:fe,onChange:z=>ee(z.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),ka&&o.jsx("div",{className:`aw-case-toolbar${_t?" is-active":""}`,children:_t?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Qs.length," 条"]}),o.jsx("button",{type:"button",onClick:Na,disabled:Ts.length===0||Ae,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Il(Qs),disabled:Qs.length===0||Ae,children:Ae?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Zs,disabled:Ae,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{at(""),rt(!0)},disabled:Ts.length===0||Ae,children:"选择案例"})}),Je&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Je}),o.jsx("div",{ref:lr,children:o.jsx(mme,{cases:Ts,loading:Et,error:Kt,runtimeBacked:!!(oe!=null&&oe.runtimeId),selectionMode:_t,selectedCaseIds:Oe,focusedCaseId:dn,expandedCaseIds:pt,deleting:Ae,canDelete:ka,onOpenCase:Js,onToggleCase:wo,onToggleExpanded:Cl,onDeleteCase:z=>void Il([z]),onRetry:()=>sn(z=>z+1)})})]})]}),Y==="basic"&&(oe||be)&&o.jsxs("div",{className:"aw-basic-actions",children:[oe&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(oe.id),children:[o.jsx(cV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:be||Ve?!a:!(oe!=null&&oe.runtimeId)||!l||!i&&!Ke,onClick:()=>be?I==null?void 0:I(be):Ve?I==null?void 0:I(Ve):R(Ot),children:be||Ve?"继续编辑":"更新"})]})]})]}),j==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),Z&&o.jsx(U6,{variant:"danger",title:Z.title,description:Z.description,confirmLabel:ve?"删除中...":Z.confirmLabel,closeLabel:"关闭删除确认",busy:ve,onCancel:()=>he(null),onConfirm:()=>void Ta()})]})}function mme({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(Vi,{"aria-hidden":!0})})]}),o.jsx("small",{children:ome(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function gme({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Zz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Gs,{}),"已完成"]}),o.jsx(Hd,{"aria-hidden":!0})]},f.id))})]})})]})}const DC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],yme=100,bme=3e4,yc=new Map,Lc=new Map,Eme=new Set;function PC(e){if(!e){yc.clear(),Lc.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,r]of Lc)r.page.runtimes.some(s=>t.has(s.runtimeId))&&Lc.delete(n);yc.clear()}}function xme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function wme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function vme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function _me(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function kme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function BC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:kme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function Nme(e,t,n){const r=`${e}:${t}`,s=Lc.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(BC)),s.page.nextToken;s&&Lc.delete(r);let i=yc.get(r);i||(i=Cc({scope:"mine",region:e,pageSize:yme,nextToken:t}),yc.set(r,i),i.then(()=>yc.delete(r),()=>yc.delete(r)));const a=await i;return Lc.set(r,{page:a,expiresAt:Date.now()+bme}),n(a.runtimes.map(BC)),a.nextToken}function Sme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function Tme({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s="",hiddenRuntimeIds:i=Eme}){const a=E.useRef(null),l=E.useRef(null),c=E.useRef(0),[u,d]=E.useState("general"),[f,h]=E.useState("cn-beijing"),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState([]),[x,_]=E.useState(""),[k,N]=E.useState(!0),[T,S]=E.useState(""),[R,I]=E.useState(""),j=E.useCallback((H,W)=>{const P=++c.current;return N(!0),S(""),Nme(f,H,te=>{c.current===P&&b(X=>W?te:[...X,...te])}).then(te=>{c.current===P&&_(te)}).catch(te=>{c.current===P&&S(te instanceof Error?te.message:String(te))}).finally(()=>{c.current===P&&N(!1)})},[f]);E.useEffect(()=>(b([]),_(""),j("",!0),()=>{c.current+=1}),[j]),E.useEffect(()=>{const H=l.current,W=a.current;if(!H||!W||u!=="general"||!x||k)return;const P=new IntersectionObserver(([te])=>{te.isIntersecting&&j(x,!1)},{root:W,rootMargin:"180px 0px",threshold:.01});return P.observe(H),()=>P.disconnect()},[u,j,k,x]);const F=E.useCallback(async H=>{if(!R){I(H.id);try{await new Promise(W=>requestAnimationFrame(()=>W())),await n(H)}finally{I("")}}},[R,n]),Y=E.useMemo(()=>{if(u!=="general")return[];const H=g.trim().toLocaleLowerCase(),W=H?y.filter(X=>X.name.toLocaleLowerCase().includes(H)):y,P=i.size>0?W.filter(X=>!X.runtime||!i.has(X.runtime.runtimeId)):W,te=P.findIndex(X=>{var ne;return((ne=X.runtime)==null?void 0:ne.runtimeId)===s});return te<=0?P:[P[te],...P.slice(0,te),...P.slice(te+1)]},[u,s,i,g,y]),L=DC.find(H=>H.id===u),U=(L==null?void 0:L.label)??"智能体",C=(L==null?void 0:L.createLabel)??"添加智能体",M=u==="general"&&k&&y.length===0,O=!M&&Y.length===0,D=u==="openclaw"||u==="hermes"?"暂未开放":g.trim()?"没有匹配的智能体":`${U}暂无内容`,A=u==="general"?()=>e(f):u==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:H=>{H.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(H=>!H),children:[o.jsx("span",{children:f==="cn-beijing"?"北京":"上海"}),o.jsx(vme,{className:`my-agents-region-chevron${p?" is-open":""}`})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(H=>{const W=H.value===f;return o.jsxs("button",{type:"button",role:"option","aria-selected":W,className:`my-agents-region-option${W?" is-selected":""}`,onClick:()=>{h(H.value),m(!1)},children:[o.jsx("span",{children:H.label}),W&&o.jsx(_me,{})]},H.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(xme,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:g,onChange:H=>w(H.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:DC.map(H=>o.jsx("button",{type:"button",className:`my-agent-type-pill${u===H.id?" is-active":""}`,"aria-pressed":u===H.id,onClick:()=>d(H.id),children:H.label},H.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!A,onClick:()=>A==null?void 0:A(),children:[o.jsx(wme,{}),C]})]}),o.jsxs("section",{className:"my-agent-results",ref:a,"aria-label":`${U}列表`,children:[M?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):T&&u==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T}),o.jsx("button",{type:"button",onClick:()=>void j("",!0),children:"重新加载"})]}):O?o.jsxs("div",{className:"my-agent-empty",children:[!g.trim()&&u==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(f),children:"点此创建"})]}):o.jsx("p",{children:D}),g.trim()&&u!=="openclaw"&&u!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:Y.map(H=>{var W;return o.jsx(Sme,{agent:H,onUse:F,onViewDetails:r,connecting:H.id===R,connected:((W=H.runtime)==null?void 0:W.runtimeId)===s},H.id)})}),u==="general"&&Y.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:l,"aria-live":"polite",children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):x?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const Ame={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 Cme(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 Ime(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Rme(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function B_(e,t){if(Ime(e))return Cme(t,e.path);if(Rme(e)){const n=Ame[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=B_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Ome(e,t){const n=B_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const K6=new Map;function Tl(e,t){K6.set(e,t)}function Lme(e){return K6.get(e)}function Mme(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;iB_(r,e.dataModel),resolveString:r=>Ome(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Lme(s.component)??jme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Pme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 F_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(ul,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(Tr,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(TM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(Tr,{})}):null]}):null]})}function U_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function W6(e){var n,r,s,i;const t=U_(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 G6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function q6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?ej(t,e.uri):""}function Bme({kind:e}){return e==="image"?o.jsx(_v,{}):e==="video"?o.jsx(IM,{}):e==="pdf"?o.jsx(Xz,{}):o.jsx(wv,{})}function $_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=U_(a.mimeType),c=q6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(yV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Bme,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:W6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":G6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(Ac,{className:"media-card-open"}):null]});return o.jsxs(nn.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(_M,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(Tr,{})}):null]},a.id)})}),o.jsx(di,{children:s?o.jsx(Fme,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function Fme({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>q6(t,e),[e,t]),s=U_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[W6(t),t.sizeBytes?` · ${G6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(Tr,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx($t,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(yh,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function Ume(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 $me(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 X6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function Hme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function zme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Vme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function Kme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Yme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function Q6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Wme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(Ea,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(Q6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const Gme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:Ume},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Yme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:$me},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:X6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:Hme},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:zme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Vme},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:Kme}};function qme(e){return Gme[e]}const Z6="send_a2ui_json_to_client",Xme=28;function Qme(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Zme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function J6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function Jme({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 ege(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 tge(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 e5({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=J6(c,!t||n,r),{ref:d,onScroll:f}=Pme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(Jme,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(Ea,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx($s,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function t5(){return o.jsx(e5,{text:"",done:!1})}const nge=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=J6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:s})}):null});function rge({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===Z6?"渲染 UI":e,l=qme(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 o.jsxs(nn.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(Wme,{definition:l,label:tge(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(ege,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(Ea,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(Q6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function sge({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(wv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(xv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(f0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(Tr,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function ige({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(nn.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(hT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(nn.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(hT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function H_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(e5,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(nge,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx($_,{appName:t,items:c.files},u);case"artifact":return o.jsx(sge,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(F_,{value:c.value},u);case"tool":return c.name===Z6&&c.done?null:o.jsx(rge,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(ige,{block:c,onAuth:i},u);case"a2ui":return Y6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(nn.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Dme,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function n5(e){return e.isComposing||e.keyCode===229}const age="/assets/arkclaw-DG3MhHYM.png",oge="/assets/codex-Csw-JJxq.png",lge="/assets/hermes-C6L-CfGS.png",si=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],cge=[{label:"ArkClaw",logo:age},{label:"Hermes 智能体",logo:lge}];function FC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Xc,{className:"new-chat-mode__agent-icon"})}function uge(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function dge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>si.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=si.find(k=>k.value===e)??si[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var T;(T=f.current)!=null&&T.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+si.length)%si.length;while(w(si[N]));d(N),c(si[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(si.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(si[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(FC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(si[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:si.map((k,N)=>{const T=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(FC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),T?o.jsx(uge,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:oge,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),cge.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const r5={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},fge={ppt:[],image:[],video:["video_task_query"]},z_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function UC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function hge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function pge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function mge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const gge=[{icon:hge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:pge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:mge,text:"帮我整理并润色一段内容,让表达更清晰"}],$C=[{value:"ppt",label:"PPT",icon:hV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:_v,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:X6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function yge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:T,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:j=!1,builtinTools:F=[]}){const Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null),C=E.useRef(null),[M,O]=E.useState(!1),[D,A]=E.useState(null),[H,W]=E.useState(0),[P,te]=E.useState(!1);async function X(){if(e)try{await navigator.clipboard.writeText(e),te(!0),setTimeout(()=>te(!1),1500)}catch{te(!1)}}E.useLayoutEffect(()=>{const le=Y.current;le&&(le.style.height="auto",le.style.height=`${Math.min(le.scrollHeight,200)}px`)},[s]);const ne=x==="skill-create";E.useEffect(()=>{ne&&(O(!1),A(null))},[ne]);const ce=!ne&&d.some(le=>le.status!=="ready"),J=!l&&!c&&!ce&&(s.trim().length>0||!ne&&d.length>0),fe=(D==null?void 0:D.query.toLocaleLowerCase())??"",ee=(D==null?void 0:D.kind)==="skill"?f.filter(le=>!p.skills.some(ve=>ve.name===le.name)).filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"skill",value:le})):(D==null?void 0:D.kind)==="agent"?h.filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"agent",value:le})):[];function Ee(le){var ve;O(!1),A(null),(ve=le.current)==null||ve.click()}function ge(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(le.length,le.length)})}function xe(le){S==null||S(le.value),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(s.length,s.length)})}function we(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ht,G,Z;(ht=Y.current)==null||ht.focus();const ve=le.indexOf("【"),ct=le.indexOf("】",ve+1);ve>=0&&ct>ve?(G=Y.current)==null||G.setSelectionRange(ve+1,ct):(Z=Y.current)==null||Z.setSelectionRange(le.length,le.length)})}function Te(){S==null||S(null),i(""),O(!1),A(null),requestAnimationFrame(()=>{var le,ve;(le=Y.current)==null||le.focus(),(ve=Y.current)==null||ve.setSelectionRange(0,0)})}const Re=$C.find(le=>le.value===_),Ye=$C.filter(le=>r5[le.value].every(ve=>F.includes(ve)));function Le(le,ve){const ct=le.slice(0,ve),ht=/(^|\s)([/@])([^\s/@]*)$/.exec(ct);if(!ht){A(null);return}const G=ht[2].length+ht[3].length,Z={kind:ht[2]==="/"?"skill":"agent",query:ht[3],start:ve-G,end:ve},he=!D||D.kind!==Z.kind||D.query!==Z.query||D.start!==Z.start||D.end!==Z.end;A(Z),he&&W(0),O(!1)}function bt(le){if(!D)return;const ve=s.slice(0,D.start)+s.slice(D.end);i(ve),le.kind==="skill"?w({...p,skills:[...p.skills,le.value]}):w({skills:[],targetAgent:le.value});const ct=D.start;A(null),requestAnimationFrame(()=>{var ht,G;(ht=Y.current)==null||ht.focus(),(G=Y.current)==null||G.setSelectionRange(ct,ct)})}function Ze(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function ze(le){const ve=le.target.files?Array.from(le.target.files):[];ve.length&&y(ve),le.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${ne?" composer--skill-mode":""}${Re?` composer--has-task composer--task-${Re.value}`:""}`,children:[ne?null:o.jsx(F_,{value:p,onRemoveSkill:le=>w({...p,skills:p.skills.filter(ve=>ve.name!==le)}),onRemoveAgent:()=>w({skills:[]})}),!ne&&d.length>0&&o.jsx($_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[D?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":D.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[D.kind==="skill"?o.jsx(ul,{}):o.jsx(TM,{}),o.jsx("span",{children:D.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:D.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx($t,{className:"spin"})," 正在读取 Agent 能力…"]}):ee.length===0?o.jsx("div",{className:"composer-command-empty",children:D.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:ee.map((le,ve)=>o.jsxs("button",{type:"button",role:"option","aria-selected":ve===H,className:`composer-command-item${ve===H?" is-active":""}`,onMouseDown:ct=>{ct.preventDefault(),bt(le)},onMouseEnter:()=>W(ve),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${le.kind}`,children:le.kind==="skill"?o.jsx(ul,{}):o.jsx(cl,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[le.kind==="skill"?"/":"@",le.value.name]}),o.jsx("span",{children:le.value.description||(le.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:ve===H?"↵":le.kind==="skill"?"技能":"Agent"})]},`${le.kind}-${le.value.name}`))})]}):null,ne?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{A(null),O(le=>!le)},children:o.jsx(kr,{className:"icon"})}),M&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>O(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(L),children:[o.jsx(_v,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(U),children:[o.jsx(wv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(C),children:[o.jsx(IM,{className:"icon"}),"上传视频"]})]})]})]}),N&&T?o.jsx(dge,{value:x,onChange:T,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Re&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Re.value}`,"aria-label":`取消${Re.label}任务`,disabled:c,onClick:Te,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Re.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(Tr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Re.label})]}):null,k&&ne&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(UC,{className:"new-chat-task-chip__task-icon"}),o.jsx(Tr,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:Y,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:ne?`描述你想创建的 Skill,将使用 ${z_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!D,onChange:le=>{i(le.target.value),ne||Le(le.target.value,le.target.selectionStart)},onSelect:le=>{ne||Le(le.currentTarget.value,le.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:le=>{if(!n5(le.nativeEvent)){if(D){if(le.key==="ArrowDown"&&ee.length>0){le.preventDefault(),W(ve=>(ve+1)%ee.length);return}if(le.key==="ArrowUp"&&ee.length>0){le.preventDefault(),W(ve=>(ve-1+ee.length)%ee.length);return}if((le.key==="Enter"||le.key==="Tab")&&ee[H]){le.preventDefault(),bt(ee[H]);return}if(le.key==="Escape"){le.preventDefault(),A(null);return}}if(le.key==="Backspace"&&!s&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){Ze();return}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),J&&a())}}})}),o.jsx(nn.button,{type:"button",className:"comp-send",disabled:!J,onClick:a,"aria-label":"发送",whileTap:J?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx($t,{className:"icon spin"}):o.jsx(SM,{className:"icon"})})]}),k&&x==="agent"&&j&&!Re?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ye.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>xe(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le.label})]},le.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(UC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Re?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Re.label}企业提示词`,children:Re.prompts.map(le=>{const ve=Re.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>we(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le})]},le)})}):null,k&&x==="agent"&&!j&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:gge.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ge(le.text),children:[o.jsx(ve,{}),o.jsx("span",{children:le.text})]},le.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:P?"已复制":"复制会话 ID","aria-label":P?"已复制会话 ID":"复制会话 ID",onClick:()=>void X(),children:P?o.jsx(Gs,{}):o.jsx(d0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:L,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:U,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ze})]})}function s5({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(nn.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx($s,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const V_=Symbol.for("yaml.alias"),Cx=Symbol.for("yaml.document"),oo=Symbol.for("yaml.map"),i5=Symbol.for("yaml.pair"),Ki=Symbol.for("yaml.scalar"),Iu=Symbol.for("yaml.seq"),Ys=Symbol.for("yaml.node.type"),Ru=e=>!!e&&typeof e=="object"&&e[Ys]===V_,Nh=e=>!!e&&typeof e=="object"&&e[Ys]===Cx,Sh=e=>!!e&&typeof e=="object"&&e[Ys]===oo,er=e=>!!e&&typeof e=="object"&&e[Ys]===i5,bn=e=>!!e&&typeof e=="object"&&e[Ys]===Ki,Th=e=>!!e&&typeof e=="object"&&e[Ys]===Iu;function Zn(e){if(e&&typeof e=="object")switch(e[Ys]){case oo:case Iu:return!0}return!1}function Jn(e){if(e&&typeof e=="object")switch(e[Ys]){case V_:case oo:case Ki:case Iu:return!0}return!1}const a5=e=>(bn(e)||Zn(e))&&!!e.anchor,Bo=Symbol("break visit"),bge=Symbol("skip children"),nf=Symbol("remove node");function Ou(e,t){const n=Ege(t);Nh(e)?bc(null,e.contents,n,Object.freeze([e]))===nf&&(e.contents=null):bc(null,e,n,Object.freeze([]))}Ou.BREAK=Bo;Ou.SKIP=bge;Ou.REMOVE=nf;function bc(e,t,n,r){const s=xge(e,t,n,r);if(Jn(s)||er(s))return wge(e,r,s),bc(e,s,n,r);if(typeof s!="symbol"){if(Zn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>vge[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+_ge(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&&Jn(t.contents)){const i={};Ou(t.contents,(a,l)=>{Jn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` -`)}}Kr.defaultYaml={explicit:!1,version:"1.2"};Kr.defaultTags={"!!":"tag:yaml.org,2002:"};function o5(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 l5(e){const t=new Set;return Ou(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function c5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function kge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=l5(e));const a=c5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(bn(a.node)||Zn(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function Ec(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;szs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!a5(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 K_{constructor(t){Object.defineProperty(this,Ys,{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(!Nh(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},l=zs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?Ec(i,{"":l},"",l):l}}class Y_ extends K_{constructor(t){super(V_),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=[],Ou(t,{Node:(i,a)=>{(Ru(a)||a5(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 l=r.get(a);if(l||(zs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=xm(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(o5(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 xm(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(Zn(t)){let r=0;for(const s of t.items){const i=xm(e,s,n);i>r&&(r=i)}return r}else if(er(t)){const r=xm(e,t.key,n),s=xm(e,t.value,n);return Math.max(r,s)}return 1}const u5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends K_{constructor(t){super(Ki),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:zs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const Nge="tag:yaml.org,2002:";function Sge(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 Gf(e,t,n){var f,h,p;if(Nh(e)&&(e=e.contents),Jn(e))return e;if(er(e)){const m=(h=(f=n.schema[oo]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new Y_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Nge+t.slice(2));let u=Sge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[oo]:Symbol.iterator in Object(e)?a[Iu]:a[oo]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Lg(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 Gf(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 Td=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class d5 extends K_{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=>Jn(r)||er(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Td(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Zn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(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(Zn(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&&bn(i)?i.value:i:Zn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!er(n))return!1;const r=n.value;return r==null||t&&bn(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 Zn(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(Zn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Tge=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ca(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Go=(e,t,n)=>e.endsWith(` +`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(E.useEffect(()=>{t&&i(r)},[e.id,t==null?void 0:t.status,r]),E.useEffect(()=>{if(!s||!c)return;const b=n.current;b&&(b.scrollTop=b.scrollHeight)},[s,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=fme(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",g=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",w=[m,t.lineCount?`${t.lineCount} 行`:"",g,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${s?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>i(b=>!b),children:s?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Gs,{"aria-hidden":!0}):o.jsx(d0,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),s&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function pme({task:e}){const t=V6(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 o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx($t,{className:"spin"}):e.status==="success"?o.jsx(CM,{}):e.status==="error"?o.jsx(u0,{}):o.jsx(TE,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:r}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(n)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),children:o.jsx("span",{style:{width:`${n}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:Og.map((s,i)=>{const a=e.status==="success"||inew Set),[ze,le]=E.useState(()=>new Set),[ve,ct]=E.useState(!1),[ht,G]=E.useState(""),[Z,he]=E.useState(null),[De,qe]=E.useState([]),[nt,Kt]=E.useState([]),[Et,Pt]=E.useState(!1),[Yt,Nt]=E.useState(""),[rn,sn]=E.useState(0),[_t,rt]=E.useState(!1),[Oe,gt]=E.useState(()=>new Set),[Se,pe]=E.useState(!1),[Je,at]=E.useState(""),[dn,an]=E.useState(""),[pt,Lt]=E.useState(()=>new Set),on=E.useRef(!1),On=E.useRef(""),lr=E.useRef(null),[fn,Bt]=E.useState(ime),[Kn,ue]=E.useState("");E.useEffect(()=>{e.length!==0&&Bt(z=>z.map((se,ye)=>ye===0&&se.agentIds.length===0?{...se,agentIds:e.slice(0,2).map(Ue=>Ue.id)}:se))},[e]);const Te=E.useMemo(()=>{const z=new Map;for(const se of e)se.runtimeId&&z.set(se.runtimeId,se);return z},[e]),Ce=E.useMemo(()=>{var se;const z=new Map;for(const ye of t){const Ue=(se=ye.deploymentTarget)==null?void 0:se.runtimeId;if(!Ue||!Te.has(Ue))continue;const It=z.get(Ue);(!It||ye.updatedAt>It.updatedAt)&&z.set(Ue,ye)}return z},[Te,t]),Qe=E.useMemo(()=>{const z=new Map;for(const se of d){if(!se.runtimeId)continue;const ye=z.get(se.runtimeId);(!ye||se.startedAt>ye.startedAt)&&z.set(se.runtimeId,se)}return z},[d]),ot=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?e.filter(se=>{const ye=se.runtimeId?Ce.get(se.runtimeId):void 0,Ue=se.runtimeId?Qe.get(se.runtimeId):void 0;return[se.label,se.app,se.host??"",(ye==null?void 0:ye.draft.name)??"",(ye==null?void 0:ye.draft.description)??"",(Ue==null?void 0:Ue.runtimeName)??""].join(" ").toLowerCase().includes(z)}):e},[e,Qe,X,Ce]),et=E.useMemo(()=>{const z=X.trim().toLowerCase();return t.filter(se=>{var Ue;const ye=(Ue=se.deploymentTarget)==null?void 0:Ue.runtimeId;return ye&&Te.has(ye)?!1:z?`${se.draft.name} ${se.draft.description}`.toLowerCase().includes(z):!0})},[Te,t,X]),Ct=E.useMemo(()=>t.filter(z=>{var ye;const se=(ye=z.deploymentTarget)==null?void 0:ye.runtimeId;return!se||!Te.has(se)}).length,[Te,t]),Wt=E.useMemo(()=>{const z=X.trim().toLowerCase();return z?fn.filter(se=>se.name.toLowerCase().includes(z)):fn},[fn,X]),oe=e.find(z=>z.id===U),be=t.find(z=>z.id===M),dt=f?d.find(z=>z.id===f):void 0,Ve=oe!=null&&oe.runtimeId?Ce.get(oe.runtimeId):void 0,Ke=g?H:U&&s===U?r:null,ft=E.useMemo(()=>{const z=new Map(e.map((ye,Ue)=>[ye.id,Ue])),se=new Map(n.map((ye,Ue)=>[ye,Ue]));return[...ot].sort((ye,Ue)=>{const It=ye.runtimeId?Qe.get(ye.runtimeId):void 0,Qt=Ue.runtimeId?Qe.get(Ue.runtimeId):void 0,Sn=(It==null?void 0:It.status)==="running"?It.startedAt:0,Mn=(Qt==null?void 0:Qt.status)==="running"?Qt.startedAt:0;if(Sn!==Mn)return Mn-Sn;const Ft=se.get(ye.id),qt=se.get(Ue.id);return Ft!=null&&qt!=null?Ft-qt:Ft!=null?-1:qt!=null?1:(z.get(ye.id)??0)-(z.get(Ue.id)??0)})},[n,e,ot,Qe]),Gt=(oe==null?void 0:oe.label)||(Ke==null?void 0:Ke.name)||(be==null?void 0:be.draft.name)||(dt==null?void 0:dt.runtimeName)||"未选择智能体",cr=fn.find(z=>z.id===Kn),Yn=ft.filter(z=>z.canDelete===!0),hn=ft.filter(z=>bt.has(z.id)&&z.canDelete===!0),Ln=et.filter(z=>ze.has(z.id)),Ht=Yn.length+et.length,Jt=hn.length+Ln.length,Ot=E.useMemo(()=>(dt==null?void 0:dt.agentDraft)??(be==null?void 0:be.draft)??(Ve==null?void 0:Ve.draft)??ome(Ke,(oe==null?void 0:oe.label)??"agent"),[Ke,oe==null?void 0:oe.label,Ve==null?void 0:Ve.draft,be==null?void 0:be.draft,dt==null?void 0:dt.agentDraft]),kn=E.useMemo(()=>{if(Ke)return Ke.tools;const z=(Ot.builtinTools??[]).map(se=>{var ye;return((ye=dl.find(Ue=>Ue.id===se))==null?void 0:ye.label)??se});return Array.from(new Set([...Ot.tools,...z,...(Ot.customTools??[]).map(se=>se.name),...(Ot.mcpTools??[]).map(se=>se.name)].filter(Boolean)))},[Ot,Ke]),Nn=E.useMemo(()=>Ke?Ke.skillsPreviewSupported?Ke.skills.map(z=>z.name):null:Array.from(new Set([...(Ot.selectedSkills??[]).map(z=>z.name),...Ot.skills].filter(Boolean))),[Ot,Ke]),en=E.useMemo(()=>{if(dt)return dt;if(be)return d.filter(z=>{var se,ye;return((se=z.agentDraft)==null?void 0:se.name)===be.draft.name||z.runtimeName===be.draft.name||!!((ye=be.deploymentTarget)!=null&&ye.runtimeId)&&z.runtimeId===be.deploymentTarget.runtimeId}).sort((z,se)=>se.startedAt-z.startedAt)[0];if(oe)return d.filter(z=>!!oe.runtimeId&&z.runtimeId===oe.runtimeId||z.runtimeName===oe.label).sort((z,se)=>se.startedAt-z.startedAt)[0]},[d,oe,be,dt]),tr=!!(f&&en&&en.id===f),Wn=!!(en&&(en.status!=="success"||tr)),pr=E.useMemo(()=>ume(Ot),[Ot]),nr=(oe==null?void 0:oe.currentVersion)??(D==null?void 0:D.currentVersion)??null,Si=nr??(dt==null?void 0:dt.startedAt)??"unknown",Xs=Ke?`runtime:${(oe==null?void 0:oe.runtimeId)??Ke.name}:v${Si}:${pr}`:`draft:${(dt==null?void 0:dt.id)??(be==null?void 0:be.id)??(oe==null?void 0:oe.id)??Gt}:${pr}`,Zr=!!(g&&(oe!=null&&oe.runtimeId)&&!P);E.useEffect(()=>{if(!f)return;const z=d.find(ye=>ye.id===f),se=z!=null&&z.runtimeId?Te.get(z.runtimeId):void 0;if(se){O(""),C(se.id),L("basic");return}C(""),O(""),L("basic")},[Te,d,f]),E.useEffect(()=>{if(!h){On.current="";return}const z=`${h}:${p}:${m}`;On.current!==z&&e.some(se=>se.id===h)&&(On.current=z,O(""),C(h),L(p),p==="evaluations"&&(J(m),ee("")))},[e,h,p,m]),E.useEffect(()=>{let z=!1;if(W(null),te(!g||!(oe!=null&&oe.runtimeId)||!oe.region),!(!g||!(oe!=null&&oe.runtimeId)||!oe.region))return jv(oe.runtimeId,oe.region,oe.runtimeApp).then(se=>{z||W(se)}).catch(()=>{z||W(null)}).finally(()=>{z||te(!0)}),()=>{z=!0}},[g,oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeApp,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(A(null),!(!(oe!=null&&oe.runtimeId)||!oe.region))return Dv(oe.runtimeId,oe.region).then(se=>{z||A(se)}).catch(()=>{z||A(null)}),()=>{z=!0}},[oe==null?void 0:oe.currentVersion,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{let z=!1;if(qe([]),Kt([]),Nt(""),Y!=="evaluations"||!(oe!=null&&oe.runtimeId)||!oe.region){Pt(!1);return}return Pt(!0),WM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,pageSize:100}).then(se=>{z||(Kt(se.sets),qe(se.items.map(ye=>({...ye,tag:ye.kind==="good"?"Good case":"Bad case"})).sort((ye,Ue)=>Ax(Ue.createdAt)-Ax(ye.createdAt))))}).catch(se=>{z||Nt(se instanceof Error?se.message:String(se))}).finally(()=>{z||Pt(!1)}),()=>{z=!0}},[rn,Y,oe==null?void 0:oe.app,oe==null?void 0:oe.region,oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(De.map(se=>se.id));gt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),Lt(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye}),dn&&!z.has(dn)&&an("")},[De,dn]),E.useEffect(()=>{rt(!1),gt(new Set),Lt(new Set),at(""),an("")},[oe==null?void 0:oe.runtimeId]),E.useEffect(()=>{const z=new Set(ft.filter(se=>se.canDelete===!0).map(se=>se.id));Ze(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[ft]),E.useEffect(()=>{const z=new Set(et.map(se=>se.id));le(se=>{const ye=new Set([...se].filter(Ue=>z.has(Ue)));return ye.size===se.size?se:ye})},[et]);const wr=oe!=null&&oe.runtimeId?De:sme,Ts=wr.filter(z=>{if(z.kind!==ce)return!1;const se=fe.trim().toLowerCase();return se?[z.input,z.output,z.referenceOutput,z.comment,z.tag??"",z.sessionId,z.messageId,z.userId,z.evaluationSetName].join(" ").toLowerCase().includes(se):!0}),Qs=Ts.filter(z=>Oe.has(z.id)),ka=!!(oe!=null&&oe.runtimeId),Ur=z=>{J(z),ee(""),at("");const se=wr.find(ye=>ye.kind===z);an((se==null?void 0:se.id)??""),window.setTimeout(()=>{var ye;(ye=lr.current)==null||ye.scrollIntoView({behavior:"smooth",block:"start"})},0)},wo=z=>{at(""),gt(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},Na=()=>{at(""),gt(new Set(Ts.map(z=>z.id)))},Zs=()=>{at(""),gt(new Set),rt(!1)},Cl=z=>{Lt(se=>{const ye=new Set(se);return ye.has(z)?ye.delete(z):ye.add(z),ye})},Js=z=>{an(z.id),at(""),!(!z.sessionId||!z.messageId)&&(N==null||N(z))},Il=async z=>{if(!(oe!=null&&oe.runtimeId)||!oe.region||Se||z.length===0)return;const se=z.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${z.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(se))return;const ye=z.map(It=>It.id),Ue=new Set(ye);pe(!0),at("");try{await GM({runtimeId:oe.runtimeId,region:oe.region,appName:oe.app,itemIds:ye});const It=new Map;for(const Qt of z)It.set(Qt.kind,(It.get(Qt.kind)??0)+1);qe(Qt=>Qt.filter(Sn=>!Ue.has(Sn.id))),Kt(Qt=>Qt.map(Sn=>({...Sn,itemCount:Math.max(0,Sn.itemCount-(It.get(Sn.kind)??0))}))),gt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),Lt(Qt=>new Set([...Qt].filter(Sn=>!Ue.has(Sn)))),dn&&Ue.has(dn)&&an(""),z.length>1&&rt(!1),T==null||T(z)}catch(It){at(It instanceof Error?It.message:String(It))}finally{pe(!1)}},vo=z=>{Bt(se=>se.map(ye=>ye.id===z.id?z:ye))},_o=()=>{const z=new Set(e.map(Ue=>Ue.id)),se=n.filter(Ue=>z.has(Ue)),ye=new Set(se);return[...se,...e.filter(Ue=>!ye.has(Ue.id)).map(Ue=>Ue.id)]},Sa=(z,se,ye)=>{if(!y||z===se)return;const Ue=_o().filter(Sn=>Sn!==z),It=Ue.indexOf(se),Qt=It<0?Ue.length:ye==="after"?It+1:It;Ue.splice(Qt,0,z),y(Ue)},mr=(z,se)=>{if(!Ee||Ee===se)return;const ye=z.currentTarget.getBoundingClientRect();we(se),Re(z.clientY>ye.top+ye.height/2?"after":"before")},ko=(z,se)=>{if(!y)return;const ye=_o(),Ue=ye.indexOf(z),It=Math.max(0,Math.min(ye.length-1,Ue+se));Ue<0||Ue===It||(ye.splice(Ue,1),ye.splice(It,0,z),y(ye))},No=z=>{z.canDelete===!0&&(G(""),Ze(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye}))},Rl=z=>{G(""),le(se=>{const ye=new Set(se);return ye.has(z.id)?ye.delete(z.id):ye.add(z.id),ye})},Du=()=>{G(""),Ze(new Set(Yn.map(z=>z.id))),le(new Set(et.map(z=>z.id)))},As=()=>{G(""),Ze(new Set),le(new Set),Le(!1)},Cs=()=>{if(Jt===0||ve)return;const z=hn.length,se=Ln.length;G(""),he({kind:"selection",title:z===1&&se===0?"删除 Agent?":z===0&&se===1?"删除草稿?":"删除所选项目?",description:z===1&&se===0?`"${hn[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:z===0&&se===1?`"${Ln[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${Jt} 个项目。${z>0?`${z} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:z===0&&se===1?"删除草稿":"删除所选",agents:hn,drafts:Ln})},Ta=async()=>{if(!(!Z||ve)){ct(!0),G("");try{if(Z.kind==="selection"){const{agents:z,drafts:se}=Z;if(z.length>0){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b(z)}se.length>0&&(x==null||x(se)),Ze(new Set),le(new Set),Le(!1),z.some(ye=>ye.id===U)&&C(""),se.some(ye=>ye.id===M)&&O("")}else if(Z.kind==="agent"){if(!b)throw new Error("当前页面不支持删除已部署 Agent。");await b([Z.agent]),U===Z.agent.id&&C("")}else{if(!x)throw new Error("当前页面不支持删除草稿。");x([Z.draft]),M===Z.draft.id&&O("")}he(null)}catch(z){G(z instanceof Error?z.message:String(z))}finally{ct(!1)}}},Ol=z=>{!b||z.canDelete!==!0||ve||(G(""),he({kind:"agent",title:"删除 Agent?",description:`"${z.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:z}))},So=z=>{if(!x||ve)return;const se=z.draft.name||"未命名 Agent";G(""),he({kind:"draft",title:"删除草稿?",description:`"${se}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:z})},ei=()=>{const z=`eval-${Date.now()}`,se={id:z,name:`新评测组 ${fn.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Bt(ye=>[se,...ye]),ue(z)},xt=z=>{vo({...z,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+z.history.length%7,status:"completed"},...z.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${g?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:j==="library"?"is-active":"","aria-pressed":j==="library",onClick:()=>{F("library"),ne("")},children:"智能体库"}),o.jsx("button",{type:"button",className:j==="evaluation"?"is-active":"","aria-pressed":j==="evaluation",onClick:()=>{F("evaluation"),ne("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":j==="evaluation"||void 0,ref:z=>z==null?void 0:z.toggleAttribute("inert",j==="evaluation"),children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":j==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{value:X,onChange:z=>ne(z.currentTarget.value),placeholder:j==="library"?"搜索智能体":"搜索评测组","aria-label":j==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:j==="library"?S:ei,disabled:j==="library"&&!a,children:[o.jsx(Nr,{"aria-hidden":!0}),o.jsx("span",{children:j==="library"?"新建 Agent":"新建评测组"})]}),j==="library"&&(b||x)&&o.jsx("div",{className:`aw-selection-toolbar${Ye?" is-active":""}`,children:Ye?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Jt," 个"]}),o.jsx("button",{type:"button",onClick:Du,disabled:Ht===0||ve,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Cs(),disabled:Jt===0||ve,children:ve?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:As,disabled:ve,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{G(""),Le(!0)},disabled:Ht===0,children:"选择"})}),j==="library"&&ht&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:ht}),o.jsx("div",{className:"aw-agent-list",children:j==="evaluation"?Wt.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):Wt.map(z=>o.jsxs("button",{type:"button",className:`aw-agent-item${z.id===Kn?" is-active":""}`,onClick:()=>ue(z.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:z.name}),o.jsxs("small",{children:[z.agentIds.length," 个智能体 · ",z.history.length," 次运行"]})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)):c&&ft.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&ft.length===0&&et.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),w&&o.jsx("button",{type:"button",onClick:w,children:"重试"})]}):ft.length===0&&et.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[et.map(z=>{const se=d.filter(Ue=>{var It,Qt;return((It=Ue.agentDraft)==null?void 0:It.name)===z.draft.name||Ue.runtimeName===z.draft.name||!!((Qt=z.deploymentTarget)!=null&&Qt.runtimeId)&&Ue.runtimeId===z.deploymentTarget.runtimeId}).sort((Ue,It)=>It.startedAt-Ue.startedAt)[0],ye=ze.has(z.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Ye?"is-selecting":"",ye?"is-selected-for-delete":"",z.id===M?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Ye?ye:void 0,onClick:()=>{if(Ye){Rl(z);return}C(""),O(z.id),L("basic")},children:[Ye&&o.jsx("span",{className:`aw-select-marker${ye?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(se==null?void 0:se.status)==="running"?" is-deploying":""}`,children:(se==null?void 0:se.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:z.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)}),ft.map(z=>{const se=z.runtimeId?Qe.get(z.runtimeId):void 0,ye=z.runtimeId?Ce.get(z.runtimeId):void 0,Ue=bt.has(z.id),It=z.canDelete===!0,Qt=(se==null?void 0:se.status)==="running"?{label:"部署中",className:" is-deploying"}:(se==null?void 0:se.status)==="error"?{label:"失败",className:" is-error"}:(se==null?void 0:se.status)==="cancelled"?{label:"已取消",className:" is-muted"}:ye?{label:"待更新",className:""}:null,Sn=(se==null?void 0:se.status)==="running"?"正在更新部署":ye?"待更新":z.remote?z.host||"远程智能体":"本地智能体",Mn=["aw-agent-item","aw-agent-item--sortable",z.id===U?"is-active":"",Ye?"is-selecting":"",Ue?"is-selected-for-delete":"",Ye&&!It?"is-selection-disabled":"",z.id===Ee?"is-dragging":"",z.id===xe&&z.id!==Ee?`is-drop-target is-drop-${Ae}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!y&&!Ye,className:Mn,"aria-pressed":Ye?Ue:void 0,"aria-keyshortcuts":y?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ft=>{y&&(on.current=!0,ge(z.id),Ft.dataTransfer.effectAllowed="move",Ft.dataTransfer.setData("text/plain",z.id))},onDragEnter:Ft=>{mr(Ft,z.id)},onDragOver:Ft=>{!Ee||Ee===z.id||(Ft.preventDefault(),Ft.dataTransfer.dropEffect="move",mr(Ft,z.id))},onDragLeave:Ft=>{const qt=Ft.relatedTarget;qt instanceof Node&&Ft.currentTarget.contains(qt)||xe===z.id&&we("")},onDrop:Ft=>{Ft.preventDefault();const qt=Ft.dataTransfer.getData("text/plain")||Ee;Sa(qt,z.id,Ae),ge(""),we(""),Re("before")},onDragEnd:()=>{ge(""),we(""),Re("before"),window.setTimeout(()=>{on.current=!1},0)},onKeyDown:Ft=>{Ft.altKey&&(Ft.key==="ArrowUp"?(Ft.preventDefault(),ko(z.id,-1)):Ft.key==="ArrowDown"&&(Ft.preventDefault(),ko(z.id,1)))},onClick:Ft=>{if(Ye){Ft.preventDefault(),No(z);return}if(on.current){Ft.preventDefault(),on.current=!1;return}O(""),C(z.id),L("basic"),_(z.id)},children:[Ye&&o.jsx("span",{className:`aw-select-marker${Ue?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:z.label}),z.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",z.currentVersion]}),Qt&&o.jsx("span",{className:`aw-draft-badge${Qt.className}`,children:Qt.label})]}),o.jsx("small",{children:Sn})]}),o.jsx(Hd,{"aria-hidden":!0})]},z.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",j==="library"?e.length+Ct:fn.length," 个"]})]}),j==="evaluation"&&cr?o.jsx(yme,{group:cr,agents:e,cases:wr,onChange:vo,onRun:xt}):j==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!oe&&!be&&!dt?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[oe&&!Ke&&i&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Gt}),nr!=null&&o.jsxs("span",{children:["v",nr]}),be&&o.jsx("span",{children:"草稿"}),Ve&&o.jsx("span",{children:"待更新"}),!oe&&!be&&dt&&o.jsx("span",{children:dt.label})]}),o.jsx("p",{children:Ot.description||(i||g&&!P?"正在读取智能体信息…":"暂无描述")})]}),(be||Ve||(oe==null?void 0:oe.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(be||Ve)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const z=be??Ve;z&&So(z)},disabled:ve,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(oe==null?void 0:oe.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void Ol(oe),disabled:ve,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(Vi,{"aria-hidden":!0}),o.jsx("span",{children:ve?"删除中…":"删除 Agent"})]})]})]}),en&&Wn&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(pme,{task:en})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",children:ame.map(z=>o.jsx("button",{type:"button",className:Y===z.id?"is-active":"","aria-pressed":Y===z.id,onClick:()=>L(z.id),children:z.label},z.id))}),o.jsxs("div",{className:"aw-content",children:[Y==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(D==null?void 0:D.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(D==null?void 0:D.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(D==null?void 0:D.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(D==null?void 0:D.region)||(oe==null?void 0:oe.region)||(en==null?void 0:en.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:D!=null&&D.networkTypes.length?D.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:Zr?o.jsxs("div",{className:"aw-canvas-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在加载执行流程"})]}):o.jsx(Rg,{draft:Ot,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Xs)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(Ke==null?void 0:Ke.model)||Ot.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:Ke!=null&&Ke.graph?H6(Ke.graph):z6(Ot)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:kn.length?kn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:Nn===null?"暂不支持预览":Nn.length?Nn.map(z=>o.jsx("span",{children:z},z)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:nr!=null?`v${nr}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:be?"草稿":(en==null?void 0:en.status)==="error"?"部署失败":(en==null?void 0:en.status)==="cancelled"?"已取消":Ve?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]}),o.jsxs("section",{className:"aw-option-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"针对运行质量开启专项优化策略。"})]})}),o.jsxs("div",{className:"aw-option-content",children:[o.jsx("div",{className:"aw-option-list","aria-disabled":"true",children:[["上下文优化","压缩冗余信息,保留对当前任务最有价值的上下文。"],["幻觉抑制","在证据不足时降低确定性表达并主动请求补充信息。"],["工具调用优化","减少重复调用,并优先复用已经获得的结果。"]].map(([z,se])=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",disabled:!0}),o.jsxs("span",{children:[o.jsx("strong",{children:z}),o.jsx("small",{children:se})]})]},z))}),o.jsx("div",{className:"aw-option-glass",role:"status",children:o.jsx("span",{children:"暂未开放"})})]})]})]}),Y==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[oe!=null&&oe.runtimeId?o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(z=>{const se=cme(nt,z),ye=(se==null?void 0:se.itemCount)??De.filter(Ue=>Ue.kind===z).length;return o.jsxs("button",{type:"button",onClick:()=>Ur(z),children:[o.jsx("strong",{children:ye}),o.jsx("span",{children:z==="good"?"Good cases":"Bad cases"})]},z)})}):o.jsx("div",{className:"aw-case-note",children:"只有已部署到 AgentKit Runtime 的 Agent 会同步展示用户反馈评测集。"}),o.jsx("div",{className:"aw-case-filters",children:["good","bad"].map(z=>o.jsx("button",{type:"button",className:ce===z?"is-active":"","aria-pressed":ce===z,onClick:()=>J(z),children:z==="good"?"Good case":"Bad case"},z))}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(Cf,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:fe,onChange:z=>ee(z.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]}),ka&&o.jsx("div",{className:`aw-case-toolbar${_t?" is-active":""}`,children:_t?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Qs.length," 条"]}),o.jsx("button",{type:"button",onClick:Na,disabled:Ts.length===0||Se,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Il(Qs),disabled:Qs.length===0||Se,children:Se?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Zs,disabled:Se,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{at(""),rt(!0)},disabled:Ts.length===0||Se,children:"选择案例"})}),Je&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Je}),o.jsx("div",{ref:lr,children:o.jsx(gme,{cases:Ts,loading:Et,error:Yt,runtimeBacked:!!(oe!=null&&oe.runtimeId),selectionMode:_t,selectedCaseIds:Oe,focusedCaseId:dn,expandedCaseIds:pt,deleting:Se,canDelete:ka,onOpenCase:Js,onToggleCase:wo,onToggleExpanded:Cl,onDeleteCase:z=>void Il([z]),onRetry:()=>sn(z=>z+1)})})]})]}),Y==="basic"&&(oe||be)&&o.jsxs("div",{className:"aw-basic-actions",children:[oe&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>k==null?void 0:k(oe.id),children:[o.jsx(uV,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:be||Ve?!a:!(oe!=null&&oe.runtimeId)||!l||!i&&!Ke,onClick:()=>be?I==null?void 0:I(be):Ve?I==null?void 0:I(Ve):R(Ot),children:be||Ve?"继续编辑":"更新"})]})]})]}),j==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),Z&&o.jsx(U6,{variant:"danger",title:Z.title,description:Z.description,confirmLabel:ve?"删除中...":Z.confirmLabel,closeLabel:"关闭删除确认",busy:ve,onCancel:()=>he(null),onConfirm:()=>void Ta()})]})}function gme({cases:e,loading:t=!1,error:n="",runtimeBacked:r=!1,selectionMode:s=!1,selectedCaseIds:i,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:p,onRetry:m}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"来源"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),m&&o.jsx("button",{type:"button",onClick:m,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:r?"暂无用户反馈案例":"没有匹配的案例"}):e.map(g=>{const w=(i==null?void 0:i.has(g.id))??!1,y=(l==null?void 0:l.has(g.id))??!1,x=g.output.length+g.referenceOutput.length>220;return o.jsxs("div",{className:["aw-case-row",a===g.id?"is-focused":"",s?"is-selecting":"",w?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?w:void 0,onClick:()=>{if(s){f==null||f(g);return}d==null||d(g)},onKeyDown:_=>{_.target===_.currentTarget&&(_.key!=="Enter"&&_.key!==" "||(_.preventDefault(),s?f==null||f(g):d==null||d(g)))},children:[o.jsxs("div",{className:"aw-case-text",children:[o.jsxs("span",{className:"aw-case-title-line",children:[s&&o.jsx("span",{className:`aw-select-marker${w?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:g.input,children:g.input||"无用户输入"})]}),g.comment&&o.jsxs("small",{title:g.comment,children:["备注:",g.comment]})]}),o.jsxs("div",{className:`aw-case-output${y?" is-expanded":""}`,children:[o.jsx("p",{className:"aw-case-output-preview",title:g.output,children:g.output||"无可见回复"}),g.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:g.referenceOutput,children:["Reference: ",g.referenceOutput]}),x&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:_=>{_.stopPropagation(),h==null||h(g.id)},children:y?"收起":"展开"})]}),o.jsxs("div",{className:"aw-case-meta",children:[o.jsxs("span",{className:"aw-case-meta-top",children:[o.jsx("span",{className:`aw-case-tag is-${g.kind}`,children:g.kind==="good"?"Good case":"Bad case"}),u&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:_=>{_.stopPropagation(),p==null||p(g)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(Vi,{"aria-hidden":!0})})]}),o.jsx("small",{children:lme(g.createdAt)}),(g.userId||g.sessionId)&&o.jsx("small",{title:[g.userId,g.sessionId].filter(Boolean).join(" · "),children:[g.userId,g.sessionId].filter(Boolean).join(" · ")})]})]},g.id)})]})}function yme({group:e,agents:t,cases:n,onChange:r,onRun:s}){const[i,a]=E.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];E.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 o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>s(e),disabled:!0,children:[o.jsx(Jz,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:i==="config"?"is-active":"","aria-pressed":i==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:i==="history"?"is-active":"","aria-pressed":i==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:i==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>r({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>r({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>r({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Gs,{}),"已完成"]}),o.jsx(Hd,{"aria-hidden":!0})]},f.id))})]})})]})}const DC=[{id:"general",label:"通用智能体",createLabel:"添加通用智能体"},{id:"codex",label:"Codex 智能体",createLabel:"添加 Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体",createLabel:"添加 OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体",createLabel:"添加 Hermes 智能体"}],bme=100,Eme=3e4,bc=new Map,Mc=new Map,xme=new Set;function PC(e){if(!e){bc.clear(),Mc.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,r]of Mc)r.page.runtimes.some(s=>t.has(s.runtimeId))&&Mc.delete(n);bc.clear()}}function wme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function vme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function _me(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 6.25 3.75 3.5 3.75-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function kme(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.25 2.75 2.75 6.25-6.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nme(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t).replace(/\//g,"-")}function BC(e){return{id:e.runtimeId,name:e.name,description:e.name,createdAt:Nme(e.createdAt??""),runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}async function Sme(e,t,n){const r=`${e}:${t}`,s=Mc.get(r);if(s&&s.expiresAt>Date.now())return n(s.page.runtimes.map(BC)),s.page.nextToken;s&&Mc.delete(r);let i=bc.get(r);i||(i=Ic({scope:"mine",region:e,pageSize:bme,nextToken:t}),bc.set(r,i),i.then(()=>bc.delete(r),()=>bc.delete(r)));const a=await i;return Mc.set(r,{page:a,expiresAt:Date.now()+Eme}),n(a.runtimes.map(BC)),a.nextToken}function Tme({agent:e,onUse:t,onViewDetails:n,connecting:r,connected:s}){return o.jsxs("article",{className:"my-agent-card",children:[o.jsx("button",{type:"button",className:"my-agent-card-main",disabled:!e.runtime,onClick:()=>n==null?void 0:n(e),"aria-label":`查看 ${e.name} 详情`,children:o.jsxs("span",{className:"my-agent-card-copy",children:[o.jsx("h3",{children:e.name}),o.jsx("dl",{className:"my-agent-meta",children:o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:e.createdAt})]})})]})}),o.jsx("button",{type:"button",className:`my-agent-connect${s?" is-connected":""}`,disabled:!e.runtime||r||s,"aria-busy":r||void 0,"aria-label":s?`${e.name} 已连接`:`连接 ${e.name}`,title:s?"已连接":"连接智能体",onClick:()=>void(t==null?void 0:t(e)),children:r?"连接中":s?"已连接":"连接"})]})}function Ame({onCreateAgent:e,onCreateCodexAgent:t,onUseAgent:n,onViewAgentDetails:r,connectedRuntimeId:s="",hiddenRuntimeIds:i=xme}){const a=E.useRef(null),l=E.useRef(null),c=E.useRef(0),[u,d]=E.useState("general"),[f,h]=E.useState("cn-beijing"),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState([]),[x,_]=E.useState(""),[k,N]=E.useState(!0),[T,S]=E.useState(""),[R,I]=E.useState(""),j=E.useCallback((H,W)=>{const P=++c.current;return N(!0),S(""),Sme(f,H,te=>{c.current===P&&b(X=>W?te:[...X,...te])}).then(te=>{c.current===P&&_(te)}).catch(te=>{c.current===P&&S(te instanceof Error?te.message:String(te))}).finally(()=>{c.current===P&&N(!1)})},[f]);E.useEffect(()=>(b([]),_(""),j("",!0),()=>{c.current+=1}),[j]),E.useEffect(()=>{const H=l.current,W=a.current;if(!H||!W||u!=="general"||!x||k)return;const P=new IntersectionObserver(([te])=>{te.isIntersecting&&j(x,!1)},{root:W,rootMargin:"180px 0px",threshold:.01});return P.observe(H),()=>P.disconnect()},[u,j,k,x]);const F=E.useCallback(async H=>{if(!R){I(H.id);try{await new Promise(W=>requestAnimationFrame(()=>W())),await n(H)}finally{I("")}}},[R,n]),Y=E.useMemo(()=>{if(u!=="general")return[];const H=g.trim().toLocaleLowerCase(),W=H?y.filter(X=>X.name.toLocaleLowerCase().includes(H)):y,P=i.size>0?W.filter(X=>!X.runtime||!i.has(X.runtime.runtimeId)):W,te=P.findIndex(X=>{var ne;return((ne=X.runtime)==null?void 0:ne.runtimeId)===s});return te<=0?P:[P[te],...P.slice(0,te),...P.slice(te+1)]},[u,s,i,g,y]),L=DC.find(H=>H.id===u),U=(L==null?void 0:L.label)??"智能体",C=(L==null?void 0:L.createLabel)??"添加智能体",M=u==="general"&&k&&y.length===0,O=!M&&Y.length===0,D=u==="openclaw"||u==="hermes"?"暂未开放":g.trim()?"没有匹配的智能体":`${U}暂无内容`,A=u==="general"?()=>e(f):u==="codex"?t:void 0;return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsxs("div",{className:"my-agents-title-row",children:[o.jsx("h1",{children:"智能体"}),o.jsxs("div",{className:"my-agents-region-picker",onKeyDown:H=>{H.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"my-agents-region","aria-label":"Runtime 地域","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(H=>!H),children:[o.jsx("span",{children:f==="cn-beijing"?"北京":"上海"}),o.jsx(_me,{className:`my-agents-region-chevron${p?" is-open":""}`})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"my-agents-region-menu",role:"listbox","aria-label":"Runtime 地域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(H=>{const W=H.value===f;return o.jsxs("button",{type:"button",role:"option","aria-selected":W,className:`my-agents-region-option${W?" is-selected":""}`,onClick:()=>{h(H.value),m(!1)},children:[o.jsx("span",{children:H.label}),W&&o.jsx(kme,{})]},H.value)})})]})]})]}),o.jsx("p",{children:"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(wme,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:g,onChange:H=>w(H.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:DC.map(H=>o.jsx("button",{type:"button",className:`my-agent-type-pill${u===H.id?" is-active":""}`,"aria-pressed":u===H.id,onClick:()=>d(H.id),children:H.label},H.id))}),o.jsxs("button",{type:"button",className:"my-agent-add",disabled:!A,onClick:()=>A==null?void 0:A(),children:[o.jsx(vme,{}),C]})]}),o.jsxs("section",{className:"my-agent-results",ref:a,"aria-label":`${U}列表`,children:[M?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):T&&u==="general"?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T}),o.jsx("button",{type:"button",onClick:()=>void j("",!0),children:"重新加载"})]}):O?o.jsxs("div",{className:"my-agent-empty",children:[!g.trim()&&u==="general"?o.jsxs("p",{children:["暂无智能体,",o.jsx("button",{type:"button",className:"my-agent-empty-create",onClick:()=>e(f),children:"点此创建"})]}):o.jsx("p",{children:D}),g.trim()&&u!=="openclaw"&&u!=="hermes"&&o.jsx("span",{children:"请尝试搜索其他名称"})]}):o.jsx("div",{className:"my-agent-grid",children:Y.map(H=>{var W;return o.jsx(Tme,{agent:H,onUse:F,onViewDetails:r,connecting:H.id===R,connected:((W=H.runtime)==null?void 0:W.runtimeId)===s},H.id)})}),u==="general"&&Y.length>0&&o.jsx("div",{className:"my-agent-load-more",ref:l,"aria-live":"polite",children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):x?o.jsx("span",{children:"继续滚动加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]})]})}const Cme={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 Ime(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 Rme(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function Ome(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function B_(e,t){if(Rme(e))return Ime(t,e.path);if(Ome(e)){const n=Cme[e.call],r={};for(const[s,i]of Object.entries(e.args??{}))r[s]=B_(i,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function Lme(e,t){const n=B_(e,t);return n==null?"":typeof n=="string"?n:String(n)}const K6=new Map;function Tl(e,t){K6.set(e,t)}function Mme(e){return K6.get(e)}function jme(e,t,n){const r=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(let i=0;iB_(r,e.dataModel),resolveString:r=>Lme(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const s=e.components[r];if(!s)return null;const i=Mme(s.component)??Dme;return o.jsx(i,{node:s,ctx:n},r)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function Bme(e){const t=E.useRef(null),n=E.useRef(!0),r=28,s=E.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 F_({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[o.jsx(ul,{"aria-hidden":!0}),o.jsxs("span",{children:["/",r.name]}),t?o.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:o.jsx(Ar,{})}):null]},r.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(TM,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),n?o.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(Ar,{})}):null]}):null]})}function U_(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function W6(e){var n,r,s,i;const t=U_(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 G6(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function q6(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?ej(t,e.uri):""}function Fme({kind:e}){return e==="image"?o.jsx(_v,{}):e==="video"?o.jsx(IM,{}):e==="pdf"?o.jsx(Qz,{}):o.jsx(wv,{})}function $_({appName:e,items:t,compact:n=!1,onRemove:r}){const[s,i]=E.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=U_(a.mimeType),c=q6(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:()=>i(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(bV,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(Fme,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:W6(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":G6(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(Cc,{className:"media-card-open"}):null]});return o.jsxs(nn.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(_M,{src:c,children:d}):d,r?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:o.jsx(Ar,{})}):null]},a.id)})}),o.jsx(di,{children:s?o.jsx(Ume,{appName:e,item:s,onClose:()=>i(null)}):null})]})}function Ume({appName:e,item:t,onClose:n}){const r=E.useMemo(()=>q6(t,e),[e,t]),s=U_(t.mimeType),[i,a]=E.useState(""),[l,c]=E.useState(s==="text"||s==="markdown"),[u,d]=E.useState("");return E.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),E.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]),o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[W6(t),t.sizeBytes?` · ${G6(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:o.jsx(f0,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(Ar,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${s}`,children:[s==="image"?o.jsx("img",{src:r,alt:t.name??"图片"}):null,s==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,s==="pdf"?o.jsx("iframe",{src:r,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx($t,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&s==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(yh,{text:i})}):null,!l&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:i}):null]})]})})}function $me(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.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 Hme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.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 X6(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function zme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function Vme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function Kme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function Yme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 Wme(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.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"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function Q6(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function Gme({definition:e,label:t,done:n,open:r,onToggle:s}){const i=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:s,"aria-expanded":r,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(i,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(Ea,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(Q6,{className:`builtin-tool-chevron${r?" is-open":""}`})]})}const qme={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:$me},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:Wme},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:Hme},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:X6},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:zme},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:Vme},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:Kme},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:Yme}};function Xme(e){return qme[e]}const Z6="send_a2ui_json_to_client",Qme=28;function Zme(e,t,n){let r=t;for(let s=0;s65535?2:1}return r}function Jme(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function J6(e,t,n){const[r,s]=E.useState(()=>t?"":e),i=E.useRef(r),a=E.useRef(e),l=E.useRef(null),c=E.useRef(0),u=E.useRef(n);return a.current=e,u.current=n,E.useEffect(()=>{const d=i.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(i.current=e,s(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,g=i.current;if(!m.startsWith(g)){i.current=m,s(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[r]),E.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),r}function ege({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.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 tge(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.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 nge(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 e5({text:e,done:t,streaming:n=!1,onStreamFrame:r}){const[s,i]=E.useState(!t),a=E.useRef(!1);E.useEffect(()=>{a.current||i(!t)},[t]);const l=()=>{a.current=!0,i(h=>!h)},c=e.replace(/^\s+/,""),u=J6(c,!t||n,r),{ref:d,onScroll:f}=Bme(u);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:l,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(ege,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(Ea,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx($s,{className:`chev ${s?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${s&&u?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:d,onScroll:f,children:u})})})]})}function t5(){return o.jsx(e5,{text:"",done:!1})}const rge=E.memo(function({text:t,streaming:n,onStreamFrame:r}){const s=J6(t,n,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:s})}):null});function sge({name:e,args:t,response:n,done:r}){const[s,i]=E.useState(!1),a=e===Z6?"渲染 UI":e,l=Xme(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 o.jsxs(nn.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(Gme,{definition:l,label:nge(e,t),done:r,open:s,onToggle:()=>i(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>i(d=>!d),type:"button","aria-expanded":s,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(tge,{})}),r?o.jsx("span",{className:"tool-name",children:a}):o.jsx(Ea,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(Q6,{className:`tool-chevron${s?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${s?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function ige({block:e,onDownload:t,onPreview:n}){const[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState(null);E.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){s(`download:${p}`),a("");try{await t(p,m)}catch(g){a(g instanceof Error?g.message:String(g))}finally{s("")}}},f=async(p,m,g)=>{if(n){s(`preview:${g}`),a("");try{const w=await n(p,m);c({name:g,url:w})}catch(w){a(w instanceof Error?w.message:String(w))}finally{s("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,g=e.files.find(w=>w.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(wv,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[g&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||r!=="",onClick:()=>void f(g.filename,g.version,p.filename),children:[r===`preview:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(xv,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||r!=="",onClick:()=>void d(p.filename,p.version),children:[r===`download:${p.filename}`?o.jsx($t,{className:"spin"}):o.jsx(f0,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),i&&o.jsx("div",{className:"artifact-card__error",children:i}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(Ar,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function age({block:e,onAuth:t}){const[n,r]=E.useState(e.done?"done":"idle"),[s,i]=E.useState(""),a=e.label||"MCP 工具集",l=(()=>{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"?o.jsxs(nn.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(hT,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(nn.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx(hT,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx($t,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),s&&o.jsx("div",{className:"auth-card-err",children:s})]})}function H_({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:r,onAction:s,onAuth:i,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":return o.jsx(e5,{text:c.text,done:c.done,streaming:n,onStreamFrame:r},u);case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(rge,{text:d,streaming:n,onStreamFrame:r},u):null}case"attachment":return o.jsx($_,{appName:t,items:c.files},u);case"artifact":return o.jsx(ige,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(F_,{value:c.value},u);case"tool":return c.name===Z6&&c.done?null:o.jsx(sge,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(age,{block:c,onAuth:i},u);case"a2ui":return Y6(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(nn.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(Pme,{surface:d,onAction:s})},`${u}-${d.surfaceId}`));default:return null}})})}function n5(e){return e.isComposing||e.keyCode===229}const oge="/assets/arkclaw-DG3MhHYM.png",lge="/assets/codex-Csw-JJxq.png",cge="/assets/hermes-C6L-CfGS.png",si=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],uge=[{label:"ArkClaw",logo:oge},{label:"Hermes 智能体",logo:cge}];function FC({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.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"}),o.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"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Qc,{className:"new-chat-mode__agent-icon"})}function dge(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function fge({value:e,onChange:t,disabled:n=!1,temporaryEnabled:r,skillCreateEnabled:s}){const[i,a]=E.useState(!1),[l,c]=E.useState(!1),[u,d]=E.useState(()=>si.findIndex(k=>k.value===e)),f=E.useRef(null),h=E.useRef(null),p=si.find(k=>k.value===e)??si[0],m=p.value==="temporary"?"Codex 智能体":p.label;function g(k){return k.value==="temporary"?r:k.value==="skill-create"?s:!0}function w(k){return g(k)!==!0}function y(k){const N=g(k);return N===void 0?"正在检查配置":N?k.description:"管理员未配置"}E.useEffect(()=>{if(!i)return;const k=N=>{var T;(T=f.current)!=null&&T.contains(N.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[i]);function b(k){let N=u;do N=(N+k+si.length)%si.length;while(w(si[N]));d(N),c(si[N].value==="temporary")}function x(k){var N;if(!w(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 o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":i,disabled:n,onClick:()=>{d(si.findIndex(k=>k.value===e)),a(k=>(k&&c(!1),!k))},onKeyDown:k=>{k.key==="ArrowDown"||k.key==="ArrowUp"?(k.preventDefault(),i?b(k.key==="ArrowDown"?1:-1):a(!0)):i&&(k.key==="Enter"||k.key===" ")?(k.preventDefault(),x(si[u])):i&&k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(FC,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),i?o.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(),b(k.key==="ArrowDown"?1:-1)):k.key==="Enter"?(k.preventDefault(),x(si[u])):k.key==="Escape"&&(k.preventDefault(),a(!1),c(!1),(N=h.current)==null||N.focus())},children:si.map((k,N)=>{const T=k.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===k.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":w(k),disabled:w(k),className:`new-chat-mode__option${N===u?" is-active":""}`,onMouseEnter:()=>{d(N),c(k.value==="temporary")},onClick:()=>x(k),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(FC,{mode:k.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[k.label,k.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(k)})]}),T?o.jsx(dge,{}):e===k.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},k.value)})}):null,i&&l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:_,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:lge,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),uge.map(({label:k,logo:N})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx("img",{className:"new-chat-mode__builtin-icon",src:N,alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:k}),o.jsx("span",{children:"暂不可用"})]})]},k))]}):null]})}const r5={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},hge={ppt:[],image:[],video:["video_task_query"]},z_=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function UC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}function pge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8.2",cy:"8.2",r:"4.7"}),o.jsx("path",{d:"m11.7 11.7 4.1 4.1"}),o.jsx("path",{d:"M14.8 2.7v3.2M13.2 4.3h3.2"}),o.jsx("circle",{cx:"8.2",cy:"8.2",r:"1",fill:"currentColor",stroke:"none"})]})}function mge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"4.2",cy:"15.4",r:"1.4"}),o.jsx("circle",{cx:"15.7",cy:"4.2",r:"1.4"}),o.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"}),o.jsx("path",{d:"m12.7 14.2 1.5 1.5 2.9-3.3"})]})}function gge(){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M3.2 5.2h7.1M3.2 9.5h5.2M3.2 13.8h4"}),o.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"}),o.jsx("path",{d:"M14.5 3.1v2.5M13.2 4.4h2.6"})]})}const yge=[{icon:pge,text:"帮我分析一个问题,并给出清晰的解决思路"},{icon:mge,text:"根据我的目标,制定一份可执行的行动计划"},{icon:gge,text:"帮我整理并润色一段内容,让表达更清晰"}],$C=[{value:"ppt",label:"PPT",icon:pV,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:_v,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:X6,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function bge({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:s,onChange:i,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:g=!0,onInvocationChange:w,onAddFiles:y,onRemoveAttachment:b,newChatMode:x="agent",newChatTask:_=null,newChatLayout:k=!1,showModeSelector:N=!1,onModeChange:T,onTaskChange:S,temporaryEnabled:R,skillCreateEnabled:I,harnessEnabled:j=!1,builtinTools:F=[]}){const Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null),C=E.useRef(null),[M,O]=E.useState(!1),[D,A]=E.useState(null),[H,W]=E.useState(0),[P,te]=E.useState(!1);async function X(){if(e)try{await navigator.clipboard.writeText(e),te(!0),setTimeout(()=>te(!1),1500)}catch{te(!1)}}E.useLayoutEffect(()=>{const le=Y.current;le&&(le.style.height="auto",le.style.height=`${Math.min(le.scrollHeight,200)}px`)},[s]);const ne=x==="skill-create";E.useEffect(()=>{ne&&(O(!1),A(null))},[ne]);const ce=!ne&&d.some(le=>le.status!=="ready"),J=!l&&!c&&!ce&&(s.trim().length>0||!ne&&d.length>0),fe=(D==null?void 0:D.query.toLocaleLowerCase())??"",ee=(D==null?void 0:D.kind)==="skill"?f.filter(le=>!p.skills.some(ve=>ve.name===le.name)).filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"skill",value:le})):(D==null?void 0:D.kind)==="agent"?h.filter(le=>`${le.name} ${le.description}`.toLocaleLowerCase().includes(fe)).map(le=>({kind:"agent",value:le})):[];function Ee(le){var ve;O(!1),A(null),(ve=le.current)==null||ve.click()}function ge(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(le.length,le.length)})}function xe(le){S==null||S(le.value),O(!1),A(null),requestAnimationFrame(()=>{var ve,ct;(ve=Y.current)==null||ve.focus(),(ct=Y.current)==null||ct.setSelectionRange(s.length,s.length)})}function we(le){i(le),O(!1),A(null),requestAnimationFrame(()=>{var ht,G,Z;(ht=Y.current)==null||ht.focus();const ve=le.indexOf("【"),ct=le.indexOf("】",ve+1);ve>=0&&ct>ve?(G=Y.current)==null||G.setSelectionRange(ve+1,ct):(Z=Y.current)==null||Z.setSelectionRange(le.length,le.length)})}function Ae(){S==null||S(null),i(""),O(!1),A(null),requestAnimationFrame(()=>{var le,ve;(le=Y.current)==null||le.focus(),(ve=Y.current)==null||ve.setSelectionRange(0,0)})}const Re=$C.find(le=>le.value===_),Ye=$C.filter(le=>r5[le.value].every(ve=>F.includes(ve)));function Le(le,ve){const ct=le.slice(0,ve),ht=/(^|\s)([/@])([^\s/@]*)$/.exec(ct);if(!ht){A(null);return}const G=ht[2].length+ht[3].length,Z={kind:ht[2]==="/"?"skill":"agent",query:ht[3],start:ve-G,end:ve},he=!D||D.kind!==Z.kind||D.query!==Z.query||D.start!==Z.start||D.end!==Z.end;A(Z),he&&W(0),O(!1)}function bt(le){if(!D)return;const ve=s.slice(0,D.start)+s.slice(D.end);i(ve),le.kind==="skill"?w({...p,skills:[...p.skills,le.value]}):w({skills:[],targetAgent:le.value});const ct=D.start;A(null),requestAnimationFrame(()=>{var ht,G;(ht=Y.current)==null||ht.focus(),(G=Y.current)==null||G.setSelectionRange(ct,ct)})}function Ze(){if(p.targetAgent){w({skills:[]});return}p.skills.length>0&&w({...p,skills:p.skills.slice(0,-1)})}function ze(le){const ve=le.target.files?Array.from(le.target.files):[];ve.length&&y(ve),le.target.value=""}return o.jsxs("div",{className:`composer${k?" composer--new-chat":""}${ne?" composer--skill-mode":""}${Re?` composer--has-task composer--task-${Re.value}`:""}`,children:[ne?null:o.jsx(F_,{value:p,onRemoveSkill:le=>w({...p,skills:p.skills.filter(ve=>ve.name!==le)}),onRemoveAgent:()=>w({skills:[]})}),!ne&&d.length>0&&o.jsx($_,{appName:n,compact:!0,items:d,onRemove:b}),o.jsxs("div",{className:"composer-box",children:[D?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":D.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[D.kind==="skill"?o.jsx(ul,{}):o.jsx(TM,{}),o.jsx("span",{children:D.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:D.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx($t,{className:"spin"})," 正在读取 Agent 能力…"]}):ee.length===0?o.jsx("div",{className:"composer-command-empty",children:D.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:ee.map((le,ve)=>o.jsxs("button",{type:"button",role:"option","aria-selected":ve===H,className:`composer-command-item${ve===H?" is-active":""}`,onMouseDown:ct=>{ct.preventDefault(),bt(le)},onMouseEnter:()=>W(ve),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${le.kind}`,children:le.kind==="skill"?o.jsx(ul,{}):o.jsx(cl,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[le.kind==="skill"?"/":"@",le.value.name]}),o.jsx("span",{children:le.value.description||(le.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:ve===H?"↵":le.kind==="skill"?"技能":"Agent"})]},`${le.kind}-${le.value.name}`))})]}):null,ne?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!g,onClick:()=>{A(null),O(le=>!le)},children:o.jsx(Nr,{className:"icon"})}),M&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>O(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(L),children:[o.jsx(_v,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(U),children:[o.jsx(wv,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>Ee(C),children:[o.jsx(IM,{className:"icon"}),"上传视频"]})]})]})]}),N&&T?o.jsx(fge,{value:x,onChange:T,disabled:c,temporaryEnabled:R,skillCreateEnabled:I}):null,k&&x==="agent"&&Re&&S?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Re.value}`,"aria-label":`取消${Re.label}任务`,disabled:c,onClick:Ae,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Re.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(Ar,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Re.label})]}):null,k&&ne&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(UC,{className:"new-chat-task-chip__task-icon"}),o.jsx(Ar,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsx("div",{className:"composer-input-stack",children:o.jsx("textarea",{ref:Y,className:"comp-input scroll",rows:k?4:1,value:s,disabled:l,placeholder:ne?`描述你想创建的 Skill,将使用 ${z_.join(" 和 ")} 并行创建…`:l?"请在页面左上角选择智能体":`向 ${r} 发消息…`,"aria-expanded":!!D,onChange:le=>{i(le.target.value),ne||Le(le.target.value,le.target.selectionStart)},onSelect:le=>{ne||Le(le.currentTarget.value,le.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>A(null),0),onKeyDown:le=>{if(!n5(le.nativeEvent)){if(D){if(le.key==="ArrowDown"&&ee.length>0){le.preventDefault(),W(ve=>(ve+1)%ee.length);return}if(le.key==="ArrowUp"&&ee.length>0){le.preventDefault(),W(ve=>(ve-1+ee.length)%ee.length);return}if((le.key==="Enter"||le.key==="Tab")&&ee[H]){le.preventDefault(),bt(ee[H]);return}if(le.key==="Escape"){le.preventDefault(),A(null);return}}if(le.key==="Backspace"&&!s&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){Ze();return}le.key==="Enter"&&!le.shiftKey&&(le.preventDefault(),J&&a())}}})}),o.jsx(nn.button,{type:"button",className:"comp-send",disabled:!J,onClick:a,"aria-label":"发送",whileTap:J?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx($t,{className:"icon spin"}):o.jsx(SM,{className:"icon"})})]}),k&&x==="agent"&&j&&!Re?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ye.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>xe(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le.label})]},le.value)}),I===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(UC,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,k&&x==="agent"&&Re?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Re.label}企业提示词`,children:Re.prompts.map(le=>{const ve=Re.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>we(le),children:[o.jsx(ve,{}),o.jsx("span",{children:le})]},le)})}):null,k&&x==="agent"&&!j&&!s.trim()?o.jsx("div",{className:"prompt-suggestions","aria-label":"快捷提示",children:yge.map(le=>{const ve=le.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>ge(le.text),children:[o.jsx(ve,{}),o.jsx("span",{children:le.text})]},le.text)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:P?"已复制":"复制会话 ID","aria-label":P?"已复制会话 ID":"复制会话 ID",onClick:()=>void X(),children:P?o.jsx(Gs,{}):o.jsx(d0,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:L,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:U,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:ze}),o.jsx("input",{ref:C,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:ze})]})}function s5({title:e,sub:t,cards:n,footer:r}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((s,i)=>o.jsxs(nn.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:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(s.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:s.title}),o.jsx("span",{className:"stk-card-desc",children:s.desc})]}),o.jsx($s,{className:"stk-card-arrow"})]},s.key))}),r&&o.jsx("div",{className:"stk-footer",children:r})]})}const V_=Symbol.for("yaml.alias"),Cx=Symbol.for("yaml.document"),oo=Symbol.for("yaml.map"),i5=Symbol.for("yaml.pair"),Ki=Symbol.for("yaml.scalar"),Ru=Symbol.for("yaml.seq"),Ys=Symbol.for("yaml.node.type"),Ou=e=>!!e&&typeof e=="object"&&e[Ys]===V_,Nh=e=>!!e&&typeof e=="object"&&e[Ys]===Cx,Sh=e=>!!e&&typeof e=="object"&&e[Ys]===oo,er=e=>!!e&&typeof e=="object"&&e[Ys]===i5,bn=e=>!!e&&typeof e=="object"&&e[Ys]===Ki,Th=e=>!!e&&typeof e=="object"&&e[Ys]===Ru;function Zn(e){if(e&&typeof e=="object")switch(e[Ys]){case oo:case Ru:return!0}return!1}function Jn(e){if(e&&typeof e=="object")switch(e[Ys]){case V_:case oo:case Ki:case Ru:return!0}return!1}const a5=e=>(bn(e)||Zn(e))&&!!e.anchor,Bo=Symbol("break visit"),Ege=Symbol("skip children"),nf=Symbol("remove node");function Lu(e,t){const n=xge(t);Nh(e)?Ec(null,e.contents,n,Object.freeze([e]))===nf&&(e.contents=null):Ec(null,e,n,Object.freeze([]))}Lu.BREAK=Bo;Lu.SKIP=Ege;Lu.REMOVE=nf;function Ec(e,t,n,r){const s=wge(e,t,n,r);if(Jn(s)||er(s))return vge(e,r,s),Ec(e,s,n,r);if(typeof s!="symbol"){if(Zn(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>_ge[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+kge(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&&Jn(t.contents)){const i={};Lu(t.contents,(a,l)=>{Jn(l)&&l.tag&&(i[l.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,a]of r)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||s.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(` +`)}}Kr.defaultYaml={explicit:!1,version:"1.2"};Kr.defaultTags={"!!":"tag:yaml.org,2002:"};function o5(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 l5(e){const t=new Set;return Lu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function c5(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Nge(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=l5(e));const a=c5(t,s);return s.add(a),a},setAnchors:()=>{for(const i of n){const a=r.get(i);if(typeof a=="object"&&a.anchor&&(bn(a.node)||Zn(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:r}}function xc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;szs(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!a5(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 K_{constructor(t){Object.defineProperty(this,Ys,{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(!Nh(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},l=zs(this,"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof i=="function"?xc(i,{"":l},"",l):l}}class Y_ extends K_{constructor(t){super(V_),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=[],Lu(t,{Node:(i,a)=>{(Ou(a)||a5(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 l=r.get(a);if(l||(zs(a,null,n),l=r.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=xm(s,a,r)),l.count*l.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(o5(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 xm(e,t,n){if(Ou(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Zn(t)){let r=0;for(const s of t.items){const i=xm(e,s,n);i>r&&(r=i)}return r}else if(er(t)){const r=xm(e,t.key,n),s=xm(e,t.value,n);return Math.max(r,s)}return 1}const u5=e=>!e||typeof e!="function"&&typeof e!="object";class yt extends K_{constructor(t){super(Ki),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:zs(this.value,t,n)}toString(){return String(this.value)}}yt.BLOCK_FOLDED="BLOCK_FOLDED";yt.BLOCK_LITERAL="BLOCK_LITERAL";yt.PLAIN="PLAIN";yt.QUOTE_DOUBLE="QUOTE_DOUBLE";yt.QUOTE_SINGLE="QUOTE_SINGLE";const Sge="tag:yaml.org,2002:";function Tge(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 Gf(e,t,n){var f,h,p;if(Nh(e)&&(e=e.contents),Jn(e))return e;if(er(e)){const m=(h=(f=n.schema[oo]).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:l}=n;let c;if(r&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=s(e)),new Y_(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Sge+t.slice(2));let u=Tge(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new yt(e);return c&&(c.node=m),m}u=e instanceof Map?a[oo]:Symbol.iterator in Object(e)?a[Ru]:a[oo]}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 yt(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Lg(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 Gf(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 Td=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class d5 extends K_{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=>Jn(r)||er(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Td(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Zn(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(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(Zn(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&&bn(i)?i.value:i:Zn(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!er(n))return!1;const r=n.value;return r==null||t&&bn(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 Zn(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(Zn(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Lg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Age=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ca(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Go=(e,t,n)=>e.endsWith(` `)?ca(n,t):n.includes(` `)?` `+ca(n,t):(e.endsWith(" ")?"":" ")+n,f5="flow",Ix="block",wm="quoted";function G0(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let h,p,m=!1,g=-1,w=-1,y=-1;n===Ix&&(g=HC(e,g,t.length),g!==-1&&(f=g+c));for(let x;x=e[g+=1];){if(n===wm&&x==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(x===` @@ -593,16 +593,16 @@ https://github.com/highlightjs/highlight.js/issues/2277`),A=C,D=M),O===void 0&&( `&&_!==" "&&(h=g)}if(g>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===wm){for(;p===" "||p===" ";)p=x,x=e[g+=1],m=!0;const _=g>y+1?g-2:w-1;if(d[_])return e;u.push(_),d[_]=!0,f=_+c,h=void 0}else m=!0}p=x}if(m&&l&&l(),u.length===0)return e;a&&a();let b=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),X0=e=>/^(%|---|\.\.\.)/m.test(e);function Age(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;i({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),X0=e=>/^(%|---|\.\.\.)/m.test(e);function Cge(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 rf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(X0(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,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,l=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(` @@ -611,13 +611,13 @@ ${n}`)+"'";return t.implicitKey?r:G0(r,n,f5,q0(t,!1))}function xc(e,t){const{sin `)y=w;else break}let b=n.substring(0,y{N=!0});const S=G0(`${b}${k}${p}`,u,Ix,T);if(!N)return`>${_} ${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${_} -${u}${b}${n}${p}`}function Cge(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` -`)||d&&/[[\]{},]/.test(i))return xc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` -`)?xc(i,t):vm(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` -`))return vm(e,t,n,r);if(X0(i)){if(c==="")return t.forceBlockIndent=!0,vm(e,t,n,r);if(l&&c===u)return xc(i,t)}const f=i.replace(/\n+/g,`$& -${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return xc(i,t)}return l?f:G0(f,c,f5,q0(t,!1))}function W_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?xc(a.value,t):vm(a,t,n,r);case yt.QUOTE_DOUBLE:return rf(a.value,t);case yt.QUOTE_SINGLE:return Rx(a.value,t);case yt.PLAIN:return Cge(a,t,n,r);default:return null}};let u=c(l);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 h5(e,t){const n=Object.assign({blockQuote:!0,commentString:Tge,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 Ige(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(bn(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 Rge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(bn(e)||Zn(e))&&e.anchor;i&&o5(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 pu(e,t,n,r){var c;if(er(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=Jn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Ige(t.doc.schema.tags,i));const a=Rge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):bn(i)?W_(i,t,n,r):i.toString(t,n,r);return a?bn(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function Oge({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Jn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Zn(e)||!Jn(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||Zn(e)||(bn(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=pu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Go(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Go(w,n.indent,u(h))),w=`? ${w} -${l}:`):(w=`${w}:`,h&&(w+=Go(w,n.indent,u(h))));let y,b,x;Jn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&bn(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&Th(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=pu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` +${u}${b}${n}${p}`}function Ige(e,t,n,r){const{type:s,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&i.includes(` +`)||d&&/[[\]{},]/.test(i))return wc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||d||!i.includes(` +`)?wc(i,t):vm(e,t,n,r);if(!l&&!d&&s!==yt.PLAIN&&i.includes(` +`))return vm(e,t,n,r);if(X0(i)){if(c==="")return t.forceBlockIndent=!0,vm(e,t,n,r);if(l&&c===u)return wc(i,t)}const f=i.replace(/\n+/g,`$& +${c}`);if(a){const h=g=>{var w;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((w=g.test)==null?void 0:w.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return wc(i,t)}return l?f:G0(f,c,f5,q0(t,!1))}function W_(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:l}=e;l!==yt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=yt.QUOTE_DOUBLE);const c=d=>{switch(d){case yt.BLOCK_FOLDED:case yt.BLOCK_LITERAL:return s||i?wc(a.value,t):vm(a,t,n,r);case yt.QUOTE_DOUBLE:return rf(a.value,t);case yt.QUOTE_SINGLE:return Rx(a.value,t);case yt.PLAIN:return Ige(a,t,n,r);default:return null}};let u=c(l);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 h5(e,t){const n=Object.assign({blockQuote:!0,commentString:Age,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 Rge(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(bn(t)){r=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,r)});if(i.length>1){const a=i.filter(l=>l.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 Oge(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(bn(e)||Zn(e))&&e.anchor;i&&o5(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 mu(e,t,n,r){var c;if(er(e))return e.toString(t,n,r);if(Ou(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=Jn(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s??(s=Rge(t.doc.schema.tags,i));const a=Oge(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof s.stringify=="function"?s.stringify(i,t,n,r):bn(i)?W_(i,t,n,r):i.toString(t,n,r);return a?bn(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function Lge({key:e,value:t},n,r,s){const{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Jn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Zn(e)||!Jn(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||Zn(e)||(bn(e)?e.type===yt.BLOCK_FOLDED||e.type===yt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:l+c});let m=!1,g=!1,w=mu(e,n,()=>m=!0,()=>g=!0);if(!p&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return m&&r&&r(),w===""?"?":p?`? ${w}`:w}else if(i&&!f||t==null&&p)return w=`? ${w}`,h&&!m?w+=Go(w,n.indent,u(h)):g&&s&&s(),w;m&&(h=null),p?(h&&(w+=Go(w,n.indent,u(h))),w=`? ${w} +${l}:`):(w=`${w}:`,h&&(w+=Go(w,n.indent,u(h))));let y,b,x;Jn(t)?(y=!!t.spaceBefore,b=t.commentBefore,x=t.comment):(y=!1,b=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&bn(t)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!p&&Th(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const k=mu(t,n,()=>_=!0,()=>g=!0);let N=" ";if(h||y||b){if(N=y?` `:"",b){const T=u(b);N+=` ${ca(T,n.indent)}`}k===""&&!n.inFlow?N===` `&&x&&(N=` @@ -626,32 +626,32 @@ ${ca(T,n.indent)}`}k===""&&!n.inFlow?N===` ${n.indent}`}else if(!p&&Zn(t)){const T=k[0],S=k.indexOf(` `),R=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(R||!I){let j=!1;if(R&&(T==="&"||T==="!")){let F=k.indexOf(" ");T==="&"&&F!==-1&&Fe===jp||typeof e=="symbol"&&e.description===jp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(jp)),{addToJSMap:m5}),stringify:()=>jp},Lge=(e,t)=>(ha.identify(t)||bn(t)&&(!t.type||t.type===yt.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function m5(e,t,n){const r=g5(e,n);if(Th(r))for(const s of r.items)Vb(e,t,s);else if(Array.isArray(r))for(const s of r)Vb(e,t,s);else Vb(e,t,r)}function Vb(e,t,n){const r=g5(e,n);if(!Sh(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 g5(e,t){return e&&Ru(t)?t.resolve(e.doc,e):t}function y5(e,t,{key:n,value:r}){if(Jn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Lge(e,n))m5(e,t,r);else{const s=zs(n,"",e);if(t instanceof Map)t.set(s,zs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Mge(n,s,e),a=zs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function Mge(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Jn(e)&&(n!=null&&n.doc)){const r=h5(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)+'..."'),p5(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 G_(e,t,n){const r=Gf(e,void 0,n),s=Gf(t,void 0,n);return new qr(r,s)}class qr{constructor(t,n=null){Object.defineProperty(this,Ys,{value:i5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Jn(n)&&(n=n.clone(t)),Jn(r)&&(r=r.clone(t)),new qr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return y5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Oge(this,t,n,r):JSON.stringify(this)}}function b5(e,t,n){return(t.inFlow??e.flow?Dge:jge)(e,t,n)}function jge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Go(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;me===jp||typeof e=="symbol"&&e.description===jp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yt(Symbol(jp)),{addToJSMap:m5}),stringify:()=>jp},Mge=(e,t)=>(ha.identify(t)||bn(t)&&(!t.type||t.type===yt.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function m5(e,t,n){const r=g5(e,n);if(Th(r))for(const s of r.items)Vb(e,t,s);else if(Array.isArray(r))for(const s of r)Vb(e,t,s);else Vb(e,t,r)}function Vb(e,t,n){const r=g5(e,n);if(!Sh(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 g5(e,t){return e&&Ou(t)?t.resolve(e.doc,e):t}function y5(e,t,{key:n,value:r}){if(Jn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Mge(e,n))m5(e,t,r);else{const s=zs(n,"",e);if(t instanceof Map)t.set(s,zs(r,s,e));else if(t instanceof Set)t.add(s);else{const i=jge(n,s,e),a=zs(r,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function jge(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Jn(e)&&(n!=null&&n.doc)){const r=h5(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)+'..."'),p5(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 G_(e,t,n){const r=Gf(e,void 0,n),s=Gf(t,void 0,n);return new qr(r,s)}class qr{constructor(t,n=null){Object.defineProperty(this,Ys,{value:i5}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Jn(n)&&(n=n.clone(t)),Jn(r)&&(r=r.clone(t)),new qr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return y5(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Lge(this,t,n,r):JSON.stringify(this)}}function b5(e,t,n){return(t.inFlow??e.flow?Pge:Dge)(e,t,n)}function Dge({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let f=!1;const h=[];for(let m=0;mw=null,()=>f=!0);w&&(y+=Go(y,i,u(w))),f&&w&&(f=!1),h.push(r+y)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let m=1;mw=null);u||(u=f.length>d||y.includes(` +`+ca(u(e),c),l&&l()):f&&a&&a(),p}function Pge({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:a,options:{commentString:l}}=t;r+=i;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let m=0;mw=null);u||(u=f.length>d||y.includes(` `)),m0&&(u||(u=f.reduce((b,x)=>b+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),w&&(y+=Go(y,r,l(w))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((g,w)=>g+w.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const g of f)m+=g?` ${i}${s}${g}`:` `;return`${m} -${s}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function Mg({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=ca(t(r),e);n.push(i.trimStart())}}function qo(e,t){const n=bn(t)?t.value:t;for(const r of e)if(er(r)&&(r.key===t||r.key===n||bn(r.key)&&r.key.value===n))return r}class Fs extends d5{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(oo,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,a=new this(t),l=(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(G_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;er(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new qr(t,t==null?void 0:t.value):r=new qr(t.key,t.value);const s=qo(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`);bn(s.value)&&u5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=qo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=qo(this.items,t),s=r==null?void 0:r.value;return(!n&&bn(s)?s.value:s)??void 0}has(t){return!!qo(this.items,t)}set(t,n){this.add(new qr(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)y5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!er(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})),b5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Lu={collection:"map",default:!0,nodeClass:Fs,tag:"tag:yaml.org,2002:map",resolve(e,t){return Sh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Fs.from(e,t,n)};class bl extends d5{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Iu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Dp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Dp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&bn(s)?s.value:s}has(t){const n=Dp(t);return typeof n=="number"&&n=0?t:null}const Mu={collection:"seq",default:!0,nodeClass:bl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Th(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>bl.from(e,t,n)},Q0={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),W_(e,t,n,r)}},Z0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&Z0.test.test(e)?e:t.options.nullStr},q_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&q_.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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const E5={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},x5={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)}},w5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ni},J0=e=>typeof e=="bigint"||Number.isInteger(e),X_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function v5(e,t,n){const{value:r}=e;return J0(r)&&r>=0?n+r.toString(t):Ni(e)}const _5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>X_(e,2,8,n),stringify:e=>v5(e,8,"0o")},k5={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>X_(e,0,10,n),stringify:Ni},N5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>X_(e,2,16,n),stringify:e=>v5(e,16,"0x")},Pge=[Lu,Mu,Q0,Z0,q_,_5,k5,N5,E5,x5,w5];function zC(e){return typeof e=="bigint"||Number.isInteger(e)}const Pp=({value:e})=>JSON.stringify(e),Bge=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Pp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Pp},{identify:zC,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})=>zC(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:Pp}],Fge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Uge=[Lu,Mu].concat(Bge,Fge),Q_={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;s{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(G_(c,u,r))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;er(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new qr(t,t==null?void 0:t.value):r=new qr(t.key,t.value);const s=qo(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`);bn(s.value)&&u5(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const l=this.items.findIndex(c=>i(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=qo(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=qo(this.items,t),s=r==null?void 0:r.value;return(!n&&bn(s)?s.value:s)??void 0}has(t){return!!qo(this.items,t)}set(t,n){this.add(new qr(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)y5(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!er(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})),b5(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Mu={collection:"map",default:!0,nodeClass:Fs,tag:"tag:yaml.org,2002:map",resolve(e,t){return Sh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Fs.from(e,t,n)};class bl extends d5{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ru,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Dp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Dp(t);if(typeof r!="number")return;const s=this.items[r];return!n&&bn(s)?s.value:s}has(t){const n=Dp(t);return typeof n=="number"&&n=0?t:null}const ju={collection:"seq",default:!0,nodeClass:bl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Th(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>bl.from(e,t,n)},Q0={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),W_(e,t,n,r)}},Z0={identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yt(null),stringify:({source:e},t)=>typeof e=="string"&&Z0.test.test(e)?e:t.options.nullStr},q_={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&q_.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 l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const E5={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},x5={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)}},w5={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 yt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ni},J0=e=>typeof e=="bigint"||Number.isInteger(e),X_=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function v5(e,t,n){const{value:r}=e;return J0(r)&&r>=0?n+r.toString(t):Ni(e)}const _5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>X_(e,2,8,n),stringify:e=>v5(e,8,"0o")},k5={identify:J0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>X_(e,0,10,n),stringify:Ni},N5={identify:e=>J0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>X_(e,2,16,n),stringify:e=>v5(e,16,"0x")},Bge=[Mu,ju,Q0,Z0,q_,_5,k5,N5,E5,x5,w5];function zC(e){return typeof e=="bigint"||Number.isInteger(e)}const Pp=({value:e})=>JSON.stringify(e),Fge=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Pp},{identify:e=>e==null,createNode:()=>new yt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Pp},{identify:zC,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})=>zC(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:Pp}],Uge={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},$ge=[Mu,ju].concat(Fge,Uge),Q_={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 qr(new yt(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]=er(r)?r:new qr(r)}}else t("Expected a sequence for this tag");return e}function T5(e,t,n){const{replacer:r}=n,s=new bl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(G_(l,c,n))}return s}const Z_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:S5,createNode:T5};class Mc extends bl{constructor(){super(),this.add=Fs.prototype.add.bind(this),this.delete=Fs.prototype.delete.bind(this),this.get=Fs.prototype.get.bind(this),this.has=Fs.prototype.has.bind(this),this.set=Fs.prototype.set.bind(this),this.tag=Mc.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(er(s)?(i=zs(s.key,"",n),a=zs(s.value,i,n)):i=zs(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=T5(t,n,r),i=new this;return i.items=s.items,i}}Mc.tag="tag:yaml.org,2002:omap";const J_={collection:"seq",identify:e=>e instanceof Map,nodeClass:Mc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=S5(e,t),r=[];for(const{key:s}of n.items)bn(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Mc,n)},createNode:(e,t,n)=>Mc.from(e,t,n)};function A5({value:e,source:t},n){return t&&(e?C5:I5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const C5={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 yt(!0),stringify:A5},I5={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 yt(!1),stringify:A5},$ge={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},Hge={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)}},zge={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 yt(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},Ah=e=>typeof e=="bigint"||Number.isInteger(e);function ey(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 ek(e,t,n){const{value:r}=e;if(Ah(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Ni(e)}const Vge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ey(e,2,2,n),stringify:e=>ek(e,2,"0b")},Kge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ey(e,1,8,n),stringify:e=>ek(e,8,"0")},Yge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ey(e,0,10,n),stringify:Ni},Wge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ey(e,2,16,n),stringify:e=>ek(e,16,"0x")};class jc extends Fs{constructor(t){super(t),this.tag=jc.tag}add(t){let n;er(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new qr(t.key,null):n=new qr(t,null),qo(this.items,n.key)||this.items.push(n)}get(t,n){const r=qo(this.items,t);return!n&&er(r)?bn(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=qo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new qr(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(G_(a,null,r));return i}}jc.tag="tag:yaml.org,2002:set";const tk={collection:"map",identify:e=>e instanceof Set,nodeClass:jc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>jc.from(e,t,n),resolve(e,t){if(Sh(e)){if(e.hasAllNullValues(!0))return Object.assign(new jc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function nk(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function R5(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 O5={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})=>nk(e,n),stringify:R5},L5={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=>nk(e,!1),stringify:R5},ty={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(ty.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=nk(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$/,""))??""},VC=[Lu,Mu,Q0,Z0,C5,I5,Vge,Kge,Yge,Wge,$ge,Hge,zge,Q_,ha,J_,Z_,tk,O5,L5,ty],KC=new Map([["core",Pge],["failsafe",[Lu,Mu,Q0]],["json",Uge],["yaml11",VC],["yaml-1.1",VC]]),YC={binary:Q_,bool:q_,float:w5,floatExp:x5,floatNaN:E5,floatTime:L5,int:k5,intHex:N5,intOct:_5,intTime:O5,map:Lu,merge:ha,null:Z0,omap:J_,pairs:Z_,seq:Mu,set:tk,timestamp:ty},Gge={"tag:yaml.org,2002:binary":Q_,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":J_,"tag:yaml.org,2002:pairs":Z_,"tag:yaml.org,2002:set":tk,"tag:yaml.org,2002:timestamp":ty};function Kb(e,t,n){const r=KC.get(t);if(r&&!e)return n&&!r.includes(ha)?r.concat(ha):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(KC.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(ha)),s.reduce((i,a)=>{const l=typeof a=="string"?YC[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(YC).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const qge=(e,t)=>e.keyt.key?1:0;class rk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?Kb(t,"compat"):t?Kb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Gge:{},this.tags=Kb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,oo,{value:Lu}),Object.defineProperty(this,Ki,{value:Q0}),Object.defineProperty(this,Iu,{value:Mu}),this.sortMapEntries=typeof a=="function"?a:a===!0?qge:null}clone(){const t=Object.create(rk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Xge(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=h5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ca(u,""))}let a=!1,l=null;if(e.contents){if(Jn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ca(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=pu(e.contents,s,()=>l=null,u);l&&(d+=Go(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(pu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +${i.comment}`:r.comment}r=s}e.items[n]=er(r)?r:new qr(r)}}else t("Expected a sequence for this tag");return e}function T5(e,t,n){const{replacer:r}=n,s=new bl(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 l,c;if(Array.isArray(a))if(a.length===2)l=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)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;s.items.push(G_(l,c,n))}return s}const Z_={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:S5,createNode:T5};class jc extends bl{constructor(){super(),this.add=Fs.prototype.add.bind(this),this.delete=Fs.prototype.delete.bind(this),this.get=Fs.prototype.get.bind(this),this.has=Fs.prototype.has.bind(this),this.set=Fs.prototype.set.bind(this),this.tag=jc.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(er(s)?(i=zs(s.key,"",n),a=zs(s.value,i,n)):i=zs(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=T5(t,n,r),i=new this;return i.items=s.items,i}}jc.tag="tag:yaml.org,2002:omap";const J_={collection:"seq",identify:e=>e instanceof Map,nodeClass:jc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=S5(e,t),r=[];for(const{key:s}of n.items)bn(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new jc,n)},createNode:(e,t,n)=>jc.from(e,t,n)};function A5({value:e,source:t},n){return t&&(e?C5:I5).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const C5={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 yt(!0),stringify:A5},I5={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 yt(!1),stringify:A5},Hge={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},zge={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)}},Vge={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 yt(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},Ah=e=>typeof e=="bigint"||Number.isInteger(e);function ey(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 ek(e,t,n){const{value:r}=e;if(Ah(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return Ni(e)}const Kge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ey(e,2,2,n),stringify:e=>ek(e,2,"0b")},Yge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ey(e,1,8,n),stringify:e=>ek(e,8,"0")},Wge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ey(e,0,10,n),stringify:Ni},Gge={identify:Ah,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ey(e,2,16,n),stringify:e=>ek(e,16,"0x")};class Dc extends Fs{constructor(t){super(t),this.tag=Dc.tag}add(t){let n;er(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new qr(t.key,null):n=new qr(t,null),qo(this.items,n.key)||this.items.push(n)}get(t,n){const r=qo(this.items,t);return!n&&er(r)?bn(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=qo(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new qr(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(G_(a,null,r));return i}}Dc.tag="tag:yaml.org,2002:set";const tk={collection:"map",identify:e=>e instanceof Set,nodeClass:Dc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Dc.from(e,t,n),resolve(e,t){if(Sh(e)){if(e.hasAllNullValues(!0))return Object.assign(new Dc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function nk(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,l)=>a*s(60)+s(l),s(0));return n==="-"?s(-1)*i:i}function R5(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 O5={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})=>nk(e,n),stringify:R5},L5={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=>nk(e,!1),stringify:R5},ty={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(ty.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,a,l]=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,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=nk(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$/,""))??""},VC=[Mu,ju,Q0,Z0,C5,I5,Kge,Yge,Wge,Gge,Hge,zge,Vge,Q_,ha,J_,Z_,tk,O5,L5,ty],KC=new Map([["core",Bge],["failsafe",[Mu,ju,Q0]],["json",$ge],["yaml11",VC],["yaml-1.1",VC]]),YC={binary:Q_,bool:q_,float:w5,floatExp:x5,floatNaN:E5,floatTime:L5,int:k5,intHex:N5,intOct:_5,intTime:O5,map:Mu,merge:ha,null:Z0,omap:J_,pairs:Z_,seq:ju,set:tk,timestamp:ty},qge={"tag:yaml.org,2002:binary":Q_,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":J_,"tag:yaml.org,2002:pairs":Z_,"tag:yaml.org,2002:set":tk,"tag:yaml.org,2002:timestamp":ty};function Kb(e,t,n){const r=KC.get(t);if(r&&!e)return n&&!r.includes(ha)?r.concat(ha):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(KC.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(ha)),s.reduce((i,a)=>{const l=typeof a=="string"?YC[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(YC).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const Xge=(e,t)=>e.keyt.key?1:0;class rk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?Kb(t,"compat"):t?Kb(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?qge:{},this.tags=Kb(n,this.name,r),this.toStringOptions=l??null,Object.defineProperty(this,oo,{value:Mu}),Object.defineProperty(this,Ki,{value:Q0}),Object.defineProperty(this,Ru,{value:ju}),this.sortMapEntries=typeof a=="function"?a:a===!0?Xge:null}clone(){const t=Object.create(rk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Qge(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=h5(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(ca(u,""))}let a=!1,l=null;if(e.contents){if(Jn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(ca(f,""))}s.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=mu(e.contents,s,()=>l=null,u);l&&(d+=Go(d,"",i(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(mu(e.contents,s));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(` `)?(n.push("..."),n.push(ca(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(ca(i(u),"")))}return n.join(` `)+` -`}class Ch{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ys,{value:Cx});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(Ch.prototype,{[Ys]:{value:Cx}});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=Jn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){$l(this.contents)&&this.contents.add(t)}addIn(t,n){$l(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=l5(this);t.anchor=!n||r.has(n)?c5(n||"a",r):n}return new Y_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=kge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=Gf(t,d,m);return l&&Zn(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new qr(s,i)}delete(t){return $l(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Td(t)?this.contents==null?!1:(this.contents=null,!0):$l(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Zn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Td(t)?!n&&bn(this.contents)?this.contents.value:this.contents:Zn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Zn(this.contents)?this.contents.has(t):!1}hasIn(t){return Td(t)?this.contents!==void 0:Zn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Lg(this.schema,[t],n):$l(this.contents)&&this.contents.set(t,n)}setIn(t,n){Td(t)?this.contents=n:this.contents==null?this.contents=Lg(this.schema,Array.from(t),n):$l(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 rk(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=zs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?Ec(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 Xge(this,t)}}function $l(e){if(Zn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class M5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ad extends M5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Qge extends M5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const WC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class Ch{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ys,{value:Cx});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(Ch.prototype,{[Ys]:{value:Cx}});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=Jn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){$l(this.contents)&&this.contents.add(t)}addIn(t,n){$l(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=l5(this);t.anchor=!n||r.has(n)?c5(n||"a",r):n}return new Y_(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(w).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Nge(this,a||"a"),m={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:p},g=Gf(t,d,m);return l&&Zn(g)&&(g.flow=!0),h(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new qr(s,i)}delete(t){return $l(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Td(t)?this.contents==null?!1:(this.contents=null,!0):$l(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Zn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Td(t)?!n&&bn(this.contents)?this.contents.value:this.contents:Zn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Zn(this.contents)?this.contents.has(t):!1}hasIn(t){return Td(t)?this.contents!==void 0:Zn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Lg(this.schema,[t],n):$l(this.contents)&&this.contents.set(t,n)}setIn(t,n){Td(t)?this.contents=n:this.contents==null?this.contents=Lg(this.schema,Array.from(t),n):$l(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 rk(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 l={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=zs(this.contents,n??"",l);if(typeof i=="function")for(const{count:u,res:d}of l.anchors.values())i(d,u);return typeof a=="function"?xc(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 Qge(this,t)}}function $l(e){if(Zn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class M5 extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class Ad extends M5{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Zge extends M5{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const WC=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));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 l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);l.length>80&&(l=l.substring(0,79)+`… `),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===r&&c.col>s&&(l=Math.max(1,Math.min(c.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`: ${a} ${u} -`}};function mu(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",p=!1,m=!1,g=null,w=null,y=null,b=null,x=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),g&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(g=S),d=!0;break;case"comment":{d||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=S.source:(!_||n!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,p=!0,(w||y)&&(b=S),d=!0;break;case"anchor":w&&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),w=S,k??(k=S.offset),u=!1,d=!1,m=!0;break;case"tag":{y&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),y=S,k??(k=S.offset),u=!1,d=!1,m=!0;break}case n:(w||y)&&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){x&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=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],T=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"),g&&(u&&g.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:_,spaceBefore:c,comment:f,hasNewline:p,anchor:w,tag:y,newlineAfterProp:b,end:T,start:k??T}}function qf(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(qf(t.key)||qf(t.value))return!0}return!1;default:return!0}}function Lx(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&qf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function j5(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,a)=>i===a||bn(i)&&bn(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const GC="All mapping items must start at the same column";function Zge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Fs,l=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:g}=f,w=mu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",GC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` -`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||qf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",GC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Lx(r.indent,p,s),n.atKey=!1,j5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=mu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Lx(r.indent,g,s),c=k.range[2];const N=new qr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` -`+_.comment:x.comment=_.comment);const k=new qr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function e0e({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Fs:bl),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 y=0;yi===a||bn(i)&&bn(a)&&i.value===a.value;return t.some(i=>s(i.key,n))}const GC="All mapping items must start at the same column";function Jge({composeNode:e,composeEmptyNode:t},n,r,s,i){var d;const a=(i==null?void 0:i.nodeClass)??Fs,l=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:g}=f,w=gu(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),y=!w.found;if(y){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",GC)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(l.comment?l.comment+=` +`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||qf(p))&&s(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=w.found)==null?void 0:d.indent)!==r.indent&&s(c,"BAD_INDENT",GC);n.atKey=!0;const b=w.end,x=p?e(n,p,w,s):t(n,b,h,null,w,s);n.schema.compat&&Lx(r.indent,p,s),n.atKey=!1,j5(n,l.items,x)&&s(b,"DUPLICATE_KEY","Map keys must be unique");const _=gu(m??[],{indicator:"map-value-ind",next:g,offset:x.range[2],onError:s,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=_.end,_.found){y&&((g==null?void 0:g.type)==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&s(x.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?e(n,g,_,s):t(n,c,m,null,_,s);n.schema.compat&&Lx(r.indent,g,s),c=k.range[2];const N=new qr(x,k);n.options.keepSourceTokens&&(N.srcToken=f),l.items.push(N)}else{y&&s(x.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(x.comment?x.comment+=` +`+_.comment:x.comment=_.comment);const k=new qr(x);n.options.keepSourceTokens&&(k.srcToken=f),l.items.push(k)}}return u&&ue&&(e.type==="block-map"||e.type==="block-seq");function t0e({composeNode:e,composeEmptyNode:t},n,r,s,i){var w;const a=r.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Fs:bl),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 y=0;y0){const y=Ih(m,g,n.options.strict,s);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Gb(e,t,n,r,s,i){const a=n.type==="block-map"?Zge(e,t,n,r,i):n.type==="block-seq"?Jge(e,t,n,r,i):e0e(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function t0e(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gb(e,t,n,s,a)}const u=Gb(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=Jn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function n0e(e,t,n){const r=t.offset,s=r0e(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?s0e(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` +`+y.comment:u.comment=y.comment),u.range=[r.offset,g,y.offset]}else u.range=[r.offset,g,g];return u}function Gb(e,t,n,r,s,i){const a=n.type==="block-map"?Jge(e,t,n,r,i):n.type==="block-seq"?e0e(e,t,n,r,i):t0e(e,t,n,r,i),l=a.constructor;return s==="!"||s===l.tagName?(a.tag=l.tagName,a):(s&&(a.tag=s),a)}function n0e(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,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?s(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Gb(e,t,n,s,a)}const u=Gb(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=Jn(d)?d:new yt(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function r0e(e,t,n){const r=t.offset,s=s0e(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?yt.BLOCK_FOLDED:yt.BLOCK_LITERAL,a=t.source?i0e(t.source):[];let l=a.length;for(let g=a.length-1;g>=0;--g){const w=a[g][1];if(w===""||w==="\r")l=g;else break}if(l===0){const g=s.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,u=t.offset+s.length,d=0;for(let g=0;gc&&(c=w.length);else{w.length=l;--g)a[g][0].length>c&&(l=g+1);let f="",h="",p=!1;for(let g=0;gc||y[0]===" "?(h===" "?h=` @@ -666,33 +666,33 @@ ${u} `+a[g][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const m=r+s.length+t.source.length;return{value:f,type:i,comment:s.comment,range:[r,m,m]}}function r0e({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let a=0,l="",c=-1;for(let h=1;hn(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=a0e(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=o0e(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=l0e(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=Ih(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function a0e(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}`),D5(e)}function o0e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),D5(e.slice(1,-1)).replace(/''/g,"'")}function D5(e){let t,n;try{t=new RegExp(`(.*?)(?n(r+h,p,m);switch(s){case"scalar":l=yt.PLAIN,c=o0e(i,u);break;case"single-quoted-scalar":l=yt.QUOTE_SINGLE,c=l0e(i,u);break;case"double-quoted-scalar":l=yt.QUOTE_DOUBLE,c=c0e(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=Ih(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[r,d,f.offset]}}function o0e(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}`),D5(e)}function l0e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),D5(e.slice(1,-1)).replace(/''/g,"'")}function D5(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 c0e(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function u0e(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 u0e={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function d0e(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 l=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function P5(e,t,n,r){const{value:s,type:i,comment:a,range:l}=t.type==="block-scalar"?n0e(e,t,r):i0e(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[Ki]:c?u=f0e(e.schema,s,c,n,r):t.type==="scalar"?u=h0e(e,s,t,r):u=e.schema[Ki];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=bn(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function f0e(e,t,n,r,s){var l;if(n==="!")return e[Ki];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((l=c.test)!=null&&l.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[Ki])}function h0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[Ki];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[Ki];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function p0e(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 m0e={composeNode:B5,composeEmptyNode:sk};function B5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=g0e(e,t,r),(l||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=P5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=t0e(m0e,e,t,n,r),l&&(u.anchor=l.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=sk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!bn(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 sk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:p0e(t,n,r),indent:-1,source:""},f=P5(e,d,l,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 g0e({options:e},{offset:t,source:n,end:r},s){const i=new Y_(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,l=Ih(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function y0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new Ch(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=mu(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?B5(u,s,d,a):sk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Ih(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function ud(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 qC(e){var s;let t="",n=!1,r=!1;for(let i=0;ir(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Ki]:c?u=h0e(e.schema,s,c,n,r):t.type==="scalar"?u=p0e(e,s,t,r):u=e.schema[Ki];let d;try{const f=u.resolve(s,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=bn(f)?f:new yt(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new yt(s)}return d.range=l,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function h0e(e,t,n,r,s){var l;if(n==="!")return e[Ki];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((l=c.test)!=null&&l.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[Ki])}function p0e({atKey:e,directives:t,schema:n},r,s,i){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||n[Ki];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))})??n[Ki];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return a}function m0e(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 g0e={composeNode:B5,composeEmptyNode:sk};function B5(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=y0e(e,t,r),(l||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=P5(e,t,c,r),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=n0e(g0e,e,t,n,r),l&&(u.anchor=l.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=sk(e,t.offset,void 0,null,n,r)),l&&u.anchor===""&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!bn(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 sk(e,t,n,r,{spaceBefore:s,comment:i,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:m0e(t,n,r),indent:-1,source:""},f=P5(e,d,l,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 y0e({options:e},{offset:t,source:n,end:r},s){const i=new Y_(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,l=Ih(r,a,e.strict,s);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function b0e(e,t,{offset:n,start:r,value:s,end:i},a){const l=Object.assign({_directives:t},e),c=new Ch(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=gu(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?B5(u,s,d,a):sk(u,d.end,r,null,d,a);const f=c.contents.range[2],h=Ih(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function dd(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 qC(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const a=ud(n);i?this.warnings.push(new Qge(a,r,s)):this.errors.push(new Ad(a,r,s))},this.directives=new Kr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qC(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} +`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((s=e[i+1])==null?void 0:s[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class E0e{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const a=dd(n);i?this.warnings.push(new Zge(a,r,s)):this.errors.push(new Ad(a,r,s))},this.directives=new Kr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=qC(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(Zn(i)&&!i.flow&&i.items.length>0){let a=i.items[0];er(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${r} ${l}`:r}else{const a=i.commentBefore;i.commentBefore=a?`${r} -${a}`:r}}if(n){for(let i=0;i{const i=ud(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=y0e(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 Ad(ud(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 Ad(ud(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Ih(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 Ad(ud(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 Ch(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 F5="\uFEFF",U5="",$5="",Mx="";function E0e(e){switch(e){case F5:return"byte-order-mark";case U5:return"doc-mode";case $5:return"flow-error-end";case Mx:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:r}}if(n){for(let i=0;i{const i=dd(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=b0e(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 Ad(dd(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 Ad(dd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Ih(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 Ad(dd(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 Ch(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 F5="\uFEFF",U5="",$5="",Mx="";function x0e(e){switch(e){case F5:return"byte-order-mark";case U5:return"doc-mode";case $5:return"flow-error-end";case Mx: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 ii(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const XC=new Set("0123456789ABCDEFabcdef"),x0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bp=new Set(",[]{}"),w0e=new Set(` ,[]{} -\r `),qb=e=>!e||w0e.has(e);class v0e{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:case"\r":case" ":return!0;default:return!1}}const XC=new Set("0123456789ABCDEFabcdef"),w0e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bp=new Set(",[]{}"),v0e=new Set(` ,[]{} +\r `),qb=e=>!e||v0e.has(e);class _0e{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===` @@ -707,30 +707,30 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus `&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield Mx,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(ii(i)||t&&Bp.has(i))break;n=r}else if(ii(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` `?(r+=1,s=` `,i=this.buffer[r+1]):n=r),i==="#"||t&&Bp.has(i))break;if(s===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Bp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Mx,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(qb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ii(r)||n&&Bp.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(;!ii(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(x0e.has(n))n=this.buffer[++t];else if(n==="%"&&XC.has(this.buffer[t+1])&&XC.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&Bp.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Mx,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(qb),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ii(r)||n&&Bp.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(;!ii(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(w0e.has(n))n=this.buffer[++t];else if(n==="%"&&XC.has(this.buffer[t+1])&&XC.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 _0e{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 jg(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"&&ZC(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&&QC(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class k0e{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 jg(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"&&ZC(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&&QC(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 l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(za(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(H5(n.key)&&!za(n.sep,"newline")){const l=Hl(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:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(za(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Hl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):za(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!za(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(l);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)){jg(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||za(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=Fp(r),i=Hl(s);ZC(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={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]=l}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=Fp(t),r=Hl(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=Fp(t),r=Hl(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 N0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new _0e||null,prettyErrors:t}}function S0e(e,t={}){const{lineCounter:n,prettyErrors:r}=N0e(t),s=new k0e(n==null?void 0:n.addNewLine),i=new b0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Ad(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(WC(e,n)),a.warnings.forEach(WC(e,n))),a}function T0e(e,t,n){let r;const s=S0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>p5(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 A0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Nh(e)&&!r?e.toString(n):new Ch(e,r,n).toString(n)}const z5=new Set(["local","sqlite","mysql","postgresql"]),V5=new Set(["local","opensearch","redis","viking","mem0"]),K5=new Set(["opensearch","viking","context_search"]),Y5=new Set(["apmplus","cozeloop","tls"]),W5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),C0e=new Set(["llm","sequential","parallel","loop","a2a"]);function vt(e,t=""){return typeof e=="string"?e:t}function Bs(e){return e===!0}function sf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function G5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:vt(t.name),description:vt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Dc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function q5(e){return typeof e=="string"&&C0e.has(e)?e:"llm"}function X5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function Q5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Bs(t.enabled),registrySpaceId:vt(t.registrySpaceId),registryTopK:vt(t.registryTopK),registryRegion:vt(t.registryRegion),registryEndpoint:vt(t.registryEndpoint)}}function Z5(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=Q5(n.a2aRegistry),i=q5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Wr(),name:vt(n.name),description:vt(n.description),instruction:vt(n.instruction),agentType:a,maxIterations:X5(n.maxIterations),a2aUrl:vt(n.a2aUrl),modelName:vt(n.modelName),modelProvider:vt(n.modelProvider),modelApiBase:vt(n.modelApiBase),builtinTools:sf(n.builtinTools).filter(l=>W5.has(l)),customTools:G5(n.customTools),memory:{shortTerm:Bs(r.shortTerm),longTerm:Bs(r.longTerm)},shortTermBackend:Dc(n.shortTermBackend,z5,"local"),longTermBackend:Dc(n.longTermBackend,V5,"local"),autoSaveSession:Bs(n.autoSaveSession),knowledgebase:Bs(n.knowledgebase),knowledgebaseBackend:Dc(n.knowledgebaseBackend,K5,Zc),knowledgebaseIndex:vt(n.knowledgebaseIndex),tracing:Bs(n.tracing),tracingExporters:sf(n.tracingExporters).filter(l=>Y5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:Z5(n.subAgents),selectedSkills:J5(n)}}):[]}function J5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=vt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=vt(r.name)||vt(r.slug)||vt(r.skillName)||vt(r.skillId)||"skill",l=vt(r.folder)||a,c=vt(r.description);if(i==="skillhub"){const f=vt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:vt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=vt(m.path),w=vt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=vt(r.skillSpaceId),d=vt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:vt(r.skillSpaceName),skillId:d,version:vt(r.version)})}return t}function ik(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=Q5(t.a2aRegistry),i=q5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:vt(u.name),transport:d,url:vt(u.url),authToken:vt(u.authToken),command:vt(u.command),args:sf(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Wr(),name:vt(t.name)||"my_agent",description:vt(t.description),instruction:vt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:X5(t.maxIterations),a2aUrl:vt(t.a2aUrl),modelName:vt(t.modelName),modelProvider:vt(t.modelProvider),modelApiBase:vt(t.modelApiBase),builtinTools:sf(t.builtinTools).filter(c=>W5.has(c)),customTools:G5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Bs(n.shortTerm),longTerm:Bs(n.longTerm)},shortTermBackend:Dc(t.shortTermBackend,z5,"local"),longTermBackend:Dc(t.longTermBackend,V5,"local"),autoSaveSession:Bs(t.autoSaveSession),knowledgebase:Bs(t.knowledgebase),knowledgebaseBackend:Dc(t.knowledgebaseBackend,K5,Zc),knowledgebaseIndex:vt(t.knowledgebaseIndex),tracing:Bs(t.tracing),tracingExporters:sf(t.tracingExporters).filter(c=>Y5.has(c)),deployment:{feishuEnabled:Bs(r.feishuEnabled)},subAgents:Z5(t.subAgents),selectedSkills:J5(t)}}function eB(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||Ei.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||Ei.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||Ei.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),(l=e.modelName)!=null&&l.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,T,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(T=_.authToken)!=null&&T.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(eB)),t}function I0e(e){return`# VeADK Agent 结构配置 +`,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=Fp(t),r=Hl(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=Fp(t),r=Hl(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 S0e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new k0e||null,prettyErrors:t}}function T0e(e,t={}){const{lineCounter:n,prettyErrors:r}=S0e(t),s=new N0e(n==null?void 0:n.addNewLine),i=new E0e(t);let a=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Ad(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(WC(e,n)),a.warnings.forEach(WC(e,n))),a}function A0e(e,t,n){let r;const s=T0e(e,n);if(!s)return null;if(s.warnings.forEach(i=>p5(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 C0e(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return Nh(e)&&!r?e.toString(n):new Ch(e,r,n).toString(n)}const z5=new Set(["local","sqlite","mysql","postgresql"]),V5=new Set(["local","opensearch","redis","viking","mem0"]),K5=new Set(["opensearch","viking","context_search"]),Y5=new Set(["apmplus","cozeloop","tls"]),W5=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),I0e=new Set(["llm","sequential","parallel","loop","a2a"]);function vt(e,t=""){return typeof e=="string"?e:t}function Bs(e){return e===!0}function sf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function G5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:vt(t.name),description:vt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Pc(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function q5(e){return typeof e=="string"&&I0e.has(e)?e:"llm"}function X5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function Q5(e){const t=e&&typeof e=="object"?e:{};return{enabled:Bs(t.enabled),registrySpaceId:vt(t.registrySpaceId),registryTopK:vt(t.registryTopK),registryRegion:vt(t.registryRegion),registryEndpoint:vt(t.registryEndpoint)}}function Z5(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=Q5(n.a2aRegistry),i=q5(n.agentType),a=s.enabled&&i==="llm"?"a2a":i;return{...Wr(),name:vt(n.name),description:vt(n.description),instruction:vt(n.instruction),agentType:a,maxIterations:X5(n.maxIterations),a2aUrl:vt(n.a2aUrl),modelName:vt(n.modelName),modelProvider:vt(n.modelProvider),modelApiBase:vt(n.modelApiBase),builtinTools:sf(n.builtinTools).filter(l=>W5.has(l)),customTools:G5(n.customTools),memory:{shortTerm:Bs(r.shortTerm),longTerm:Bs(r.longTerm)},shortTermBackend:Pc(n.shortTermBackend,z5,"local"),longTermBackend:Pc(n.longTermBackend,V5,"local"),autoSaveSession:Bs(n.autoSaveSession),knowledgebase:Bs(n.knowledgebase),knowledgebaseBackend:Pc(n.knowledgebaseBackend,K5,Jc),knowledgebaseIndex:vt(n.knowledgebaseIndex),tracing:Bs(n.tracing),tracingExporters:sf(n.tracingExporters).filter(l=>Y5.has(l)),a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,subAgents:Z5(n.subAgents),selectedSkills:J5(n)}}):[]}function J5(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},s=vt(r.source),i=s==="local"||s==="skillspace"||s==="skillhub"?s:"skillhub",a=vt(r.name)||vt(r.slug)||vt(r.skillName)||vt(r.skillId)||"skill",l=vt(r.folder)||a,c=vt(r.description);if(i==="skillhub"){const f=vt(r.slug);if(!f)continue;t.push({source:i,folder:l,name:a,description:c,slug:f,namespace:vt(r.namespace)||"public"});continue}if(i==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},g=vt(m.path),w=vt(m.content);return g?{path:g,content:w}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:i,folder:l,name:a,description:c,localFiles:h});continue}const u=vt(r.skillSpaceId),d=vt(r.skillId);!u||!d||t.push({source:i,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:vt(r.skillSpaceName),skillId:d,version:vt(r.version)})}return t}function ik(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=Q5(t.a2aRegistry),i=q5(t.agentType),a=s.enabled&&i==="llm"?"a2a":i,l=Array.isArray(t.mcpTools)?t.mcpTools.map(c=>{const u=c&&typeof c=="object"?c:{},d=u.transport==="stdio"?"stdio":"http";return{name:vt(u.name),transport:d,url:vt(u.url),authToken:vt(u.authToken),command:vt(u.command),args:sf(u.args)}}).filter(c=>c.transport==="http"?!!c.url:!!c.command):[];return{...Wr(),name:vt(t.name)||"my_agent",description:vt(t.description),instruction:vt(t.instruction)||"You are a helpful assistant.",agentType:a,maxIterations:X5(t.maxIterations),a2aUrl:vt(t.a2aUrl),modelName:vt(t.modelName),modelProvider:vt(t.modelProvider),modelApiBase:vt(t.modelApiBase),builtinTools:sf(t.builtinTools).filter(c=>W5.has(c)),customTools:G5(t.customTools),mcpTools:l,a2aRegistry:a==="a2a"?{...s,enabled:!0}:s,memory:{shortTerm:Bs(n.shortTerm),longTerm:Bs(n.longTerm)},shortTermBackend:Pc(t.shortTermBackend,z5,"local"),longTermBackend:Pc(t.longTermBackend,V5,"local"),autoSaveSession:Bs(t.autoSaveSession),knowledgebase:Bs(t.knowledgebase),knowledgebaseBackend:Pc(t.knowledgebaseBackend,K5,Jc),knowledgebaseIndex:vt(t.knowledgebaseIndex),tracing:Bs(t.tracing),tracingExporters:sf(t.tracingExporters).filter(c=>Y5.has(c)),deployment:{feishuEnabled:Bs(r.feishuEnabled)},subAgents:Z5(t.subAgents),selectedSkills:J5(t)}}function eB(e){var n,r,s,i,a,l,c,u,d,f,h,p,m,g,w,y,b,x;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())||Ei.topK,_.registryRegion=((i=e.a2aRegistry.registryRegion)==null?void 0:i.trim())||Ei.region,_.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||Ei.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),(l=e.modelName)!=null&&l.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,T,S,R;const k={name:_.name,transport:_.transport};return(N=_.url)!=null&&N.trim()&&(k.url=_.url.trim()),(T=_.authToken)!=null&&T.trim()&&(k.authToken=_.authToken.trim()),(S=_.command)!=null&&S.trim()&&(k.command=_.command.trim()),(R=_.args)!=null&&R.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",(g=e.knowledgebaseIndex)!=null&&g.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((w=e.tracingExporters)!=null&&w.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(b=e.selectedSkills)!=null&&b.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})),(x=e.subAgents)!=null&&x.length&&(t.subAgents=e.subAgents.map(eB)),t}function R0e(e){return`# VeADK Agent 结构配置 # 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+A0e(eB(e))}function R0e(e){const t=T0e(e);return ik(t)}const O0e=[{kind:"custom",icon:SV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:uV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:iV,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:TV,title:"工作流",desc:"敬请期待",disabled:!0}];function L0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=O0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(R0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(s5,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(kV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const M0e="modulepreload",j0e=function(e){return"/"+e},JC={},Pc=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=j0e(c),c in JC)return;JC[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":M0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function tB(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 D0e(e,t){return tB([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function nB(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 eI(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const P0e="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",B0e=(()=>{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 F0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Dn(e,t){e.push(t&255,t>>>8&255)}function hs(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const tI=2048,Xb=20,nI=0;function U0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=F0e(g),y=g.length,b=[];hs(b,67324752),Dn(b,Xb),Dn(b,tI),Dn(b,nI),Dn(b,0),Dn(b,0),hs(b,w),hs(b,y),hs(b,y),Dn(b,m.length),Dn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];hs(m,33639248),Dn(m,Xb),Dn(m,Xb),Dn(m,tI),Dn(m,nI),Dn(m,0),Dn(m,0),hs(m,p.crc),hs(m,p.size),hs(m,p.size),Dn(m,p.nameBytes.length),Dn(m,0),Dn(m,0),Dn(m,0),Dn(m,0),hs(m,0),hs(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];hs(c,101010256),Dn(c,0),Dn(c,0),Dn(c,r.length),Dn(c,r.length),hs(c,l),hs(c,i),Dn(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 $0e=E.lazy(()=>Pc(()=>import("./CodeEditor-DdBhy0vU.js"),[]));function H0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function z0e(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 rB({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>H0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return z0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx($s,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(RM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return vs.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(Tr,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx($0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function V0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(bv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(rB,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Dg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx($t,{className:"spin"}):o.jsx(EV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(fV,{}):o.jsx(Ac,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(Gs,{}):o.jsx(d0,{})})]})]})}const K0e=5e4;function Y0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` +`+C0e(eB(e))}function O0e(e){const t=A0e(e);return ik(t)}const L0e=[{kind:"custom",icon:TV,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:dV,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:aV,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:AV,title:"工作流",desc:"敬请期待",disabled:!0}];function M0e({onSelect:e,onImport:t}){const n=E.useRef(null),[r,s]=E.useState(""),i=L0e.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(O0e(d))}catch(d){s(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(s5,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:i,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(NV,{}),"导入 YAML 配置"]}),r&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const j0e="modulepreload",D0e=function(e){return"/"+e},JC={},Bc=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=D0e(c),c in JC)return;JC[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":j0e,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),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 l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function tB(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 P0e(e,t){return tB([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function nB(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 eI(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const B0e="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",F0e=(()=>{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 U0e(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Dn(e,t){e.push(t&255,t>>>8&255)}function hs(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const tI=2048,Xb=20,nI=0;function $0e(e){const t=new TextEncoder,n=[],r=[];let s=0;for(const p of e){const m=t.encode(p.path),g=t.encode(p.content),w=U0e(g),y=g.length,b=[];hs(b,67324752),Dn(b,Xb),Dn(b,tI),Dn(b,nI),Dn(b,0),Dn(b,0),hs(b,w),hs(b,y),hs(b,y),Dn(b,m.length),Dn(b,0);const x=Uint8Array.from(b);n.push(x,m,g),r.push({nameBytes:m,dataBytes:g,crc:w,size:y,offset:s}),s+=x.length+m.length+g.length}const i=s,a=[];let l=0;for(const p of r){const m=[];hs(m,33639248),Dn(m,Xb),Dn(m,Xb),Dn(m,tI),Dn(m,nI),Dn(m,0),Dn(m,0),hs(m,p.crc),hs(m,p.size),hs(m,p.size),Dn(m,p.nameBytes.length),Dn(m,0),Dn(m,0),Dn(m,0),Dn(m,0),hs(m,0),hs(m,p.offset);const g=Uint8Array.from(m);a.push(g,p.nameBytes),l+=g.length+p.nameBytes.length}const c=[];hs(c,101010256),Dn(c,0),Dn(c,0),Dn(c,r.length),Dn(c,r.length),hs(c,l),hs(c,i),Dn(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 H0e=E.lazy(()=>Bc(()=>import("./CodeEditor-CfI7VXuc.js"),[]));function z0e(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function V0e(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 rB({project:e,open:t,onClose:n,onChange:r}){var m;const[s,i]=E.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=E.useState(new Set),c=E.useRef(null),u=E.useMemo(()=>z0e(e.files),[e.files]),d=e.files.find(g=>g.path===s)??null;if(E.useEffect(()=>{var y;if(!t)return;const g=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const w=b=>{b.key==="Escape"&&n()};return window.addEventListener("keydown",w),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",w)}},[n,t]),E.useEffect(()=>{d||e.files.length===0||i(e.files[0].path)},[e.files,d]),!t)return null;function f(g){l(w=>{const y=new Set(w);return y.has(g)?y.delete(g):y.add(g),y})}function h(g,w,y){return V0e(g).map(b=>{const x=y?`${y}/${b.name}`:b.name;if(!(b.children.size>0&&b.path===void 0)&&b.path)return o.jsxs("button",{type:"button",className:`code-browser-file${s===b.path?" is-active":""}`,style:{paddingLeft:`${12+w*16}px`},onClick:()=>i(b.path??null),title:b.path,children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]},x);const k=a.has(x);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+w*16}px`},onClick:()=>f(x),"aria-expanded":!k,children:[o.jsx($s,{className:k?"":"is-open","aria-hidden":"true"}),o.jsx(RM,{"aria-hidden":"true"}),o.jsx("span",{children:b.name})]}),!k&&h(b,w+1,x)]},x)})}function p(g){d&&r({...e,files:e.files.map(w=>w.path===d.path?{...w,content:g}:w)})}return vs.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(bv,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(Ar,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(fT,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(H0e,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function K0e({project:e,onChange:t,className:n=""}){const[r,s]=E.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>s(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[o.jsx(bv,{"aria-hidden":"true"}),o.jsx("span",{children:"查看源码"})]}),o.jsx(rB,{project:e,open:r,onClose:()=>s(!1),onChange:t})]})}function Dg({message:e,className:t="",onRetry:n,retryLabel:r="重试部署"}){const[s,i]=E.useState(!1),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)}catch{l(!1)}},f=async()=>{if(!(!n||c)){u(!0);try{await n()}finally{u(!1)}}};return o.jsxs("div",{className:`deploy-error-message${s?" is-expanded":""}${t?` ${t}`:""}`,children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:c,onClick:()=>void f(),children:[c?o.jsx($t,{className:"spin"}):o.jsx(xV,{}),c?"重试中…":r]}),o.jsx("button",{type:"button",title:s?"收起错误信息":"展开完整错误信息","aria-label":s?"收起错误信息":"展开完整错误信息",onClick:()=>i(h=>!h),children:s?o.jsx(hV,{}):o.jsx(Cc,{})}),o.jsx("button",{type:"button",title:a?"已复制":"复制完整错误信息","aria-label":a?"已复制":"复制完整错误信息",onClick:()=>void d(),children:a?o.jsx(Gs,{}):o.jsx(d0,{})})]})]})}const Y0e=5e4;function W0e(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` `),r=t.split(` `),s=Math.min(n.length,r.length,260);for(let i=s;i>0;i-=1){const a=n.slice(-i).join(` `),l=r.slice(0,i).join(` `);if(a===l){const c=r.slice(i).join(` `);return c?`${e} ${c}`:e}}return`${e} -${t}`}function W0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` -`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function rI(e,t,n=K0e){const r=Y0e((e==null?void 0:e.text)??"",t.text??""),s=W0e(r,n),i=s.text?s.text.split(` -`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}ls.registerLanguage("python",cD);ls.registerLanguage("typescript",wD);ls.registerLanguage("javascript",rD);ls.registerLanguage("json",sD);ls.registerLanguage("yaml",vD);ls.registerLanguage("markdown",lD);ls.registerLanguage("bash",Q3);ls.registerLanguage("ini",Z3);ls.registerLanguage("dockerfile",yJ);ls.registerLanguage("makefile",oD);const G0e=E.lazy(()=>Pc(()=>import("./CodeEditor-DdBhy0vU.js"),[])),Da=()=>{};function q0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?vs.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(_V,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(Tr,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const X0e={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"},sI={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function iI(e){return e.replace(/&/g,"&").replace(//g,">")}function Q0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(sI[n])return sI[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 X0e[s]??null}function Z0e(e,t){try{const n=Q0e(t);return n&&ls.getLanguage(n)?ls.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?ls.highlightAuto(e).value:iI(e)}catch{return iI(e)}}const J0e=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],eye=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function tye(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function nye(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 rye(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function sye({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[vs.createPortal(e,n.left),vs.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function ny({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:T,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:j,deployDisabled:F=!1}){var fn,Bt,Kn;const Y=typeof l=="function",L=f.includes("更新"),U=j?eye:J0e,[C,M]=E.useState(((Bt=(fn=e==null?void 0:e.files)==null?void 0:fn[0])==null?void 0:Bt.path)??null),[O,D]=E.useState(new Set),[A,H]=E.useState(!1),[W,P]=E.useState(""),[te,X]=E.useState(!1),[ne,ce]=E.useState(!1),[J,fe]=E.useState(!1),[ee,Ee]=E.useState(!1),[ge,xe]=E.useState(null),[we,Te]=E.useState(null),[Re,Ye]=E.useState({}),[Le,bt]=E.useState(null),[Ze,ze]=E.useState(!1),[le,ve]=E.useState([]),[ct,ht]=E.useState(!1),[G,Z]=E.useState(!1),he=E.useRef(!0),De=ue=>o.jsxs("div",{className:"pp-network-region",onKeyDown:Se=>{Se.key==="Escape"&&Z(!1)},children:[ue&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":G,disabled:te||L||!T,onClick:()=>Z(Se=>!Se),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(yv,{className:`pp-region-chevron${G?" is-open":""}`})]}),G&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(Se=>{const Ce=Se.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":Ce,className:`pp-region-option${Ce?" is-selected":""}`,onClick:()=>{T==null||T(Se.value),Z(!1)},children:[o.jsx("span",{children:Se.label}),Ce&&o.jsx(Gs,{"aria-hidden":"true"})]},Se.value)})})]})]});E.useEffect(()=>(he.current=!0,()=>{he.current=!1}),[]),E.useEffect(()=>{if(!J)return;const ue=document.body.style.overflow;document.body.style.overflow="hidden";const Se=Ce=>{Ce.key==="Escape"&&fe(!1)};return window.addEventListener("keydown",Se),()=>{document.body.style.overflow=ue,window.removeEventListener("keydown",Se)}},[J]);const qe=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:tye(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const nt=e.files.find(ue=>ue.path===C)??null,Vt=(_==null?void 0:_.mode)??"public",Et=D0e(g?[...y,...ed]:y,b),Pt=Et.length+le.length;function Kt(ue){D(Se=>{const Ce=new Set(Se);return Ce.has(ue)?Ce.delete(ue):Ce.add(ue),Ce})}function Nt(ue,Se){l&&(l({...e,files:ue}),Se!==void 0&&M(Se))}function rn(ue){nt&&Nt(e.files.map(Se=>Se.path===nt.path?{...Se,content:ue}:Se))}function sn(){const ue=W.trim();if(H(!1),P(""),!!ue){if(e.files.some(Se=>Se.path===ue)){M(ue);return}Nt([...e.files,{path:ue,content:""}],ue)}}function _t(){if(!nt)return;const ue=window.prompt("重命名文件",nt.path),Se=ue==null?void 0:ue.trim();!Se||Se===nt.path||e.files.some(Ce=>Ce.path===Se)||Nt(e.files.map(Ce=>Ce.path===nt.path?{...Ce,path:Se}:Ce),Se)}function rt(){var Se;if(!nt)return;const ue=e.files.filter(Ce=>Ce.path!==nt.path);Nt(ue,((Se=ue[0])==null?void 0:Se.path)??null)}function Oe(ue,Se){ve(Ce=>Ce.map(Qe=>Qe.id===ue?{...Qe,...Se}:Qe))}function gt(ue){ve(Se=>Se.filter(Ce=>Ce.id!==ue))}function Ae(){ve(ue=>[...ue,rye()])}function pe(ue){k&&k(ue==="public"?void 0:{..._??{mode:ue},mode:ue})}function Je(ue){k==null||k({..._??{mode:"private"},...ue})}function at(){const ue=new Map(le.map(Ce=>({key:Ce.key.trim(),value:Ce.value})).filter(Ce=>Ce.key.length>0).map(Ce=>[Ce.key,Ce.value])),Se=g?[...y,...ed]:y;for(const Ce of nB(Se,b))ue.set(Ce.key,Ce.value);return[...ue].map(([Ce,Qe])=>({key:Ce,value:Qe}))}async function dn(){if(!(!w||te||ee)){xe(null),Ee(!0);try{await w(!g)}catch(ue){he.current&&xe(`更新飞书配置失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{he.current&&Ee(!1)}}}async function an(){var Se;if(!c||te||F)return;if(Vt!=="public"&&!((Se=_==null?void 0:_.vpcId)!=null&&Se.trim())){xe("使用 VPC 网络时,请填写 VPC ID。");return}const ue=eI(y,b);if(ue){const Ce=y.find(Qe=>Qe.key===ue.key);xe(`请返回配置页填写 ${(Ce==null?void 0:Ce.comment)||(Ce==null?void 0:Ce.key)}(${Ce==null?void 0:Ce.key})。`);return}if(g){const Ce=eI(ed,b);if(Ce){const Qe=ed.find(ot=>ot.key===Ce.key);xe(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}ce(!0)}async function pt(){if(!c||te)return;ce(!1);const ue=at();he.current&&(xe(null),Te(null),Ye({}),bt(null),X(!0));const Se=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Ce=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ot={id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ot),p==null||p(ot);let et,Ct=ot.phase??"prepare";const Yt=Ve=>et?{...et,status:Ve,updatedAt:Date.now()}:void 0,oe=Ve=>{const Ke=Yt(Ve);return Ke?{buildLog:Ke}:{}},be=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),ft=Ve=>{if(Ct!=="build")return;const Ke=["","----- 构建失败 -----",Ve].join(` +${t}`}function G0e(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const r=n.indexOf(` +`);return r>=0&&(n=n.slice(r+1)),{text:n,omitted:!0}}function rI(e,t,n=Y0e){const r=W0e((e==null?void 0:e.text)??"",t.text??""),s=G0e(r,n),i=s.text?s.text.split(` +`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||s.omitted);return{...t,text:s.text,lineCount:i,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}ls.registerLanguage("python",cD);ls.registerLanguage("typescript",wD);ls.registerLanguage("javascript",rD);ls.registerLanguage("json",sD);ls.registerLanguage("yaml",vD);ls.registerLanguage("markdown",lD);ls.registerLanguage("bash",Q3);ls.registerLanguage("ini",Z3);ls.registerLanguage("dockerfile",bJ);ls.registerLanguage("makefile",oD);const q0e=E.lazy(()=>Bc(()=>import("./CodeEditor-CfI7VXuc.js"),[])),Da=()=>{};function X0e({open:e,isUpdate:t,onCancel:n,onConfirm:r}){const s=E.useRef(null);return E.useEffect(()=>{var l;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(l=s.current)==null||l.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?vs.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&n()},children:o.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:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(kV,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(Ar,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:s,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:r,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}const Q0e={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"},sI={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function iI(e){return e.replace(/&/g,"&").replace(//g,">")}function Z0e(e){const n=(e.split("/").pop()??e).toLowerCase();if(sI[n])return sI[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 Q0e[s]??null}function J0e(e,t){try{const n=Z0e(t);return n&&ls.getLanguage(n)?ls.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?ls.highlightAuto(e).value:iI(e)}catch{return iI(e)}}const eye=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],tye=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function nye(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 l=s.children.get(i);l||(l={name:i,children:new Map},s.children.set(i,l)),a===r.length-1&&(l.path=n.path),s=l})}return t}function rye(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 sye(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function iye({left:e,right:t}){const[n,r]=E.useState(null);return E.useLayoutEffect(()=>{const s=document.getElementById("veadk-page-header-left"),i=document.getElementById("veadk-page-header-actions");s&&i&&r({left:s,right:i})},[]),n?o.jsxs(o.Fragment,{children:[vs.createPortal(e,n.left),vs.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function ny({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:r,agentName:s,agentCount:i,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentRuntimeId:h,onDeploymentStarted:p,onDeploymentTaskChange:m,feishuEnabled:g=!1,onFeishuEnabledChange:w,deploymentEnv:y=[],deploymentEnvValues:b={},onDeploymentEnvChange:x,network:_,onNetworkChange:k,deployRegion:N="cn-beijing",onDeployRegionChange:T,onBack:S,backLabel:R="返回配置",onExportYaml:I,deploymentPrimaryPane:j,deployDisabled:F=!1}){var fn,Bt,Kn;const Y=typeof l=="function",L=f.includes("更新"),U=j?tye:eye,[C,M]=E.useState(((Bt=(fn=e==null?void 0:e.files)==null?void 0:fn[0])==null?void 0:Bt.path)??null),[O,D]=E.useState(new Set),[A,H]=E.useState(!1),[W,P]=E.useState(""),[te,X]=E.useState(!1),[ne,ce]=E.useState(!1),[J,fe]=E.useState(!1),[ee,Ee]=E.useState(!1),[ge,xe]=E.useState(null),[we,Ae]=E.useState(null),[Re,Ye]=E.useState({}),[Le,bt]=E.useState(null),[Ze,ze]=E.useState(!1),[le,ve]=E.useState([]),[ct,ht]=E.useState(!1),[G,Z]=E.useState(!1),he=E.useRef(!0),De=ue=>o.jsxs("div",{className:"pp-network-region",onKeyDown:Te=>{Te.key==="Escape"&&Z(!1)},children:[ue&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":G,disabled:te||L||!T,onClick:()=>Z(Te=>!Te),children:[o.jsx("span",{children:N==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(yv,{className:`pp-region-chevron${G?" is-open":""}`})]}),G&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(Te=>{const Ce=Te.value===N;return o.jsxs("button",{type:"button",role:"option","aria-selected":Ce,className:`pp-region-option${Ce?" is-selected":""}`,onClick:()=>{T==null||T(Te.value),Z(!1)},children:[o.jsx("span",{children:Te.label}),Ce&&o.jsx(Gs,{"aria-hidden":"true"})]},Te.value)})})]})]});E.useEffect(()=>(he.current=!0,()=>{he.current=!1}),[]),E.useEffect(()=>{if(!J)return;const ue=document.body.style.overflow;document.body.style.overflow="hidden";const Te=Ce=>{Ce.key==="Escape"&&fe(!1)};return window.addEventListener("keydown",Te),()=>{document.body.style.overflow=ue,window.removeEventListener("keydown",Te)}},[J]);const qe=E.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:nye(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const nt=e.files.find(ue=>ue.path===C)??null,Kt=(_==null?void 0:_.mode)??"public",Et=P0e(g?[...y,...td]:y,b),Pt=Et.length+le.length;function Yt(ue){D(Te=>{const Ce=new Set(Te);return Ce.has(ue)?Ce.delete(ue):Ce.add(ue),Ce})}function Nt(ue,Te){l&&(l({...e,files:ue}),Te!==void 0&&M(Te))}function rn(ue){nt&&Nt(e.files.map(Te=>Te.path===nt.path?{...Te,content:ue}:Te))}function sn(){const ue=W.trim();if(H(!1),P(""),!!ue){if(e.files.some(Te=>Te.path===ue)){M(ue);return}Nt([...e.files,{path:ue,content:""}],ue)}}function _t(){if(!nt)return;const ue=window.prompt("重命名文件",nt.path),Te=ue==null?void 0:ue.trim();!Te||Te===nt.path||e.files.some(Ce=>Ce.path===Te)||Nt(e.files.map(Ce=>Ce.path===nt.path?{...Ce,path:Te}:Ce),Te)}function rt(){var Te;if(!nt)return;const ue=e.files.filter(Ce=>Ce.path!==nt.path);Nt(ue,((Te=ue[0])==null?void 0:Te.path)??null)}function Oe(ue,Te){ve(Ce=>Ce.map(Qe=>Qe.id===ue?{...Qe,...Te}:Qe))}function gt(ue){ve(Te=>Te.filter(Ce=>Ce.id!==ue))}function Se(){ve(ue=>[...ue,sye()])}function pe(ue){k&&k(ue==="public"?void 0:{..._??{mode:ue},mode:ue})}function Je(ue){k==null||k({..._??{mode:"private"},...ue})}function at(){const ue=new Map(le.map(Ce=>({key:Ce.key.trim(),value:Ce.value})).filter(Ce=>Ce.key.length>0).map(Ce=>[Ce.key,Ce.value])),Te=g?[...y,...td]:y;for(const Ce of nB(Te,b))ue.set(Ce.key,Ce.value);return[...ue].map(([Ce,Qe])=>({key:Ce,value:Qe}))}async function dn(){if(!(!w||te||ee)){xe(null),Ee(!0);try{await w(!g)}catch(ue){he.current&&xe(`更新飞书配置失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{he.current&&Ee(!1)}}}async function an(){var Te;if(!c||te||F)return;if(Kt!=="public"&&!((Te=_==null?void 0:_.vpcId)!=null&&Te.trim())){xe("使用 VPC 网络时,请填写 VPC ID。");return}const ue=eI(y,b);if(ue){const Ce=y.find(Qe=>Qe.key===ue.key);xe(`请返回配置页填写 ${(Ce==null?void 0:Ce.comment)||(Ce==null?void 0:Ce.key)}(${Ce==null?void 0:Ce.key})。`);return}if(g){const Ce=eI(td,b);if(Ce){const Qe=td.find(ot=>ot.key===Ce.key);xe(`启用飞书后,请填写${(Qe==null?void 0:Qe.comment)||(Qe==null?void 0:Qe.key)}。`);return}}ce(!0)}async function pt(){if(!c||te)return;ce(!1);const ue=at();he.current&&(xe(null),Ae(null),Ye({}),bt(null),X(!0));const Te=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Ce=(s==null?void 0:s.trim())||e.name||"生成中…";const Qe=Date.now(),ot={id:Te,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:"prepare",label:"准备部署",agentDraft:r};m==null||m(ot),p==null||p(ot);let et,Ct=ot.phase??"prepare";const Wt=Ve=>et?{...et,status:Ve,updatedAt:Date.now()}:void 0,oe=Ve=>{const Ke=Wt(Ve);return Ke?{buildLog:Ke}:{}},be=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),dt=Ve=>{if(Ct!=="build")return;const Ke=["","----- 构建失败 -----",Ve].join(` `);return et=rI(et,{source:"code-pipeline",status:"error",text:Ke,lineCount:Ke.split(` -`).length,truncated:!1,updatedAt:Date.now()}),et};try{const Ve=await c(e,Ke=>{var dt;Ke.runtimeName&&(Ce=Ke.runtimeName),Ct=Ke.phase,Ke.buildLog?et=rI(et,Ke.buildLog):Ke.phase==="build"&&!et&&(et=be()),he.current&&(Ye(Wt=>({...Wt,[Ke.phase]:Ke})),bt(Ke.phase)),m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:Ke.phase,label:((dt=U.find(Wt=>Wt.phase===Ke.phase))==null?void 0:dt.label)??Ke.phase,message:Ke.message,pct:Ke.pct,...et?{buildLog:et}:{}})},g?{taskId:Se,im:{feishu:{enabled:!0}},envs:ue}:{taskId:Se,envs:ue});he.current&&(Te(Ve),bt(null)),m==null||m({id:Se,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...oe("complete")});try{await(d==null?void 0:d(Ve))}catch(Ke){if(!(Ke instanceof qa))throw Ke;m==null||m({id:Se,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:Ke.message,...oe("complete")})}}catch(Ve){const Ke=Ve instanceof Error?Ve.message:String(Ve);if(Ve instanceof DOMException&&Ve.name==="AbortError"){he.current&&(xe(null),bt(null)),m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...oe("complete")});return}he.current&&xe(Ke);const dt=ft(Ke),Wt=!!dt;m==null||m({id:Se,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:Ct,label:"部署失败",message:Wt?"构建镜像失败,详见构建日志。":Ke,...dt?{buildLog:dt}:oe("complete"),retry:an})}finally{he.current&&X(!1)}}function Lt(){ce(!1)}async function on(){if(!(!we||Ze)){ze(!0),xe(null);try{const{addConnection:ue,addRuntimeConnection:Se,remoteAppId:Ce,loadConnections:Qe}=await Pc(async()=>{const{addConnection:Ct,addRuntimeConnection:Yt,remoteAppId:oe,loadConnections:be}=await Promise.resolve().then(()=>NT);return{addConnection:Ct,addRuntimeConnection:Yt,remoteAppId:oe,loadConnections:be}},void 0),{probeRuntimeApps:ot}=await Pc(async()=>{const{probeRuntimeApps:Ct}=await Promise.resolve().then(()=>sK);return{probeRuntimeApps:Ct}},void 0);let et;if(we.runtimeId){const Ct=we.region??N,Yt=await ot(we.runtimeId,Ct)??[];et=Se(we.runtimeId,we.agentName,Ct,Yt,Yt.length>0?{[Yt[0]]:we.agentName}:void 0,we.version)}else et=await ue(we.agentName,we.url,we.apikey,"");if(et.apps.length===0)xe("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const Ct={[et.apps[0]]:we.agentName},Yt={...et,appLabels:{...et.appLabels??{},...Ct}},be=Qe().map(Ve=>Ve.id===et.id?Yt:Ve);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(be));const{registerConnections:ft}=await Pc(async()=>{const{registerConnections:Ve}=await Promise.resolve().then(()=>NT);return{registerConnections:Ve}},void 0);if(ft(be),u){const Ve=Ce(et.id,et.apps[0]);u(Ve,we.agentName)}else alert(`🎉 Agent "${we.agentName}" 已添加到左上角下拉列表!`)}}catch(ue){xe(`添加 Agent 失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ze(!1)}}}function On(){const ue=U0e(e.files),Se=URL.createObjectURL(ue),Ce=document.createElement("a");Ce.href=Se,Ce.download=`${e.name||"project"}.zip`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(Se)}function lr(ue,Se,Ce){return nye(ue).map(Qe=>{const ot=Ce?`${Ce}/${Qe.name}`:Qe.name,et=Qe.path!==void 0,Ct={paddingLeft:8+Se*14};if(et){const oe=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${oe?" pp-active":""}`,style:Ct,onClick:()=>M(Qe.path),title:Qe.path,children:[o.jsx(Qz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ot)}const Yt=O.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:Ct,onClick:()=>Kt(ot),children:[o.jsx($s,{className:`pp-ic pp-chevron${Yt?"":" pp-open"}`}),o.jsx(RM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Yt&&lr(Qe,Se+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${j?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(sye,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(gv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!j&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>fe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(Ac,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx(Gz,{className:"pp-ic"}),"导出配置文件"]}),Y&&l&&o.jsx(V0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:On,children:[o.jsx(f0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),Y&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{H(!0),P("")},children:o.jsx(qz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[A&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:W,onChange:ue=>P(ue.target.value),onBlur:sn,onKeyDown:ue=>{ue.key==="Enter"&&sn(),ue.key==="Escape"&&(H(!1),P(""))}}),e.files.length===0&&!A?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):lr(qe,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:nt==null?void 0:nt.path,children:(nt==null?void 0:nt.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:Y&&nt&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:_t,children:o.jsx(gV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:rt,children:o.jsx(Vi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:nt==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):Y?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(G0e,{value:nt.content,path:nt.path,onChange:rn})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:Z0e(nt.content,nt.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[j,!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),De(!1)]}),!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void dn(),disabled:g||te||ee||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:P0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:ee?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void dn(),disabled:!g||te||ee||!w,children:ee?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:ed.map(ue=>o.jsxs("label",{children:[o.jsxs("span",{children:[ue.comment||ue.key,ue.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:ue.key.includes("SECRET")?"password":"text",value:b[ue.key]??"",placeholder:ue.placeholder,tabIndex:g?0:-1,disabled:!g||te||!x,autoComplete:"off",onChange:Se=>x==null?void 0:x(ue.key,Se.currentTarget.value)})]},ue.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),j&&De(!0),L&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ue=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:ue,checked:Vt===ue,onChange:()=>pe(ue),disabled:te||L||!k}),o.jsx("span",{children:ue==="public"?"公网":ue==="private"?"VPC":"公网 + VPC"})]},ue))}),Vt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:te||L,onChange:ue=>Je({vpcId:ue.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:te||L,onChange:ue=>Je({subnetIds:ue.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:te||L,onChange:ue=>Je({enableSharedInternetAccess:ue.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Pt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:ct?"隐藏值":"显示值",onClick:()=>ht(ue=>!ue),children:ct?o.jsx(Yz,{className:"pp-ic"}):o.jsx(xv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:Ae,disabled:te,children:[o.jsx(kr,{className:"pp-ic"}),"添加变量"]}),(Et.length>0||le.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[Et.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[Et.length," 项"]})]}),Et.map(ue=>{const Se=ue.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:ue.key,readOnly:!0,disabled:te,"aria-label":`${ue.key} 环境变量名`}),o.jsx("input",{type:Se||ct?"text":"password",value:ue.value,placeholder:ue.required?"必填,尚未填写":"可选,尚未填写",readOnly:Se,disabled:te||!Se&&!x,autoComplete:"off","aria-label":`${ue.key} 环境变量值`,onChange:Ce=>x==null?void 0:x(ue.key,Ce.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:Se?"自动":"同步"})]},ue.key)})]}),le.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[le.length," 项"]})]}),le.map(ue=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:ue.key,placeholder:"名称",disabled:te,autoComplete:"off",onChange:Se=>Oe(ue.id,{key:Se.currentTarget.value})}),o.jsx("input",{type:ct?"text":"password",value:ue.value,placeholder:"值",disabled:te,autoComplete:"off",onChange:Se=>Oe(ue.id,{value:Se.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:te,onClick:()=>gt(ue.id),children:o.jsx(Tr,{className:"pp-ic"})})]},ue.id))]})]}),(te||we||Object.keys(Re).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:U.map((ue,Se)=>{const Ce=Le?U.findIndex(Ct=>Ct.phase===Le):-1,Qe=!!ge&&(Ce===-1?Se===0:Se===Ce);let ot;we?ot="done":Qe?ot="failed":Ce===-1?ot=te?"active":"pending":Seue.phase===Le))==null?void 0:Kn.label)??Le}阶段):`:""}${ge}`,onRetry:an,retryLabel:L?"重试更新":"重试部署"}),we&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:L?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[we.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:we.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:we.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:we.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:on,disabled:Ze,children:[Ze?o.jsx($t,{className:"pp-ic spin"}):o.jsx(MM,{className:"pp-ic"}),Ze?"连接中…":"立即对话"]}),we.consoleUrl&&o.jsxs("a",{href:we.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(Ev,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:an,disabled:te||ee||F||!!n,title:n,children:te?`${f}中…`:ge?`重试${f}`:f})})]})]}),J&&r&&vs.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:ue=>{ue.target===ue.currentTarget&&fe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>fe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(Tr,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(q0e,{open:ne,isUpdate:L,onCancel:Lt,onConfirm:()=>void pt()})]})}const aI="dogfooding",Qb="dogfooding",Zb="dogfooding_b";let iye=0;const Jb=()=>++iye;function oI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function aye(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function lI(e){const t=[],n=aye(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 Pv(ik(a))}catch{}return null}function oye({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Jb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[T,S]=E.useState(!1),[R,I]=E.useState({}),j=E.useRef(null),F=E.useRef(null),Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null);E.useEffect(()=>{const X=L.current;X&&X.scrollTo({top:X.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const X=U.current;X&&(X.style.height="auto",X.style.height=Math.min(X.scrollHeight,160)+"px")},[l]);const C=X=>a(ne=>[...ne,{id:Jb(),role:"assistant",text:X}]);async function M(){if(j.current)return j.current;const X=await sg(aI,e);return j.current=X,X}async function O(X,ne){if(ne.current)return ne.current;const ce=await sg(X,e);return ne.current=ce,ce}async function D(X,ne){if(!R[X])try{const ce=await Mv(ne);I(J=>({...J,[X]:ce.model||ne}))}catch{I(ce=>({...ce,[X]:ne}))}}async function A(X,ne,ce){const J=await O(X,ne);let fe=hi();for await(const Ee of If({appName:X,userId:e,sessionId:J,text:ce}))fe=qc(fe,Ee);const ee=oI(fe).trim();return{project:await lI(ee),finalText:ee}}const H=async(X,ne,ce)=>y0(X.name,X.files,{region:"cn-beijing",projectName:"default"},{...ce,onStage:ne}),W=async()=>{const X=l.trim();if(!(!X||u)){if(a(ne=>[...ne,{id:Jb(),role:"user",text:X}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),D("a",Qb),D("b",Zb);const ne=A(Qb,F,X).then(({project:J})=>(b(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>N(!1)),ce=A(Zb,Y,X).then(({project:J})=>(_(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>S(!1));try{const[J,fe]=await Promise.all([ne,ce]),ee=[J?`方案 A:${J.name}`:null,fe?`方案 B:${fe.name}`:null].filter(Boolean);ee.length?C(`已生成两个方案(${ee.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await M();let ce=hi();for await(const ee of If({appName:aI,userId:e,sessionId:ne,text:X}))ce=qc(ce,ee);const J=oI(ce).trim(),fe=await lI(J);fe?(m(fe),C(`已生成项目:${fe.name}(${fe.files.length} 个文件),可在右侧预览和编辑。`)):C(J||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const ce=ne instanceof Error?ne.message:String(ne);h(ce),C(`抱歉,调用智能构建助手失败:${ce}`)}finally{d(!1)}}},P=X=>{const ne=X==="a"?y:x;if(!ne)return;m(ne),w(!1),b(null),_(null),N(!1),S(!1);const ce=X==="a"?"A":"B",J=X==="a"?R.a:R.b;C(`已采用方案 ${ce}(${J??(X==="a"?Qb:Zb)}),可继续编辑。`)},te=X=>{X.key==="Enter"&&!X.shiftKey&&!X.nativeEvent.isComposing&&(X.preventDefault(),W())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:L,children:[o.jsx(di,{initial:!1,children:i.map(X=>o.jsxs(nn.div,{className:`ic-turn ic-turn--${X.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[X.role==="assistant"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:X.role==="assistant"?o.jsx(yh,{text:X.text}):X.text})]},X.id))}),u&&o.jsxs(nn.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(u0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:X=>c(X.target.value),onKeyDown:te,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void W(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(xV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:X=>w(X.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(cI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>P("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(cI,{side:"b",project:x,loading:T,model:R.b,onAdopt:()=>P("b")})]}):p?o.jsx(ny,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(Jz,{className:"ic-preview-empty-glyph"}),o.jsx(ul,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function cI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx($t,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(ny,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const lye=/^[A-Za-z_][A-Za-z0-9_]*$/;function Bc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":lye.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function sB(e){const t=new Set,n=new Set,r=s=>{Bc(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function cye({className:e,...t}){return o.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:[o.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"}),o.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 dd={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:cye},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:eV},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:vV},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:kv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:h0}},uye=[dd.llm,dd.sequential,dd.parallel,dd.loop,dd.a2a],iB=e=>e==="sequential"||e==="parallel"||e==="loop",ry=e=>e==="a2a";function Ws(e){return e.trimEnd().replace(/[。.]+$/,"")}function Pg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function Oo(e,t){return e[t]|e[t+1]<<8}function zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function dye(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 aB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(zl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=Oo(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=zl(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=Oo(e,w+26),x=Oo(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await dye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const fye="/skillhub/v1/skills";async function hye(e,t="public"){const n=e.trim(),r=`${fye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:bi(void 0,wu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function pye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await hye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(Cf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(Cf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const jx=/(^|\/)skill\.md$/i;function mye(e){const t=(e??"").replace(/\r\n?/g,` +`).length,truncated:!1,updatedAt:Date.now()}),et};try{const Ve=await c(e,Ke=>{var ft;Ke.runtimeName&&(Ce=Ke.runtimeName),Ct=Ke.phase,Ke.buildLog?et=rI(et,Ke.buildLog):Ke.phase==="build"&&!et&&(et=be()),he.current&&(Ye(Gt=>({...Gt,[Ke.phase]:Ke})),bt(Ke.phase)),m==null||m({id:Te,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"running",phase:Ke.phase,label:((ft=U.find(Gt=>Gt.phase===Ke.phase))==null?void 0:ft.label)??Ke.phase,message:Ke.message,pct:Ke.pct,...et?{buildLog:et}:{}})},g?{taskId:Te,im:{feishu:{enabled:!0}},envs:ue}:{taskId:Te,envs:ue});he.current&&(Ae(Ve),bt(null)),m==null||m({id:Te,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成",...oe("complete")});try{await(d==null?void 0:d(Ve))}catch(Ke){if(!(Ke instanceof qa))throw Ke;m==null||m({id:Te,runtimeName:Ve.agentName||Ce,runtimeId:Ve.runtimeId||h,region:Ve.region||N,startedAt:Qe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:Ke.message,...oe("complete")})}}catch(Ve){const Ke=Ve instanceof Error?Ve.message:String(Ve);if(Ve instanceof DOMException&&Ve.name==="AbortError"){he.current&&(xe(null),bt(null)),m==null||m({id:Te,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...oe("complete")});return}he.current&&xe(Ke);const ft=dt(Ke),Gt=!!ft;m==null||m({id:Te,runtimeName:Ce,runtimeId:h,region:N,startedAt:Qe,status:"error",phase:Ct,label:"部署失败",message:Gt?"构建镜像失败,详见构建日志。":Ke,...ft?{buildLog:ft}:oe("complete"),retry:an})}finally{he.current&&X(!1)}}function Lt(){ce(!1)}async function on(){if(!(!we||Ze)){ze(!0),xe(null);try{const{addConnection:ue,addRuntimeConnection:Te,remoteAppId:Ce,loadConnections:Qe}=await Bc(async()=>{const{addConnection:Ct,addRuntimeConnection:Wt,remoteAppId:oe,loadConnections:be}=await Promise.resolve().then(()=>NT);return{addConnection:Ct,addRuntimeConnection:Wt,remoteAppId:oe,loadConnections:be}},void 0),{probeRuntimeApps:ot}=await Bc(async()=>{const{probeRuntimeApps:Ct}=await Promise.resolve().then(()=>iK);return{probeRuntimeApps:Ct}},void 0);let et;if(we.runtimeId){const Ct=we.region??N,Wt=await ot(we.runtimeId,Ct)??[];et=Te(we.runtimeId,we.agentName,Ct,Wt,Wt.length>0?{[Wt[0]]:we.agentName}:void 0,we.version)}else et=await ue(we.agentName,we.url,we.apikey,"");if(et.apps.length===0)xe("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const Ct={[et.apps[0]]:we.agentName},Wt={...et,appLabels:{...et.appLabels??{},...Ct}},be=Qe().map(Ve=>Ve.id===et.id?Wt:Ve);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(be));const{registerConnections:dt}=await Bc(async()=>{const{registerConnections:Ve}=await Promise.resolve().then(()=>NT);return{registerConnections:Ve}},void 0);if(dt(be),u){const Ve=Ce(et.id,et.apps[0]);u(Ve,we.agentName)}else alert(`🎉 Agent "${we.agentName}" 已添加到左上角下拉列表!`)}}catch(ue){xe(`添加 Agent 失败:${ue instanceof Error?ue.message:String(ue)}`)}finally{ze(!1)}}}function On(){const ue=$0e(e.files),Te=URL.createObjectURL(ue),Ce=document.createElement("a");Ce.href=Te,Ce.download=`${e.name||"project"}.zip`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(Te)}function lr(ue,Te,Ce){return rye(ue).map(Qe=>{const ot=Ce?`${Ce}/${Qe.name}`:Qe.name,et=Qe.path!==void 0,Ct={paddingLeft:8+Te*14};if(et){const oe=Qe.path===C;return o.jsxs("button",{type:"button",className:`pp-row pp-file${oe?" pp-active":""}`,style:Ct,onClick:()=>M(Qe.path),title:Qe.path,children:[o.jsx(Zz,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]},ot)}const Wt=O.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:Ct,onClick:()=>Yt(ot),children:[o.jsx($s,{className:`pp-ic pp-chevron${Wt?"":" pp-open"}`}),o.jsx(RM,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Qe.name})]}),!Wt&&lr(Qe,Te+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${j?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(iye,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[S&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:S,children:[o.jsx(gv,{className:"pp-ic"}),R]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",s||e.name||"未命名 Agent",i&&i>1?` 等 ${i} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!j&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:"pp-release-preview",children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[r&&o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>fe(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(Cc,{"aria-hidden":!0})})]}),o.jsxs("div",{className:"pp-release-info",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:s||e.name||"未命名 Agent"}),(r==null?void 0:r.description)&&o.jsx("p",{className:"pp-release-description",title:r.description,children:r.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:i??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),o.jsxs("div",{className:"pp-artifact-actions",children:[I&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:I,children:[o.jsx(qz,{className:"pp-ic"}),"导出配置文件"]}),Y&&l&&o.jsx(K0e,{project:e,onChange:l,className:"pp-artifact-source"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:On,children:[o.jsx(f0,{className:"pp-ic"}),"导出源码"]})]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),Y&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{H(!0),P("")},children:o.jsx(Xz,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[A&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:W,onChange:ue=>P(ue.target.value),onBlur:sn,onKeyDown:ue=>{ue.key==="Enter"&&sn(),ue.key==="Escape"&&(H(!1),P(""))}}),e.files.length===0&&!A?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):lr(qe,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:nt==null?void 0:nt.path,children:(nt==null?void 0:nt.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:Y&&nt&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:_t,children:o.jsx(yV,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:rt,children:o.jsx(Vi,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:nt==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):Y?o.jsx("div",{className:"pp-codemirror",children:o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(q0e,{value:nt.content,path:nt.path,onChange:rn})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:J0e(nt.content,nt.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[j,!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),De(!1)]}),!j&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${g?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":g,"aria-hidden":g,tabIndex:g?-1:0,onClick:()=>void dn(),disabled:g||te||ee||!w,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:B0e,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:ee?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!g,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:g?0:-1,onClick:()=>void dn(),disabled:!g||te||ee||!w,children:ee?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:td.map(ue=>o.jsxs("label",{children:[o.jsxs("span",{children:[ue.comment||ue.key,ue.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:ue.key.includes("SECRET")?"password":"text",value:b[ue.key]??"",placeholder:ue.placeholder,tabIndex:g?0:-1,disabled:!g||te||!x,autoComplete:"off",onChange:Te=>x==null?void 0:x(ue.key,Te.currentTarget.value)})]},ue.key))})]})]})})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),j&&De(!0),L&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(ue=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:ue,checked:Kt===ue,onChange:()=>pe(ue),disabled:te||L||!k}),o.jsx("span",{children:ue==="public"?"公网":ue==="private"?"VPC":"公网 + VPC"})]},ue))}),Kt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(_==null?void 0:_.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:te||L,onChange:ue=>Je({vpcId:ue.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(_==null?void 0:_.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:te||L,onChange:ue=>Je({subnetIds:ue.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(_!=null&&_.enableSharedInternetAccess),disabled:te||L,onChange:ue=>Je({enableSharedInternetAccess:ue.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsxs("div",{className:"pp-env-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Pt," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),o.jsx("button",{type:"button",className:"pp-icon-btn",title:ct?"隐藏值":"显示值",onClick:()=>ht(ue=>!ue),children:ct?o.jsx(Wz,{className:"pp-ic"}):o.jsx(xv,{className:"pp-ic"})})]}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:Se,disabled:te,children:[o.jsx(Nr,{className:"pp-ic"}),"添加变量"]}),(Et.length>0||le.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[Et.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[Et.length," 项"]})]}),Et.map(ue=>{const Te=ue.key.startsWith("ENABLE_");return o.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[o.jsx("input",{className:"pp-env-key-fixed",value:ue.key,readOnly:!0,disabled:te,"aria-label":`${ue.key} 环境变量名`}),o.jsx("input",{type:Te||ct?"text":"password",value:ue.value,placeholder:ue.required?"必填,尚未填写":"可选,尚未填写",readOnly:Te,disabled:te||!Te&&!x,autoComplete:"off","aria-label":`${ue.key} 环境变量值`,onChange:Ce=>x==null?void 0:x(ue.key,Ce.currentTarget.value)}),o.jsx("span",{className:"pp-env-source",children:Te?"自动":"同步"})]},ue.key)})]}),le.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[le.length," 项"]})]}),le.map(ue=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:ue.key,placeholder:"名称",disabled:te,autoComplete:"off",onChange:Te=>Oe(ue.id,{key:Te.currentTarget.value})}),o.jsx("input",{type:ct?"text":"password",value:ue.value,placeholder:"值",disabled:te,autoComplete:"off",onChange:Te=>Oe(ue.id,{value:Te.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:te,onClick:()=>gt(ue.id),children:o.jsx(Ar,{className:"pp-ic"})})]},ue.id))]})]}),(te||we||Object.keys(Re).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:U.map((ue,Te)=>{const Ce=Le?U.findIndex(Ct=>Ct.phase===Le):-1,Qe=!!ge&&(Ce===-1?Te===0:Te===Ce);let ot;we?ot="done":Qe?ot="failed":Ce===-1?ot=te?"active":"pending":Teue.phase===Le))==null?void 0:Kn.label)??Le}阶段):`:""}${ge}`,onRetry:an,retryLabel:L?"重试更新":"重试部署"}),we&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:L?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[we.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:we.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:we.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:we.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:on,disabled:Ze,children:[Ze?o.jsx($t,{className:"pp-ic spin"}):o.jsx(MM,{className:"pp-ic"}),Ze?"连接中…":"立即对话"]}),we.consoleUrl&&o.jsxs("a",{href:we.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(Ev,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:"pp-config-actions",children:o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:an,disabled:te||ee||F||!!n,title:n,children:te?`${f}中…`:ge?`重试${f}`:f})})]})]}),J&&r&&vs.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:ue=>{ue.target===ue.currentTarget&&fe(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>fe(!1),"aria-label":"关闭执行流程预览",children:o.jsx(Ar,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Rg,{draft:r,direction:"horizontal",selectedPath:[],onSelect:Da,onAdd:Da,onInsert:Da,onDelete:Da,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(X0e,{open:ne,isUpdate:L,onCancel:Lt,onConfirm:()=>void pt()})]})}const aI="dogfooding",Qb="dogfooding",Zb="dogfooding_b";let aye=0;const Jb=()=>++aye;function oI(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function oye(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function lI(e){const t=[],n=oye(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 Pv(ik(a))}catch{}return null}function lye({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:s}){const[i,a]=E.useState([{id:Jb(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,h]=E.useState(null),[p,m]=E.useState(null),[g,w]=E.useState(!1),[y,b]=E.useState(null),[x,_]=E.useState(null),[k,N]=E.useState(!1),[T,S]=E.useState(!1),[R,I]=E.useState({}),j=E.useRef(null),F=E.useRef(null),Y=E.useRef(null),L=E.useRef(null),U=E.useRef(null);E.useEffect(()=>{const X=L.current;X&&X.scrollTo({top:X.scrollHeight,behavior:"smooth"})},[i,u]),E.useEffect(()=>{const X=U.current;X&&(X.style.height="auto",X.style.height=Math.min(X.scrollHeight,160)+"px")},[l]);const C=X=>a(ne=>[...ne,{id:Jb(),role:"assistant",text:X}]);async function M(){if(j.current)return j.current;const X=await sg(aI,e);return j.current=X,X}async function O(X,ne){if(ne.current)return ne.current;const ce=await sg(X,e);return ne.current=ce,ce}async function D(X,ne){if(!R[X])try{const ce=await Mv(ne);I(J=>({...J,[X]:ce.model||ne}))}catch{I(ce=>({...ce,[X]:ne}))}}async function A(X,ne,ce){const J=await O(X,ne);let fe=hi();for await(const Ee of If({appName:X,userId:e,sessionId:J,text:ce}))fe=Xc(fe,Ee);const ee=oI(fe).trim();return{project:await lI(ee),finalText:ee}}const H=async(X,ne,ce)=>y0(X.name,X.files,{region:"cn-beijing",projectName:"default"},{...ce,onStage:ne}),W=async()=>{const X=l.trim();if(!(!X||u)){if(a(ne=>[...ne,{id:Jb(),role:"user",text:X}]),c(""),h(null),d(!0),g){b(null),_(null),N(!0),S(!0),D("a",Qb),D("b",Zb);const ne=A(Qb,F,X).then(({project:J})=>(b(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>N(!1)),ce=A(Zb,Y,X).then(({project:J})=>(_(J),J)).catch(J=>{const fe=J instanceof Error?J.message:String(J);return h(fe),null}).finally(()=>S(!1));try{const[J,fe]=await Promise.all([ne,ce]),ee=[J?`方案 A:${J.name}`:null,fe?`方案 B:${fe.name}`:null].filter(Boolean);ee.length?C(`已生成两个方案(${ee.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await M();let ce=hi();for await(const ee of If({appName:aI,userId:e,sessionId:ne,text:X}))ce=Xc(ce,ee);const J=oI(ce).trim(),fe=await lI(J);fe?(m(fe),C(`已生成项目:${fe.name}(${fe.files.length} 个文件),可在右侧预览和编辑。`)):C(J||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const ce=ne instanceof Error?ne.message:String(ne);h(ce),C(`抱歉,调用智能构建助手失败:${ce}`)}finally{d(!1)}}},P=X=>{const ne=X==="a"?y:x;if(!ne)return;m(ne),w(!1),b(null),_(null),N(!1),S(!1);const ce=X==="a"?"A":"B",J=X==="a"?R.a:R.b;C(`已采用方案 ${ce}(${J??(X==="a"?Qb:Zb)}),可继续编辑。`)},te=X=>{X.key==="Enter"&&!X.shiftKey&&!X.nativeEvent.isComposing&&(X.preventDefault(),W())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:L,children:[o.jsx(di,{initial:!1,children:i.map(X=>o.jsxs(nn.div,{className:`ic-turn ic-turn--${X.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[X.role==="assistant"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:X.role==="assistant"?o.jsx(yh,{text:X.text}):X.text})]},X.id))}),u&&o.jsxs(nn.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(cl,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),f&&o.jsxs("div",{className:"ic-error",children:[o.jsx(u0,{className:"ic-error-icon"}),f]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:U,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:l,onChange:X=>c(X.target.value),onKeyDown:te,disabled:u}),o.jsx("button",{className:"ic-send",onClick:()=>void W(),disabled:!l.trim()||u,title:"发送 (Enter)",children:o.jsx(wV,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:g,disabled:u,onChange:X=>w(X.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:g?o.jsxs("div",{className:"ic-compare",children:[o.jsx(cI,{side:"a",project:y,loading:k,model:R.a,onAdopt:()=>P("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(cI,{side:"b",project:x,loading:T,model:R.b,onAdopt:()=>P("b")})]}):p?o.jsx(ny,{project:p,onChange:m,onDeploy:H,onAgentAdded:r,onDeploymentTaskChange:s}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(eV,{className:"ic-preview-empty-glyph"}),o.jsx(ul,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function cI({side:e,project:t,loading:n,model:r,onAdopt:s}){const i=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:i}),r&&o.jsx("span",{className:"ic-pane-model",children:r})]}),o.jsxs("button",{className:"ic-adopt",onClick:s,disabled:!t||n,title:`采用${i}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx($t,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(ny,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const cye=/^[A-Za-z_][A-Za-z0-9_]*$/;function Fc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":cye.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function sB(e){const t=new Set,n=new Set,r=s=>{Fc(s.name)===null&&(t.has(s.name)?n.add(s.name):t.add(s.name)),s.subAgents.forEach(r)};return r(e),n}function uye({className:e,...t}){return o.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:[o.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"}),o.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 Xl={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:uye},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:tV},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:_V},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:kv},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:h0}},dye=[Xl.llm,Xl.sequential,Xl.parallel,Xl.loop,Xl.a2a];function iB(e){return Xl[e??"llm"]}const aB=e=>e==="sequential"||e==="parallel"||e==="loop",ry=e=>e==="a2a";function Ws(e){return e.trimEnd().replace(/[。.]+$/,"")}function Pg(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(r=>r==null?void 0:r.toLocaleLowerCase().includes(n)):!0}function Oo(e,t){return e[t]|e[t+1]<<8}function zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function fye(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 oB(e,t={}){let r=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(zl(e,u)===101010256){r=u;break}if(r<0)throw new Error("无效的 zip:找不到 EOCD");const s=Oo(e,r+10);if(t.maxEntries!==void 0&&s>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let i=zl(e,r+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const b=Oo(e,w+26),x=Oo(e,w+28),_=w+30+b+x,k=e.subarray(_,_+f);let N;if(d===0)N=k;else if(d===8)N=await fye(k);else{i+=46+p+m+g;continue}l.push({name:y,text:a.decode(N)}),i+=46+p+m+g}return l}const hye="/skillhub/v1/skills";async function pye(e,t="public"){const n=e.trim(),r=`${hye}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,s=await fetch(r,{headers:{accept:"application/json"},signal:bi(void 0,vu)});if(!s.ok)throw new Error(`搜索失败 (${s.status})`);return((await s.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function mye({selected:e,onChange:t}){const[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(null),[d,f]=E.useState(!1),h=g=>e.some(w=>w.source==="skillhub"&&w.slug===g),p=g=>{g.slug&&(h(g.slug)?t(e.filter(w=>!(w.source==="skillhub"&&w.slug===g.slug))):t([...e,{source:"skillhub",slug:g.slug,name:g.name,folder:g.slug.split("/").pop()||g.name,namespace:g.namespace||"public",description:g.description}]))},m=async g=>{l(!0),u(null),f(!0);try{const w=await pye(g);i(w)}catch(w){u(w instanceof Error?w.message:"搜索失败,请稍后重试。"),i([])}finally{l(!1)}};return E.useEffect(()=>{const g=n.trim();if(!g){i([]),f(!1),u(null);return}const w=setTimeout(()=>m(g),300);return()=>clearTimeout(w)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(Cf,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(Cf,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&s.length===0?o.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):s.length>0?o.jsx("div",{className:"cw-skill-results",children:s.map(g=>{const w=h(g.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>p(g),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(Nr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:g.name}),g.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(g.description)}),g.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:g.sourceRepo})]})]},g.id||g.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const jx=/(^|\/)skill\.md$/i;function gye(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 yye(...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 bye(e,t){return t.trim()||e}function oB(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 Eye(e){const t=new Map,n=new Set;for(const r of e)if(jx.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=jx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function xye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>jx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=mye(s.text),a=yye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:bye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function wye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await aB(t)).map(s=>({path:s.name,text:s.text}));return lB(oB(r),e.name)}async function vye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function kye(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 cB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await _ye(e),path:n}];if(!e.isDirectory)return[];const r=await kye(e);return(await Promise.all(r.map(s=>cB(s,n)))).flat()}function Nye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const T=[...x.errors];if(k.length>0&&T.push(`已跳过重复技能:${k.join("、")}`),r(T),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>cB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await wye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(k.map(({file:S,path:R})=>[S,R]));g(await vye(k.map(({file:S})=>S),T))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(vv,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function Sye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Ij();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Rj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=eY(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${Ws(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:tY(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(Ev,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(kr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Hz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function Tye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Aye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Tye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Cye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,wu)});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 Iye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Cye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const uI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function e1(e){let t=0;for(let n=0;n>>0;return uI[t%uI.length]}function Rye(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)),l=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:l,total:c-l||1}}function Oye(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 dI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const Lye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function fI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:Lye(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function uB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=bj(t,n);else if(e)_=tj(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,T)=>N.start_time<=T.start_time?N:T).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>Rye(i??[]),[i]),w=E.useMemo(()=>Oye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(Tr,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx($t,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,T=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx($s,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:e1(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:dI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${T}%`,background:e1(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:e1(y.name)}}),dI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:fI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),fI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const Mye=E.lazy(()=>Pc(()=>import("./MarkdownPromptEditor-CV6FT_vP.js"),__vite__mapDeps([0,1]))),Dx="veadk.generatedAgentTestRuns";function ak(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Dx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function dB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Dx,JSON.stringify(t)):window.sessionStorage.removeItem(Dx)}catch{}}function jye(e){dB([...ak(),e])}function fd(e){dB(ak().filter(t=>t!==e))}function Dye(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 hI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:wV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:yo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Vz},{id:"tools",label:"工具",hint:"可调用的能力",icon:PM},{id:"skills",label:"技能",hint:"声明式技能",icon:ul},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:im},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:AM},{id:"review",label:"完成",hint:"预览并创建",icon:bV}];function Pye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function fB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function hB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Bye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},pI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},mI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},pB="REGISTRY_SPACE_ID",Fye=Oj.filter(e=>e.key!==pB);function mB(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())||Ei.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||Ei.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||Ei.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function gI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(Gs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:Ws(s.desc)})]})]},s.id)})})}function t1({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Ws(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:Ws(r.desc)})]},r.id)})})}function Uye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function Vl({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:Uye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function n1(e){return e.name.trim()||"未命名智能体中心"}function r1(e){return e.name.trim()||e.id||"未命名知识库"}function $ye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||Ei.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),Aye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?n1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>Pg(g,[n1(R),R.id,R.projectName])),[g,i]),T=!!(e&&!b&&Pg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=j=>{const F=j.target;F instanceof Node&&y.current&&!y.current.contains(F)&&m(!1)},I=j=>{j.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(fB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=n1(R),j=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":j,className:`cw-a2a-space-option ${j?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!T&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(hB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function Hye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),Iye().then(T=>{N||r(T)}).catch(T=>{N||(r([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?r1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>Pg(h,[r1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&Pg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},T=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(fB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const T=r1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${T} (${N.id})`,onClick:()=>k(N.id),children:T},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(hB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function zye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(di,{initial:!1,children:e.map((i,a)=>o.jsxs(nn.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(Vi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(kr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function gB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Vye({s:e,onRemove:t}){let n=ul,r="火山 Find Skill 技能广场";return e.source==="local"?(n=vv,r="本地"):e.source==="skillspace"&&(n=gB,r="AgentKit Skills 中心"),o.jsxs(nn.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Ws(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(Tr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const s1=[{id:"local",label:"本地文件",icon:vv},{id:"skillspace",label:"AgentKit Skills 中心",icon:gB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:h0}];function Kye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=s1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>i1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(kr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(di,{initial:!1,children:e.map(c=>o.jsx(Vye,{s:c,onRemove:()=>l(i1(c))},i1(c)))})})]}),o.jsx(di,{children:s&&o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(Tr,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${s1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),s1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(pye,{selected:e,onChange:t}),n==="local"&&o.jsx(Nye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(Sye,{selected:e,onChange:t})]})]})]})})})]})}function i1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function hd({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:Ws(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(nn.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Yye(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 Up(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rh(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rh(i[r],s,n),{...e,subAgents:i}}function Wye(e,t){return Rh(e,t,n=>({...n,subAgents:[...n.subAgents,Wr()]}))}function Gye(e,t,n){return Rh(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Wr()),{...r,subAgents:s}})}function qye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rh(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const Px=e=>!ry(e.agentType),yI=3;function Xye(e,t,n=!1){var s;if(ry(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=Bc(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":iB(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function yB(e,t,n=[]){const r=[],s=ry(e.agentType),i=Xye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",problem:i}),Px(e)&&e.subAgents.forEach((a,l)=>r.push(...yB(a,t,[...n,l]))),r}function bB(e){return 1+e.subAgents.reduce((t,n)=>t+bB(n),0)}function EB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=dl.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Oj}),Object.assign(n,mB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=FE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=UE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=$E.find(d=>d.id===(i.knowledgebaseBackend??Zc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=HE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=tB(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function xB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Qye(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 wB(e){var r,s;const t=EB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...xB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(nB(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function Zye(e){return JSON.stringify(wB(e))}function Bg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function wc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function Jye({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===Bg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),T=wc(b),S=!!(_&&k&&N&&n.findIndex(O=>wc(O)===T)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==Bg(r,b)),j=b.phase==="starting",F=b.phase==="ready"&&!I,Y=j||b.phase==="sending",L=F&&b.phase!=="sending"&&b.messages.some(O=>O.role==="assistant"),U=Y||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",M=j?"正在启动":I?"应用配置并重启":F||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||Y,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||Y,onClick:()=>d(b.id),children:o.jsx(Vi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Dg,{message:b.error,className:"cw-debug-error-detail"}):j?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:F?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((O,D)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${O.role}`,children:o.jsx("div",{className:"cw-debug-content",children:O.role==="user"?O.content:O.error?o.jsx(Dg,{message:O.error,className:"cw-debug-msg-error"}):O.blocks&&O.blocks.length>0?o.jsx(H_,{blocks:O.blocks,onAction:()=>{}}):O.content?O.content:D===b.messages.length-1&&b.phase==="sending"?o.jsx(t5,{}):null})},D))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:U,title:C||void 0,onClick:()=>l(b.id),children:[F||I||b.phase==="error"?o.jsx(DM,{className:"cw-i"}):o.jsx(Pye,{className:"cw-i cw-debug-run-icon"}),M]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:Y||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:O=>p(b.id,"modelName",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:O=>p(b.id,"description",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:O=>p(b.id,"instruction",O.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:vB.map(O=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(O.id),disabled:!0}),o.jsx("span",{children:O.label})]},O.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(kr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{n5(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(SM,{className:"cw-i"})})]})})]})}const bI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],vB=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function ebe({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=bI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:bI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function tbe({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var Ta,Ol,So,ei,xt,z,se,ye,Ue,It,Qt,Sn,Mn,Ft,qt;const[h,p]=E.useState(()=>r??Wr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),T=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var q;S!==T.current&&(T.current=S,(q=I.current)==null||q.call(I,h,R))},[h,R,S]);const[j,F]=E.useState("build"),[Y,L]=E.useState(!1),[U,C]=E.useState(!1),[M,O]=E.useState(0),[D,A]=E.useState(null),[H,W]=E.useState(!1),[P,te]=E.useState((a==null?void 0:a.region)??l),X=(s==null?void 0:s.generatedAgentTestRun)===!0,ne=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[ce,J]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Wr()).modelName??"",description:(r??Wr()).description,instruction:(r??Wr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[fe,ee]=E.useState("baseline"),Ee=E.useRef(1),ge=E.useRef(new Map),[xe,we]=E.useState(0),[Te,Re]=E.useState(""),[Ye,Le]=E.useState(null),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(!1),ve=E.useRef(null),[ct,ht]=E.useState("basic"),[G,Z]=E.useState(""),[he,De]=E.useState(!1),[qe,nt]=E.useState(!1),[Vt,Et]=E.useState(!1),[Pt,Kt]=E.useState(!1),[Nt,rn]=E.useState([]),sn=E.useRef(null),_t=E.useRef({});async function rt(){const q=new Set([...ge.current.values()].map(({run:Fe})=>Fe.runId)),ae=ak().filter(Fe=>!q.has(Fe));ae.length&&await Promise.all(ae.map(async Fe=>{try{await Yl(Fe),fd(Fe)}catch(We){console.warn("清理遗留调试运行失败",We)}}))}E.useEffect(()=>(rt(),()=>{for(const{run:q}of ge.current.values())Yl(q.runId).then(()=>fd(q.runId)).catch(ae=>console.warn("清理调试运行失败",ae));ge.current.clear()}),[]),E.useEffect(()=>()=>{var q;(q=ve.current)==null||q.call(ve,!1),ve.current=null},[]);const Oe=E.useRef(null);Oe.current||(Oe.current=({meta:q,children:ae})=>o.jsxs("section",{ref:Fe=>{_t.current[q.id]=Fe},id:`cw-sec-${q.id}`,"data-step-id":q.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[q.label,q.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ae]}));const gt=Yye(h,Nt)?Nt:[],Ae=Up(h,gt),pe=gt.length===0,Je=`cw-model-advanced-${gt.join("-")||"root"}`,at=`cw-a2a-registry-advanced-${gt.join("-")||"root"}`,dn=`cw-more-tool-types-${gt.join("-")||"root"}`,an=`cw-advanced-config-${gt.join("-")||"root"}`,pt=q=>p(ae=>Rh(ae,gt,Fe=>({...Fe,...q}))),Lt=(q,ae)=>p(Fe=>{var We;return{...Fe,deployment:{...Fe.deployment??{feishuEnabled:!1},envValues:{...((We=Fe.deployment)==null?void 0:We.envValues)??{},[q]:ae}}}}),on=q=>pt({a2aRegistry:{...Ae.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...q}}),On=(q,ae)=>{if(!(q in mI))return;const Fe=mI[q];on({[Fe]:ae}),Lt(q,ae)},lr=q=>{if(!(pe&&q==="a2a")){if(q==="a2a"){pt({agentType:q,a2aRegistry:{...Ae.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}pt({agentType:q,a2aRegistry:Ae.a2aRegistry?{...Ae.a2aRegistry,enabled:!1}:void 0})}},fn=(q,ae)=>{p(q),ae&&rn(ae)},Bt=async()=>{const q=m.trim();if(!(!q||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),Z("");try{const ae=await mj(q);p(ik(ae.draft)),rn([]),A(null),C(!1),Z(""),x(!0)}catch(ae){k(ae instanceof Error?ae.message:"生成 Agent 配置失败")}finally{y(!1)}}},Kn=q=>{const ae=Up(h,q);if(!Px(ae)||q.length>=yI)return;const Fe=Wye(h,q),We=Up(Fe,q).subAgents.length-1;fn(Fe,[...q,We])},ue=(q,ae)=>{const Fe=Up(h,q);if(!Px(Fe)||q.length>=yI)return;const We=Math.max(0,Math.min(ae,Fe.subAgents.length)),pn=Gye(h,q,We);fn(pn,[...q,We])},Se=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Wr()),rn([]),C(!1),Kt(!1))},Ce=q=>{if(q.length===0){Se();return}fn(qye(h,q),q.slice(0,-1))},Qe=Ae.builtinTools??[],ot=Ae.mcpTools??[],et=Ae.tracingExporters??[],Ct=Ae.selectedSkills??[],Yt=[Ae.memory.shortTerm,Ae.memory.longTerm,Ae.tracing].filter(Boolean).length,oe=q=>pt({builtinTools:Qe.includes(q)?Qe.filter(ae=>ae!==q):[...Qe,q]}),be=q=>{const ae=et.includes(q)?et.filter(Fe=>Fe!==q):[...et,q];pt({tracingExporters:ae,tracing:ae.length>0?!0:Ae.tracing})},ft=iB(Ae.agentType),Ve=ry(Ae.agentType),Ke=E.useMemo(()=>sB(h),[h]),dt=Ve?null:Bc(Ae.name)??(Ke.has(Ae.name)?"Agent 名称在当前结构中必须唯一":null),Wt=dt!==null,cr=!Ve&&Ae.description.trim().length===0,Yn=Ae.instruction.trim().length===0,hn=Ve&&!((Ta=Ae.a2aRegistry)!=null&&Ta.registrySpaceId.trim()),Ln=q=>U&&q?`is-error cw-error-shake-${M%2}`:"",Gt=E.useMemo(()=>yB(h,Ke),[h,Ke]),Jt=Gt.length===0,Ot=E.useMemo(()=>Zye(h),[h]),kn=ce.find(q=>q.id===fe)??ce[0],Nn=E.useMemo(()=>EB(h),[h]),en=E.useMemo(()=>{var q,ae,Fe,We;return{type:!0,basic:Ve?!hn:!Wt&&(ft||!Yn),model:!!((q=Ae.modelName)!=null&&q.trim()||(ae=Ae.modelProvider)!=null&&ae.trim()||(Fe=Ae.modelApiBase)!=null&&Fe.trim()),tools:Qe.length>0||ot.length>0,skills:Ct.length>0,knowledge:Ae.knowledgebase,advanced:Ae.memory.shortTerm||Ae.memory.longTerm||Ae.tracing,subagents:(((We=Ae.subAgents)==null?void 0:We.length)??0)>0,review:Jt}},[Ae,Wt,Yn,ft,Ve,Jt,Qe,ot,Ct]),Wn=ft||Ve?["type","basic"]:["type","basic","model","tools","skills","knowledge",...pe?["advanced"]:[]],pr=hI.filter(q=>Wn.includes(q.id)),nr=Wn.join("|"),Si=gt.join("."),Xs=pr.findIndex(q=>q.id===ct),Zr=q=>{var ae;(ae=_t.current[q])==null||ae.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(D)return;const q=sn.current;if(!q)return;const ae=nr.split("|");let Fe=0;const We=()=>{Fe=0;const ln=ae[ae.length-1];let jn=ae[0];if(q.scrollTop+q.clientHeight>=q.scrollHeight-2)jn=ln;else{const $n=q.getBoundingClientRect().top+24;for(const jt of ae){const Xt=_t.current[jt];if(!Xt||Xt.getBoundingClientRect().top>$n)break;jn=jt}}jn&&ht($n=>$n===jn?$n:jn)},pn=()=>{Fe||(Fe=window.requestAnimationFrame(We))};return We(),q.addEventListener("scroll",pn,{passive:!0}),window.addEventListener("resize",pn),()=>{q.removeEventListener("scroll",pn),window.removeEventListener("resize",pn),Fe&&window.cancelAnimationFrame(Fe)}},[D,nr,Si]);const Ar=()=>Jt?!0:(C(!0),O(q=>q+1),Gt[0]&&(rn(Gt[0].path),window.requestAnimationFrame(()=>Zr("basic"))),!1),Ts=async()=>{Le(null);const q=[...ge.current.values()];ge.current.clear(),we(0),J(ae=>ae.map(Fe=>({...Fe,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(q.map(async({run:ae})=>{try{await Yl(ae.runId),fd(ae.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}))},Qs=async q=>{const ae=ge.current.get(q);if(ae){ge.current.delete(q),we(ge.current.size);try{await Yl(ae.run.runId),fd(ae.run.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}},ka=q=>{const ae=ge.current.get(q),Fe=ce.find(We=>We.id===q);!ae||!Fe||Le({runId:ae.run.runId,sessionId:ae.sessionId,variantName:Fe.name})},Ur=q=>{const ae=ve.current;ve.current=null,ae==null||ae(q)},wo=()=>{ze||(Ze(!1),Ur(!1))},Na=async()=>{if(!ze){le(!0);try{await Ts(),Ze(!1),Ur(!0)}finally{le(!1)}}},Zs=async()=>j!=="validate"||xe===0?!0:ve.current?!1:new Promise(q=>{ve.current=q,Ze(!0)}),Cl=async q=>{if(await Zs()){if(Z(""),!Ar()){F("build");return}W(!0);try{const ae=q?ce.find(pn=>pn.id===q):kn;ae&&ee(ae.id);const Fe=ae?{...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction}:h,We=await Pv(xB(Fe));Fe!==h&&p(Fe),A(We),F("publish")}catch(ae){Z(ae instanceof Error?ae.message:String(ae))}finally{W(!1)}}},Js=async q=>{if(!X||H||!Ar())return;const ae=ce.find(Ut=>Ut.id===q);if(!ae||ae.phase==="starting"||ae.phase==="sending")return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=wc(ae),jn=ce.findIndex(Ut=>Ut.id===q),$n=ce.findIndex(Ut=>wc(Ut)===ln);if(!Fe||!We||!pn||$n!==jn)return;const jt=Bg(Ot,ae);J(Ut=>Ut.map(ur=>ur.id===q?{...ur,configOpen:!1,phase:"starting",messages:[],error:null}:ur)),Re("");let Xt=null;try{await Qs(q),await rt();const Ut={...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction};Xt=await gj(wB(Ut)),jye(Xt.runId);const ur=await yj(Xt.runId,"test_user");ge.current.set(q,{run:Xt,sessionId:ur}),we(ge.current.size),J(mn=>mn.map(qi=>qi.id===q?{...qi,phase:"ready",runtimeSnapshot:jt}:qi))}catch(Ut){if(Xt)try{await Yl(Xt.runId),fd(Xt.runId)}catch(ur){console.warn("清理调试运行失败",ur)}J(ur=>ur.map(mn=>mn.id===q?{...mn,phase:"error",runtimeSnapshot:"",error:Ut instanceof Error?Ut.message:String(Ut)}:mn))}},Il=async()=>{const q=Te.trim(),ae=ce.filter(We=>We.phase==="ready"&&We.runtimeSnapshot===Bg(Ot,We)&&ge.current.has(We.id));if(!q||ae.length===0)return;Re("");const Fe=new Set(ae.map(We=>We.id));J(We=>We.map(pn=>Fe.has(pn.id)?{...pn,phase:"sending",messages:[...pn.messages,{role:"user",content:q},{role:"assistant",content:"",blocks:[]}]}:pn)),await Promise.all(ae.map(async We=>{const pn=ge.current.get(We.id);if(pn)try{let ln=hi();for await(const jn of Ej({runId:pn.run.runId,userId:"test_user",sessionId:pn.sessionId,text:q})){const $n=jn.error||jn.errorMessage||jn.error_message;if(J(jt=>jt.map(Xt=>{if(Xt.id!==We.id)return Xt;const Ut=[...Xt.messages],ur={...Ut[Ut.length-1]};return $n?ur.error=String($n):(ln=qc(ln,jn),ur.content=ln.blocks.filter(mn=>mn.kind==="text").map(mn=>mn.text).join(""),ur.blocks=ln.blocks),Ut[Ut.length-1]=ur,{...Xt,messages:Ut}})),$n)break}}catch(ln){J(jn=>jn.map($n=>{if($n.id!==We.id)return $n;const jt=[...$n.messages],Xt={...jt[jt.length-1]};return Xt.error=ln instanceof Error?ln.message:String(ln),jt[jt.length-1]=Xt,{...$n,messages:jt}}))}finally{J(ln=>ln.map(jn=>jn.id===We.id?{...jn,phase:"ready"}:jn))}}))},vo=()=>{J(q=>{if(q.length>=3)return q;const ae=Ee.current++,Fe=`variant-${ae}`;return[...q,{id:Fe,name:`对照组 ${ae}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},_o=async q=>{await Qs(q),J(ae=>ae.filter(Fe=>Fe.id!==q)),fe===q&&ee("baseline")},Sa=(q,ae)=>J(Fe=>Fe.map(We=>We.id===q?{...We,...ae}:We)),mr=(q,ae,Fe)=>{Sa(q,{[ae]:Fe}),!(fe!==q||q==="baseline")&&ee("baseline")},ko=q=>{const ae=ce.find(jt=>jt.id===q);if(!ae)return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=wc(ae),jn=ce.findIndex(jt=>jt.id===q),$n=ce.findIndex(jt=>wc(jt)===ln);if(!(!Fe||!We||!pn||$n!==jn)){if(q==="baseline"){Sa(q,{configOpen:!1});return}Js(q)}},No=async(q,ae,Fe)=>{var ln;const We=(ln=h.deployment)==null?void 0:ln.network,pn=We&&We.mode&&We.mode!=="public"?{mode:We.mode,vpc_id:We.vpcId,subnet_ids:We.subnetIds,enable_shared_internet_access:We.enableSharedInternetAccess}:void 0;return y0(q.name,q.files,{region:(a==null?void 0:a.region)??P,projectName:"default",network:pn},{...Fe,onStage:ae,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},Rl=()=>{Ar()&&(J(q=>q.map(ae=>ae.id==="baseline"&&!ge.current.has(ae.id)?{...ae,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:ae)),F("validate"))},ju=async q=>{if(q==="publish"){D?F("publish"):Cl();return}if(q==="validate"){Rl();return}await Zs()&&F(q)},As=Oe.current,Cs=q=>hI.find(ae=>ae.id===q);return o.jsxs("div",{className:"cw-root",children:[o.jsx(ebe,{mode:j,agentName:Qye(h),busy:H,onChange:ju,onDiscard:f?()=>{R?L(!0):f()}:void 0}),G&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:G}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[j==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(di,{initial:!1,mode:"wait",children:b?o.jsxs(nn.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(nn.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:q=>{q.preventDefault(),Bt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:q=>g(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),Bt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Rg,{draft:h,direction:"vertical",selectedPath:gt,onSelect:rn,onAdd:Kn,onInsert:ue,onDelete:Ce}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:sn,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsx(As,{meta:Cs("type"),children:o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:uye.map(q=>{const ae=(Ae.agentType??"llm")===q.id,Fe=pe&&q.id==="a2a",We=Fe?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":q.id,className:`cw-agent-type-option ${ae?"is-on":""} ${Fe?"is-disabled":""}`,title:Fe?void 0:pI[q.id],tabIndex:Fe?0:void 0,"aria-describedby":We,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:ae,disabled:Fe,onChange:()=>lr(q.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Bye[q.id]}),o.jsx("small",{children:pI[q.id]})]}),Fe&&o.jsx("span",{id:We,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},q.id)})})}),o.jsx(As,{meta:Cs("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Ve&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Ln(Wt)}`,value:Ae.name,placeholder:"customer_service",onChange:q=>pt({name:q.target.value})}),U&&dt?o.jsx("span",{className:"cw-error-text",children:dt}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Ln(cr)}`,value:Ae.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:q=>pt({description:q.target.value})}),U&&cr?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:pe?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),ft?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Ae.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:Ae.maxIterations??3,onChange:q=>pt({maxIterations:Math.max(1,Number(q.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Ve?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx($ye,{value:((Ol=Ae.a2aRegistry)==null?void 0:Ol.registrySpaceId)??"",region:((So=Ae.a2aRegistry)==null?void 0:So.registryRegion)||Ei.region,invalid:U&&hn,onChange:q=>On(pB,q)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":qe,"aria-controls":at,onClick:()=>nt(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${qe?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:qe&&o.jsx(nn.div,{id:at,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:o.jsx(Vl,{env:Fye,values:mB(Ae.a2aRegistry,{includeDefaults:!1}),onChange:On})})}),U&&hn&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(Mye,{value:Ae.instruction,invalid:Yn,onChange:q=>pt({instruction:q})})}),U&&Yn?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!ft&&!Ve&&o.jsxs(o.Fragment,{children:[o.jsx(As,{meta:Cs("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:Ae.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:q=>pt({modelName:q.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":Je,onClick:()=>De(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:he&&o.jsxs(nn.div,{id:Je,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:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:Ae.modelProvider??"",placeholder:"openai",onChange:q=>pt({modelProvider:q.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:Ae.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:q=>pt({modelApiBase:q.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(As,{meta:Cs("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(gI,{items:dl,selected:Qe,onToggle:oe,scrollRows:6})}),o.jsx(di,{initial:!1,children:Qe.includes("run_code")&&o.jsxs(nn.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(Vl,{env:((ei=dl.find(q=>q.id==="run_code"))==null?void 0:ei.env)??[],values:((xt=h.deployment)==null?void 0:xt.envValues)??{},onChange:Lt})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Vt,"aria-controls":dn,onClick:()=>Et(q=>!q),children:[o.jsx("span",{children:"更多类型工具"}),ot.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",ot.length]}),o.jsx($s,{className:`cw-more-options-chevron ${Vt?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:Vt&&o.jsx(nn.div,{id:dn,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(zye,{tools:ot,onChange:q=>pt({mcpTools:q})})]})})})]})}),o.jsx(As,{meta:Cs("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(Kye,{selected:Ct,onChange:q=>pt({selectedSkills:q})})})}),o.jsx(As,{meta:Cs("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.knowledgebase,onChange:q=>pt({knowledgebase:q}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:im}),Ae.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(t1,{options:$E,value:Ae.knowledgebaseBackend,onChange:q=>pt({knowledgebaseBackend:q,knowledgebaseIndex:q==="viking"?Ae.knowledgebaseIndex:""})}),(Ae.knowledgebaseBackend??Zc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(Hye,{value:Ae.knowledgebaseIndex??"",onChange:q=>pt({knowledgebaseIndex:q})})]}),o.jsx(Vl,{env:((z=$E.find(q=>q.id===(Ae.knowledgebaseBackend??Zc)))==null?void 0:z.env)??[],values:((se=h.deployment)==null?void 0:se.envValues)??{},onChange:Lt})]})]})}),pe&&o.jsxs("section",{ref:q=>{_t.current.advanced=q},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Pt,"aria-controls":an,onClick:()=>Kt(q=>!q),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx($s,{className:`cw-advanced-disclosure-chevron ${Pt?"is-open":""}`,"aria-hidden":!0}),Yt>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Yt]})]}),o.jsx(di,{initial:!1,children:Pt&&o.jsxs(nn.div,{id:an,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.memory.shortTerm,onChange:q=>pt({memory:{...Ae.memory,shortTerm:q}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OM}),Ae.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(t1,{options:FE,value:Ae.shortTermBackend,onChange:q=>pt({shortTermBackend:q})}),o.jsx(Vl,{env:((ye=FE.find(q=>q.id===(Ae.shortTermBackend??"local")))==null?void 0:ye.env)??[],values:((Ue=h.deployment)==null?void 0:Ue.envValues)??{},onChange:Lt})]}),o.jsx(hd,{checked:Ae.memory.longTerm,onChange:q=>pt({memory:{...Ae.memory,longTerm:q}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:im}),Ae.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(t1,{options:UE,value:Ae.longTermBackend,onChange:q=>pt({longTermBackend:q})}),o.jsx(Vl,{env:((It=UE.find(q=>q.id===(Ae.longTermBackend??"local")))==null?void 0:It.env)??[],values:((Qt=h.deployment)==null?void 0:Qt.envValues)??{},onChange:Lt}),o.jsx(hd,{checked:!!Ae.autoSaveSession,onChange:q=>pt({autoSaveSession:q}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:im})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Ae.tracing,onChange:q=>pt({tracing:q}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:xv}),Ae.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(gI,{items:HE,selected:et,onToggle:be}),o.jsx(Vl,{env:HE.filter(q=>et.includes(q.id)).flatMap(q=>q.env),values:((Sn=h.deployment)==null?void 0:Sn.envValues)??{},onChange:Lt})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(nn.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Xs,0)/Math.max(pr.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),pr.map(q=>{const ae=q.id===ct,Fe=en[q.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${ae?"is-active":""} ${Fe?"is-done":""}`,onClick:()=>Zr(q.id),"aria-current":ae?"step":void 0,"aria-label":q.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ae?o.jsx("span",{className:"cw-dot"}):Fe?o.jsx(Gs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:q.label})]})},q.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Rl,children:o.jsx("span",{children:"开始调试"})})]})]})]}),j==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(Jye,{enabled:X,disabledReason:ne,variants:ce,draftSnapshot:Ot,input:Te,onInput:Re,onSend:Il,onStartVariant:Js,onDeployVariant:q=>void Cl(q),onAddVariant:vo,onRemoveVariant:_o,onToggleConfig:q=>{const ae=ce.find(Fe=>Fe.id===q);ae&&Sa(q,{configOpen:!ae.configOpen})},onCompleteConfig:ko,onConfigChange:mr,onOpenTrace:ka})})}),j==="publish"&&o.jsx("div",{className:"cw-preview-body",children:D?o.jsx(ny,{embedded:!0,project:D,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:bB(h),releaseConfiguration:kn?{modelName:kn.modelName||h.modelName||"默认模型",description:kn.description,instruction:kn.instruction,optimizations:kn.optimizations.flatMap(q=>{const ae=vB.find(Fe=>Fe.id===q);return ae?[ae.label]:[]})}:void 0,onChange:A,onDeploy:No,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((Mn=h.deployment)!=null&&Mn.feishuEnabled),onFeishuEnabledChange:q=>{const ae={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:q}};p(ae)},deploymentEnv:Nn.specs,deploymentEnvValues:{...(Ft=h.deployment)==null?void 0:Ft.envValues,...Nn.fixedValues},onDeploymentEnvChange:Lt,network:(qt=h.deployment)==null?void 0:qt.network,onNetworkChange:q=>p(ae=>({...ae,deployment:{...ae.deployment??{feishuEnabled:!1},network:q}})),deployRegion:P,onDeployRegionChange:te,onExportYaml:()=>Dye(`${h.name||"agent"}.yaml`,I0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),Ye&&o.jsx(uB,{testRunId:Ye.runId,sessionId:Ye.sessionId,title:`调用链路 · ${Ye.variantName}`,onClose:()=>Le(null)}),bt&&o.jsx(U6,{variant:"warning",title:"离开调试?",description:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",confirmLabel:ze?"清理中...":"确定离开",closeLabel:"关闭离开调试确认",busy:ze,onCancel:wo,onConfirm:()=>void Na()}),Y&&o.jsx("div",{className:"confirm-scrim",onClick:()=>L(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>L(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{L(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function ea(e){return{...Wr(),...e}}const nbe=[{id:"support",icon:rV,draft:ea({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Uz,draft:ea({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:sV,draft:ea({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:bv,draft:ea({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:dV,draft:ea({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:NV,draft:ea({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[ea({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),ea({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),ea({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function rbe(e){const t=[];return e.tools.length&&t.push({icon:PM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:Fz,label:"记忆"}),e.knowledgebase&&t.push({icon:Bz,label:"知识库"}),e.tracing&&t.push({icon:Dz,label:"观测"}),e.subAgents.length&&t.push({icon:jM,label:`子Agent ${e.subAgents.length}`}),t}function sbe({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(abe,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(ibe,{onPick:r})})}function ibe({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:nbe.map((t,n)=>o.jsxs(nn.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:Ws(t.draft.description)})]},t.id))})]})}function abe({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=rbe(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(gv,{className:"icon"})," 返回模板列表"]}),o.jsxs(nn.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:Ws(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:obe(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:Ws(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx($s,{className:"icon"})]})]})]})}function obe(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const lbe=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:LM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:NM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:kv}];let Bx=0;function a1(){return Bx+=1,`node_${Bx}`}function o1(e,t,n){const r=Wr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function cbe({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Dr,{type:"target",position:He.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(cl,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Dr,{type:"source",position:He.Right,className:"wfb-handle"})]})}const ube={agentNode:cbe},EI={type:"smoothstep",markerEnd:{type:ou.ArrowClosed,width:16,height:16}};function dbe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Bx=0;const C=a1();return o1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=a6([u]),[p,m,g]=o6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>sB({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Bc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Bc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=d.length>0&&k===null&&d.every(C=>Bc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(M=>M4({...C,...EI},M)),[m]),R=E.useCallback(()=>{const C=a1(),M=d.length*28,O=o1(C,{x:80+M,y:120+M});f(D=>D.concat(O)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},j=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),D=a1(),A=o1(D,O);f(H=>H.concat(A)),y(D)},[f]),Y=E.useCallback(C=>{w&&f(M=>M.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),L=E.useCallback(()=>{w&&(f(C=>C.filter(M=>M.id!==w)),m(C=>C.filter(M=>M.source!==w&&M.target!==w)),y(null))},[w,f,m]),U=E.useCallback(()=>{if(!T)return;const C=d.map(O=>O.data.agent),M={...Wr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(M)},[T,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:lbe.map(({type:C,label:M,desc:O,Icon:D})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(D,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:M}),o.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(nV,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(cl,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(kr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:U,disabled:!T,type:"button",children:[o.jsx(ul,{className:"icon"}),"创建工作流"]}),o.jsxs(i6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:ube,defaultEdgeOptions:EI,onDrop:F,onDragOver:j,onNodeClick:(C,M)=>y(M.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(d6,{showInteractive:!1}),o.jsx(dfe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:L,title:"删除节点",children:o.jsx(Vi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(M=>M.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(cl,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function fbe(e){return o.jsx(O_,{children:o.jsx(dbe,{...e})})}const xI=50*1024*1024,Fx=800,hbe={name:"code_package",files:[]};function pbe(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 mbe(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 gbe(e){const t=e.flatMap(a=>{const l=mbe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Fx)throw new Error(`代码包文件数不能超过 ${Fx} 个。`);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 ybe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,T]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(F){const Y=++l.current;if(x(""),!F.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(F.size>xI){x("代码包不能超过 50 MB。");return}g(!0);try{const L=await aB(new Uint8Array(await F.arrayBuffer()),{maxEntries:Fx,maxUncompressedBytes:xI}),U=gbe(L);if(Y!==l.current)return;f(F.name),u({name:pbe(F.name),files:U})}catch(L){if(Y!==l.current)return;f(""),u(null),x(L instanceof Error?L.message:String(L))}finally{Y===l.current&&g(!1)}}function R(F){var L;const Y=(L=F.currentTarget.files)==null?void 0:L[0];F.currentTarget.value="",Y&&S(Y)}function I(F){var L;F.preventDefault(),y(!1);const Y=(L=F.dataTransfer.files)==null?void 0:L[0];Y&&S(Y)}async function j(F,Y,L){const U=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return y0(F.name,F.files,{region:_,projectName:"default",network:U},{...L,onStage:Y})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(ny,{project:c??hbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:j,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:T,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:F=>{F.preventDefault(),y(!0)},onDragOver:F=>F.preventDefault(),onDragLeave:F=>{F.currentTarget.contains(F.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var F;m||(F=a.current)==null||F.click()},onKeyDown:F=>{var Y;!m&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),(Y=a.current)==null||Y.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:F=>{F.stopPropagation(),p(!0)},onKeyDown:F=>F.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(rB,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const bbe=3*60*1e3,Ebe=3e3,xbe=10*60*1e3,Fg="veadk.studio.pending-update",wI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],wbe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function vbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function _be(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function kbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Fg);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(Fg),null}function l1(e,t){window.localStorage.setItem(Fg,JSON.stringify({targetVersion:e,startedAt:t}))}function $p(){window.localStorage.removeItem(Fg)}function vI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function Nbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function Sbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function _I({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function Tbe(){var Y,L;const[e]=E.useState(kbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const U=M=>{var O;M.target instanceof Node&&!((O=y.current)!=null&&O.contains(M.target))&&h(!1)},C=M=>{M.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",U),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",U),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const U=await dj(b.current||void 0,x.current||void 0);return n(U),U},[]);if(E.useEffect(()=>{let U=!0;const C=()=>{_().catch(()=>{U&&n(O=>O)})};C();const M=window.setInterval(C,bbe);return()=>{U=!1,window.clearInterval(M)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const U=window.setInterval(()=>{_().then(C=>{const M=b.current;if(M&&_be(C.currentVersion,M)||!M&&!C.available&&C.latestVersion){window.clearInterval(U),$p(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval(U),$p(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>xbe&&(window.clearInterval(U),$p(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},Ebe);return()=>window.clearInterval(U)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),l1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const U=()=>{const M=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-M)/1e3)))};U();const C=window.setInterval(U,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],T=u||((Y=N[0])==null?void 0:Y.version)||t.latestVersion,S=N.find(U=>U.version===T),R=async()=>{b.current=T,x.current=Date.now(),l1(T,x.current),s("submitting"),c(""),m("idle");try{const U=await fj(T);b.current=U.version,l1(U.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(U){if(U instanceof TypeError){c("连接已切换,正在确认新版本状态");return}$p(),s("error");const C=U instanceof Error?U.message:"Studio 更新失败";try{const M=await _();c(M.message||C)}catch{c(C)}}},I=(L=t.updateLogs)!=null&&L.length?t.updateLogs:(t.errorLog||t.progressMessage||l).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 bye(...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 Eye(e,t){return t.trim()||e}function lB(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 xye(e){const t=new Map,n=new Set;for(const r of e)if(jx.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=jx.test("/"+r.path);if(!i&&!a&&!n.has("")||!n.has(i)&&!a)continue;const l=i?r.path.slice(i.length+1):r.path,c=t.get(i)||[];c.push({path:l,text:r.text}),t.set(i,c)}return t}function wye(e,t,n){const r=`${n}${e?"/"+e:""}`,s=t.find(c=>jx.test("/"+c.path));if(!s)return{hit:null,error:`${r} 缺少 SKILL.md`};const i=gye(s.text),a=bye(i.name,e,n.replace(/\.[^.]+$/,"")),l=[];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}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:Eye(a,i.name),description:i.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function vye(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await oB(t)).map(s=>({path:s.name,text:s.text}));return cB(lB(r),e.name)}async function _ye(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function Nye(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 uB(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await kye(e),path:n}];if(!e.isDirectory)return[];const r=await Nye(e);return(await Promise.all(r.map(s=>uB(s,n)))).flat()}function Sye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(!1),[c,u]=E.useState(!1),d=E.useRef(0),f=x=>e.some(_=>_.source==="local"&&_.folder===x),h=x=>{x.localFiles&&(f(x.folder||x.name)?t(e.filter(_=>!(_.source==="local"&&_.folder===(x.folder||x.name)))):t([...e,{source:"local",folder:x.folder||x.name,name:x.name,description:x.description,localFiles:x.localFiles}]))},p=E.useRef([]),m=E.useRef(e);E.useEffect(()=>{p.current=s},[s]),E.useEffect(()=>{m.current=e},[e]);const g=x=>{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 x.hits){const R=S.folder||S.name;if(_.has(R)){k.push(S.name);continue}_.add(R),N.push(S)}i(S=>[...S,...N]);const T=[...x.errors];if(k.length>0&&T.push(`已跳过重复技能:${k.join("、")}`),r(T),N.length===1&&x.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}])}},w=x=>{x.preventDefault(),d.current+=1,u(!0)},y=x=>{x.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},b=async x=>{if(x.preventDefault(),d.current=0,u(!1),a)return;const _=Array.from(x.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}l(!0);try{const k=(await Promise.all(_.map(S=>uB(S)))).flat(),N=_.some(S=>S.isDirectory);if(!N&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){g(await vye(k[0].file));return}if(!N){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(k.map(({file:S,path:R})=>[S,R]));g(await _ye(k.map(({file:S})=>S),T))}catch(k){r([`读取失败:${k instanceof Error?k.message:String(k)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:w,onDragOver:x=>x.preventDefault(),onDragLeave:y,onDrop:x=>void b(x),children:[o.jsx(vv,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(x=>{var k;const _=f(x.folder||x.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${_?"is-on":""}`,onClick:()=>h(x),"aria-pressed":_,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:_?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(Nr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:x.name}),x.description&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(x.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((k=x.localFiles)==null?void 0:k.length)??0," 个文件"]})]})]},x.id)})})]})}function Tye({selected:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState([]),[a,l]=E.useState(""),[c,u]=E.useState(!0),[d,f]=E.useState(!1),[h,p]=E.useState(null);E.useEffect(()=>{let y=!1;return(async()=>{u(!0),p(null);try{const b=await Ij();y||(r(b),b.length>0&&l(b[0].id))}catch(b){y||p(b instanceof Error?b.message:"加载失败")}finally{y||u(!1)}})(),()=>{y=!0}},[]),E.useEffect(()=>{if(!a){i([]);return}const y=n.find(x=>x.id===a);let b=!1;return(async()=>{f(!0),p(null);try{const x=await Rj(a,y==null?void 0:y.region);b||i(x)}catch(x){b||p(x instanceof Error?x.message:"加载失败")}finally{b||f(!1)}})(),()=>{b=!0}},[a,n]);const m=n.find(y=>y.id===a),g=(y,b)=>e.some(x=>x.source==="skillspace"&&x.skillId===y&&(x.version||"")===b),w=y=>{if(m)if(g(y.skillId,y.version))t(e.filter(b=>!(b.source==="skillspace"&&b.skillId===y.skillId&&(b.version||"")===y.version)));else{const b=tY(m,y);t([...e,{source:"skillspace",folder:b.folder||y.skillName,name:b.name,description:b.description,skillSpaceId:b.skillSpaceId,skillSpaceName:b.skillSpaceName,skillSpaceRegion:b.skillSpaceRegion,skillId:b.skillId,version:b.version}])}};return o.jsx("div",{className:"cw-skillspace",children:c?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?o.jsxs("div",{className:"cw-banner",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:h})]}):n.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:y=>l(y.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(y=>o.jsxs("option",{value:y.id,children:[y.name||y.id,y.region?` [${y.region}]`:"",y.description?` — ${Ws(y.description)}`:""]},y.id))}),m&&o.jsx("a",{href:nY(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:o.jsx(Ev,{className:"cw-i cw-i-sm"})})]}),d?o.jsxs("p",{className:"cw-empty-line",children:[o.jsx($t,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:s.map(y=>{const b=g(y.skillId,y.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${b?"is-on":""}`,onClick:()=>w(y),"aria-pressed":b,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:b?o.jsx(Gs,{className:"cw-i cw-i-sm"}):o.jsx(Nr,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[y.skillName,y.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",y.version]})]}),y.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:Ws(y.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(zz,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${y.skillId}/${y.version}`)})})]})})}async function Aye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,vu)});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 Cye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",page_size:String(e.pageSize??100),project:e.project||"default"});return(await Aye(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function Iye(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:bi(void 0,vu)});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 Rye(e={}){const t=new URLSearchParams({region:e.region||"cn-beijing",project:e.project||"default"});return(await Iye(`/web/viking-knowledgebases?${t.toString()}`)).items||[]}const uI=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function e1(e){let t=0;for(let n=0;n>>0;return uI[t%uI.length]}function Oye(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)),l=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:l,total:c-l||1}}function Lye(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 dI(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const Mye=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function fI(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:Mye(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function dB({appName:e,testRunId:t,sessionId:n,onClose:r,title:s="调用链路观测"}){const[i,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(new Set),[f,h]=E.useState(null);E.useEffect(()=>{a(null),c("");let _;if(t)_=bj(t,n);else if(e)_=tj(e,n);else{c("缺少调用链路来源");return}_.then(k=>{a(k),h(k.length?k.reduce((N,T)=>N.start_time<=T.start_time?N:T).span_id:null)}).catch(k=>c(String(k)))},[e,n,t]);const{rootNodes:p,min:m,total:g}=E.useMemo(()=>Oye(i??[]),[i]),w=E.useMemo(()=>Lye(p,u),[p,u]),y=(i==null?void 0:i.find(_=>_.span_id===f))??null,b=g/1e6,x=_=>d(k=>{const N=new Set(k);return N.has(_)?N.delete(_):N.add(_),N});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:r}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:s}),o.jsx("div",{className:"drawer-sub",children:i?`${i.length} 个调用 · ${b.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:r,"aria-label":"关闭",children:o.jsx(Ar,{className:"icon"})})]}),i==null&&!l&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx($t,{className:"icon spin"})," 加载调用链路…"]}),l&&o.jsx("div",{className:"error",children:l}),i&&i.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),w.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:w.map(_=>{const k=_.span,N=(k.start_time-m)/g*100,T=Math.max((k.end_time-k.start_time)/g*100,.6),S=_.children.length>0;return o.jsxs("button",{className:`trace-row ${f===k.span_id?"active":""}`,onClick:()=>h(k.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:_.depth*14},children:[o.jsx("span",{className:`trace-caret ${S?"":"hidden"} ${u.has(k.span_id)?"":"open"}`,onClick:R=>{R.stopPropagation(),S&&x(k.span_id)},children:o.jsx($s,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:e1(k.name)}}),o.jsx("span",{className:"trace-name",title:k.name,children:k.name})]}),o.jsx("span",{className:"trace-dur",children:dI(k.end_time-k.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${N}%`,width:`${T}%`,background:e1(k.name)}})})]},k.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:y?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:y.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:e1(y.name)}}),dI(y.end_time-y.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:fI(y).filter(_=>!_.long).map(_=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:_.key}),o.jsx("span",{className:"td-val",children:_.value})]},_.key))}),fI(y).filter(_=>_.long).map(_=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:_.key}),o.jsx("pre",{className:"td-pre",children:_.value})]},_.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const jye=E.lazy(()=>Bc(()=>import("./MarkdownPromptEditor-4R032isI.js"),__vite__mapDeps([0,1]))),Dx="veadk.generatedAgentTestRuns";function ak(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(Dx)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function fB(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(Dx,JSON.stringify(t)):window.sessionStorage.removeItem(Dx)}catch{}}function Dye(e){fB([...ak(),e])}function fd(e){fB(ak().filter(t=>t!==e))}function Pye(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 hI=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:vV,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:yo,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Kz},{id:"tools",label:"工具",hint:"可调用的能力",icon:PM},{id:"skills",label:"技能",hint:"声明式技能",icon:ul},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:im},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OM},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:AM},{id:"review",label:"完成",hint:"预览并创建",icon:EV}];function Bye({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.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"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function hB({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function pB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const Fye={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},pI={llm:"理解任务并完成一个具体工作",sequential:"内部步骤按照顺序依次执行",parallel:"内部步骤同时工作,完成后统一汇总",loop:"重复执行内部步骤,直到满足停止条件",a2a:"调用已经存在的远程 Agent"},mI={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},mB="REGISTRY_SPACE_ID",Uye=Oj.filter(e=>e.key!==mB);function gB(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())||Ei.topK,n.REGISTRY_REGION=((s=e.registryRegion)==null?void 0:s.trim())||Ei.region,n.REGISTRY_ENDPOINT=((i=e.registryEndpoint)==null?void 0:i.trim())||Ei.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function gI({items:e,selected:t,onToggle:n,scrollRows:r}){return o.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 o.jsxs("button",{type:"button",className:`cw-check ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:[o.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:i&&o.jsx(Gs,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-check-text",children:[o.jsx("span",{className:"cw-check-title",children:s.label}),o.jsx("span",{className:"cw-check-desc",children:Ws(s.desc)})]})]},s.id)})})}function t1({options:e,value:t,onChange:n}){return o.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 o.jsxs("button",{type:"button",className:`cw-seg ${s?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":s,title:Ws(r.desc),children:[o.jsx("span",{className:"cw-seg-title",children:r.label}),o.jsx("span",{className:"cw-seg-desc",children:Ws(r.desc)})]},r.id)})})}function $ye(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function Vl({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(r=>o.jsxs("label",{className:"cw-env-field",children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&o.jsx("code",{title:r.key,children:r.key})]}),o.jsx("input",{className:"cw-input",type:$ye(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:s=>n(r.key,s.currentTarget.value)})]},r.key))})}function n1(e){return e.name.trim()||"未命名智能体中心"}function r1(e){return e.name.trim()||e.id||"未命名知识库"}function Hye({value:e,region:t,invalid:n,onChange:r}){const s=t.trim()||Ei.region,[i,a]=E.useState([]),[l,c]=E.useState(!1),[u,d]=E.useState(null),[f,h]=E.useState(0),[p,m]=E.useState(!1),[g,w]=E.useState(""),y=E.useRef(null);E.useEffect(()=>{let R=!1;return c(!0),d(null),Cye({region:s}).then(I=>{R||a(I)}).catch(I=>{R||(a([]),d(I instanceof Error?I.message:"加载失败"))}).finally(()=>{R||c(!1)}),()=>{R=!0}},[s,f]);const b=!e||i.some(R=>R.id===e.trim()),x=i.find(R=>R.id===e.trim()),_=x?n1(x):e&&!b?"已选择的智能体中心":"请选择智能体中心",k=l&&i.length===0,N=E.useMemo(()=>i.filter(R=>Pg(g,[n1(R),R.id,R.projectName])),[g,i]),T=!!(e&&!b&&Pg(g,["已选择的智能体中心",e]));E.useEffect(()=>{if(!p)return;const R=j=>{const F=j.target;F instanceof Node&&y.current&&!y.current.contains(F)&&m(!1)},I=j=>{j.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",R),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",R),window.removeEventListener("keydown",I)}},[p]);const S=R=>{r(R),m(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker",ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:k,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{w(""),m(R=>!R)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:_}),o.jsx(hB,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:g,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:R=>w(R.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S(e),children:"已选择的智能体中心"}),N.map(R=>{const I=n1(R),j=R.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":j,className:`cw-a2a-space-option ${j?"is-selected":""}`,title:`${I} (${R.id})`,onClick:()=>S(R.id),children:I},R.id)}),!T&&N.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(R=>R+1),children:l?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(pB,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):i.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",i.length," 个智能体中心,列表仅展示中心名称。"]})]})}function zye({value:e,onChange:t}){const[n,r]=E.useState([]),[s,i]=E.useState(!1),[a,l]=E.useState(null),[c,u]=E.useState(0),[d,f]=E.useState(!1),[h,p]=E.useState(""),m=E.useRef(null);E.useEffect(()=>{let N=!1;return i(!0),l(null),Rye().then(T=>{N||r(T)}).catch(T=>{N||(r([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{N||i(!1)}),()=>{N=!0}},[c]);const g=!e||n.some(N=>N.id===e.trim()),w=n.find(N=>N.id===e.trim()),y=w?r1(w):e&&!g?e:"请选择 VikingDB 知识库",b=s&&n.length===0,x=E.useMemo(()=>n.filter(N=>Pg(h,[r1(N),N.id,N.description,N.projectName])),[n,h]),_=!!(e&&!g&&Pg(h,[e]));E.useEffect(()=>{if(!d)return;const N=S=>{const R=S.target;R instanceof Node&&m.current&&!m.current.contains(R)&&f(!1)},T=S=>{S.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",N),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",T)}},[d]);const k=N=>{t(N),f(!1)};return o.jsxs("div",{className:"cw-a2a-space-picker cw-viking-kb-picker",ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:b,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(N=>!N)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(hB,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.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)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[_&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:e}),x.map(N=>{const T=r1(N),S=N.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":S,className:`cw-a2a-space-option ${S?"is-selected":""}`,title:`${T} (${N.id})`,onClick:()=>k(N.id),children:T},N.id)}),!_&&x.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.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?o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(pB,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(yo,{className:"cw-i"}),o.jsx("span",{children:a})]}):s?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx($t,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 VikingDB 知识库…"]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function Vye({tools:e,onChange:t}){const n=(i,a)=>t(e.map((l,c)=>c===i?{...l,...a}:l)),r=i=>t(e.filter((a,l)=>l!==i)),s=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(di,{initial:!1,children:e.map((i,a)=>o.jsxs(nn.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:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.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:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.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:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:o.jsx(Vi,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:i.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),i.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),o.jsx("input",{className:"cw-input",value:i.authToken??"",placeholder:"Bearer Token(可选)",onChange:l=>n(a,{authToken:l.target.value})})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:i.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(i.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:s,children:[o.jsx(Nr,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function yB({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.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"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.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"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function Kye({s:e,onRemove:t}){let n=ul,r="火山 Find Skill 技能广场";return e.source==="local"?(n=vv,r="本地"):e.source==="skillspace"&&(n=yB,r="AgentKit Skills 中心"),o.jsxs(nn.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:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Ws(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(Ar,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const s1=[{id:"local",label:"本地文件",icon:vv},{id:"skillspace",label:"AgentKit Skills 中心",icon:yB},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:h0}];function Yye({selected:e,onChange:t}){const[n,r]=E.useState("local"),[s,i]=E.useState(!1),a=s1.findIndex(c=>c.id===n),l=c=>t(e.filter(u=>i1(u)!==c));return E.useEffect(()=>{if(!s)return;const c=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>i(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(Nr,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(di,{initial:!1,children:e.map(c=>o.jsx(Kye,{s:c,onRemove:()=>l(i1(c))},i1(c)))})})]}),o.jsx(di,{children:s&&o.jsx(nn.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:o.jsxs(nn.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:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>i(!1),children:o.jsx(Ar,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${s1.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),s1.map(({id:c,label:u,icon:d})=>o.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:[o.jsx(d,{className:"cw-i cw-i-sm"}),u]},c))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&o.jsx(mye,{selected:e,onChange:t}),n==="local"&&o.jsx(Sye,{selected:e,onChange:t}),n==="skillspace"&&o.jsx(Tye,{selected:e,onChange:t})]})]})]})})})]})}function i1(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function hd({checked:e,onChange:t,title:n,desc:r,icon:s}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-icon",children:o.jsx(s,{className:"cw-i"})}),o.jsxs("span",{className:"cw-toggle-text",children:[o.jsx("span",{className:"cw-toggle-title",children:n}),o.jsx("span",{className:"cw-toggle-desc",children:Ws(r)})]}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(nn.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function Wye(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 Up(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function Rh(e,t,n){if(t.length===0)return n(e);const[r,...s]=t,i=e.subAgents.slice();return i[r]=Rh(i[r],s,n),{...e,subAgents:i}}function Gye(e,t){return Rh(e,t,n=>({...n,subAgents:[...n.subAgents,Wr()]}))}function qye(e,t,n){return Rh(e,t,r=>{const s=r.subAgents.slice();return s.splice(n,0,Wr()),{...r,subAgents:s}})}function Xye(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return Rh(e,n,s=>({...s,subAgents:s.subAgents.filter((i,a)=>a!==r)}))}const Px=e=>!ry(e.agentType),yI=3;function Qye(e,t,n=!1){var s;if(ry(e.agentType))return n?"远程 Agent 只能作为子 Agent":(s=e.a2aRegistry)!=null&&s.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const r=Fc(e.name);return r||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":aB(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function bB(e,t,n=[]){const r=[],s=ry(e.agentType),i=Qye(e,t,n.length===0);return i&&r.push({path:n,name:s?"远程 Agent":e.name.trim()||"未命名",typeLabel:iB(e.agentType).label,problem:i}),Px(e)&&e.subAgents.forEach((a,l)=>r.push(...bB(a,t,[...n,l]))),r}function Zye(e){return`${e.typeLabel}至少需要添加一个子 Agent 后才能调试或发布。`}function EB(e){return 1+e.subAgents.reduce((t,n)=>t+EB(n),0)}function xB(e){const t=[],n={},r=i=>{var a,l,c,u;for(const d of i.builtinTools??[]){const f=dl.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=i.a2aRegistry)!=null&&a.enabled&&(t.push({env:Oj}),Object.assign(n,gB(i.a2aRegistry,{includeDefaults:!0}))),i.memory.shortTerm&&t.push({env:((l=FE.find(d=>d.id===(i.shortTermBackend??"local")))==null?void 0:l.env)??[]}),i.memory.longTerm&&t.push({env:((c=UE.find(d=>d.id===(i.longTermBackend??"local")))==null?void 0:c.env)??[]}),i.knowledgebase&&t.push({env:((u=$E.find(d=>d.id===(i.knowledgebaseBackend??Jc)))==null?void 0:u.env)??[]}),i.tracing)for(const d of i.tracingExporters??[]){const f=HE.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}i.subAgents.forEach(r)};r(e);const s=tB(t);return{specs:s.specs,fixedValues:{...s.fixedValues,...n}}}function wB(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function Jye(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 vB(e){var r,s;const t=xB(e),n={...((r=e.deployment)==null?void 0:r.envValues)??{},...t.fixedValues};return{...wB(e),deployment:{feishuEnabled:!!((s=e.deployment)!=null&&s.feishuEnabled),envValues:Object.fromEntries(nB(t.specs,n).map(({key:i,value:a})=>[i,a]))}}}function ebe(e){return JSON.stringify(vB(e))}function Bg(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function vc(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function tbe({enabled:e,disabledReason:t,variants:n,draftSnapshot:r,input:s,onInput:i,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const g=n.filter(b=>b.phase!=="ready"?!1:b.runtimeSnapshot===Bg(r,b)),w=n.some(b=>b.phase==="sending"),y=g.length>0&&!w;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsxs("div",{className:"cw-ab-grid",children:[n.map((b,x)=>{const _=b.modelName.trim(),k=b.description.trim(),N=b.instruction.trim(),T=vc(b),S=!!(_&&k&&N&&n.findIndex(O=>vc(O)===T)!==x),R=!_||!k||!N||S,I=!!(b.runtimeSnapshot&&b.runtimeSnapshot!==Bg(r,b)),j=b.phase==="starting",F=b.phase==="ready"&&!I,Y=j||b.phase==="sending",L=F&&b.phase!=="sending"&&b.messages.some(O=>O.role==="assistant"),U=Y||b.configOpen||R,C=_?k?N?S?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",M=j?"正在启动":I?"应用配置并重启":F||b.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${b.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":b.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:b.name}),o.jsx("span",{children:b.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:b.configOpen||Y,onClick:()=>f(b.id),children:"测试配置"}),b.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${b.name}`,disabled:b.configOpen||Y,onClick:()=>d(b.id),children:o.jsx(Vi,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:b.error?o.jsx(Dg,{message:b.error,className:"cw-debug-error-detail"}):j?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):I?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):b.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:F?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):b.messages.map((O,D)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${O.role}`,children:o.jsx("div",{className:"cw-debug-content",children:O.role==="user"?O.content:O.error?o.jsx(Dg,{message:O.error,className:"cw-debug-msg-error"}):O.blocks&&O.blocks.length>0?o.jsx(H_,{blocks:O.blocks,onAction:()=>{}}):O.content?O.content:D===b.messages.length-1&&b.phase==="sending"?o.jsx(t5,{}):null})},D))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${b.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(b.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:U,title:C||void 0,onClick:()=>l(b.id),children:[F||I||b.phase==="error"?o.jsx(DM,{className:"cw-i"}):o.jsx(Bye,{className:"cw-i cw-debug-run-icon"}),M]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:Y||!_,onClick:()=>c(b.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!b.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:b.name})]}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!b.configOpen||R,onClick:()=>h(b.id),children:b.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:b.modelName,placeholder:"使用 Agent 当前模型",disabled:!b.configOpen,onChange:O=>p(b.id,"modelName",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:b.description,disabled:!b.configOpen,onChange:O=>p(b.id,"description",O.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:b.instruction,disabled:!b.configOpen,onChange:O=>p(b.id,"instruction",O.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:_B.map(O=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:b.optimizations.includes(O.id),disabled:!0}),o.jsx("span",{children:O.label})]},O.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},b.id)}),n.length<3&&o.jsxs("button",{type:"button",className:"cw-ab-add",onClick:u,children:[o.jsx(Nr,{className:"cw-i"}),o.jsx("strong",{children:"添加对照组"}),o.jsx("span",{children:"最多同时创建 3 个测试组"})]})]}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsx("div",{className:"cw-ab-composer",children:o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:s,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:b=>i(b.target.value),onKeyDown:b=>{n5(b.nativeEvent)||b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!s.trim(),onClick:a,children:w?o.jsx($t,{className:"cw-i cw-spin"}):o.jsx(SM,{className:"cw-i"})})]})})]})}const bI=[{id:"build",label:"构建"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],_B=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function nbe({mode:e,agentName:t,busy:n,onChange:r,onDiscard:s}){const i=bI.findIndex(a=>a.id===e);return o.jsxs("header",{className:"cw-workspace-header",children:[o.jsx("div",{className:"cw-workspace-identity",children:o.jsx("strong",{title:t,children:t||"未命名 Agent"})}),o.jsx("nav",{className:"cw-workspace-stepper","aria-label":"Agent 创建步骤",children:bI.map((a,l)=>{const c=a.id===e,u=lr(a.id),children:o.jsx("strong",{children:a.label})},a.id)})}),s&&o.jsx("div",{className:"cw-workspace-actions",children:o.jsx("button",{type:"button",className:"cw-discard-edit",disabled:n,onClick:s,children:"放弃编辑"})})]})}function rbe({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:s,onDeploymentTaskChange:i,deploymentTarget:a,initialDeployRegion:l="cn-beijing",onDeploymentComplete:c,onDeploymentStarted:u,onDraftChange:d,onDiscard:f}){var Ta,Ol,So,ei,xt,z,se,ye,Ue,It,Qt,Sn,Mn,Ft,qt;const[h,p]=E.useState(()=>r??Wr()),[m,g]=E.useState(""),[w,y]=E.useState(!1),[b,x]=E.useState(!1),[_,k]=E.useState(null),N=E.useRef(JSON.stringify(h)),T=E.useRef(N.current),S=JSON.stringify(h),R=S!==N.current,I=E.useRef(d);E.useEffect(()=>{I.current=d},[d]),E.useEffect(()=>{var q;S!==T.current&&(T.current=S,(q=I.current)==null||q.call(I,h,R))},[h,R,S]);const[j,F]=E.useState("build"),[Y,L]=E.useState(!1),[U,C]=E.useState(!1),[M,O]=E.useState(0),[D,A]=E.useState(null),[H,W]=E.useState(!1),[P,te]=E.useState((a==null?void 0:a.region)??l),X=(s==null?void 0:s.generatedAgentTestRun)===!0,ne=(s==null?void 0:s.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[ce,J]=E.useState(()=>[{id:"baseline",name:"基准组",modelName:(r??Wr()).modelName??"",description:(r??Wr()).description,instruction:(r??Wr()).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[fe,ee]=E.useState("baseline"),Ee=E.useRef(1),ge=E.useRef(new Map),[xe,we]=E.useState(0),[Ae,Re]=E.useState(""),[Ye,Le]=E.useState(null),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(!1),ve=E.useRef(null),[ct,ht]=E.useState("basic"),[G,Z]=E.useState(""),[he,De]=E.useState(!1),[qe,nt]=E.useState(!1),[Kt,Et]=E.useState(!1),[Pt,Yt]=E.useState(!1),[Nt,rn]=E.useState([]),sn=E.useRef(null),_t=E.useRef({});async function rt(){const q=new Set([...ge.current.values()].map(({run:Fe})=>Fe.runId)),ae=ak().filter(Fe=>!q.has(Fe));ae.length&&await Promise.all(ae.map(async Fe=>{try{await Yl(Fe),fd(Fe)}catch(We){console.warn("清理遗留调试运行失败",We)}}))}E.useEffect(()=>(rt(),()=>{for(const{run:q}of ge.current.values())Yl(q.runId).then(()=>fd(q.runId)).catch(ae=>console.warn("清理调试运行失败",ae));ge.current.clear()}),[]),E.useEffect(()=>()=>{var q;(q=ve.current)==null||q.call(ve,!1),ve.current=null},[]);const Oe=E.useRef(null);Oe.current||(Oe.current=({meta:q,children:ae})=>o.jsxs("section",{ref:Fe=>{_t.current[q.id]=Fe},id:`cw-sec-${q.id}`,"data-step-id":q.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsxs("h2",{className:"cw-sec-title",children:[q.label,q.required&&o.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),ae]}));const gt=Wye(h,Nt)?Nt:[],Se=Up(h,gt),pe=gt.length===0,Je=`cw-model-advanced-${gt.join("-")||"root"}`,at=`cw-a2a-registry-advanced-${gt.join("-")||"root"}`,dn=`cw-more-tool-types-${gt.join("-")||"root"}`,an=`cw-advanced-config-${gt.join("-")||"root"}`,pt=q=>p(ae=>Rh(ae,gt,Fe=>({...Fe,...q}))),Lt=(q,ae)=>p(Fe=>{var We;return{...Fe,deployment:{...Fe.deployment??{feishuEnabled:!1},envValues:{...((We=Fe.deployment)==null?void 0:We.envValues)??{},[q]:ae}}}}),on=q=>pt({a2aRegistry:{...Se.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...q}}),On=(q,ae)=>{if(!(q in mI))return;const Fe=mI[q];on({[Fe]:ae}),Lt(q,ae)},lr=q=>{if(!(pe&&q==="a2a")){if(q==="a2a"){pt({agentType:q,a2aRegistry:{...Se.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}pt({agentType:q,a2aRegistry:Se.a2aRegistry?{...Se.a2aRegistry,enabled:!1}:void 0})}},fn=(q,ae)=>{p(q),ae&&rn(ae)},Bt=async()=>{const q=m.trim();if(!(!q||w)&&!(R&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){y(!0),x(!1),k(null),Z("");try{const ae=await mj(q);p(ik(ae.draft)),rn([]),A(null),C(!1),Z(""),x(!0)}catch(ae){k(ae instanceof Error?ae.message:"生成 Agent 配置失败")}finally{y(!1)}}},Kn=q=>{const ae=Up(h,q);if(!Px(ae)||q.length>=yI)return;const Fe=Gye(h,q),We=Up(Fe,q).subAgents.length-1;fn(Fe,[...q,We])},ue=(q,ae)=>{const Fe=Up(h,q);if(!Px(Fe)||q.length>=yI)return;const We=Math.max(0,Math.min(ae,Fe.subAgents.length)),pn=qye(h,q,We);fn(pn,[...q,We])},Te=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(p(Wr()),rn([]),C(!1),Yt(!1))},Ce=q=>{if(q.length===0){Te();return}fn(Xye(h,q),q.slice(0,-1))},Qe=Se.builtinTools??[],ot=Se.mcpTools??[],et=Se.tracingExporters??[],Ct=Se.selectedSkills??[],Wt=[Se.memory.shortTerm,Se.memory.longTerm,Se.tracing].filter(Boolean).length,oe=q=>pt({builtinTools:Qe.includes(q)?Qe.filter(ae=>ae!==q):[...Qe,q]}),be=q=>{const ae=et.includes(q)?et.filter(Fe=>Fe!==q):[...et,q];pt({tracingExporters:ae,tracing:ae.length>0?!0:Se.tracing})},dt=aB(Se.agentType),Ve=ry(Se.agentType),Ke=E.useMemo(()=>sB(h),[h]),ft=Ve?null:Fc(Se.name)??(Ke.has(Se.name)?"Agent 名称在当前结构中必须唯一":null),Gt=ft!==null,cr=!Ve&&Se.description.trim().length===0,Yn=Se.instruction.trim().length===0,hn=Ve&&!((Ta=Se.a2aRegistry)!=null&&Ta.registrySpaceId.trim()),Ln=q=>U&&q?`is-error cw-error-shake-${M%2}`:"",Ht=E.useMemo(()=>bB(h,Ke),[h,Ke]),Jt=Ht.length===0,Ot=E.useMemo(()=>ebe(h),[h]),kn=ce.find(q=>q.id===fe)??ce[0],Nn=E.useMemo(()=>xB(h),[h]),en=E.useMemo(()=>{var q,ae,Fe,We;return{type:!0,basic:Ve?!hn:!Gt&&(dt||!Yn),model:!!((q=Se.modelName)!=null&&q.trim()||(ae=Se.modelProvider)!=null&&ae.trim()||(Fe=Se.modelApiBase)!=null&&Fe.trim()),tools:Qe.length>0||ot.length>0,skills:Ct.length>0,knowledge:Se.knowledgebase,advanced:Se.memory.shortTerm||Se.memory.longTerm||Se.tracing,subagents:(((We=Se.subAgents)==null?void 0:We.length)??0)>0,review:Jt}},[Se,Gt,Yn,dt,Ve,Jt,Qe,ot,Ct]),Wn=dt||Ve?["type","basic"]:["type","basic","model","tools","skills","knowledge",...pe?["advanced"]:[]],pr=hI.filter(q=>Wn.includes(q.id)),nr=Wn.join("|"),Si=gt.join("."),Xs=pr.findIndex(q=>q.id===ct),Zr=q=>{var ae;(ae=_t.current[q])==null||ae.scrollIntoView({behavior:"smooth",block:"start"})};E.useEffect(()=>{if(D)return;const q=sn.current;if(!q)return;const ae=nr.split("|");let Fe=0;const We=()=>{Fe=0;const ln=ae[ae.length-1];let jn=ae[0];if(q.scrollTop+q.clientHeight>=q.scrollHeight-2)jn=ln;else{const $n=q.getBoundingClientRect().top+24;for(const jt of ae){const Xt=_t.current[jt];if(!Xt||Xt.getBoundingClientRect().top>$n)break;jn=jt}}jn&&ht($n=>$n===jn?$n:jn)},pn=()=>{Fe||(Fe=window.requestAnimationFrame(We))};return We(),q.addEventListener("scroll",pn,{passive:!0}),window.addEventListener("resize",pn),()=>{q.removeEventListener("scroll",pn),window.removeEventListener("resize",pn),Fe&&window.cancelAnimationFrame(Fe)}},[D,nr,Si]);const wr=()=>Jt?!0:(C(!0),O(q=>q+1),Ht[0]&&(rn(Ht[0].path),window.requestAnimationFrame(()=>Zr(Ht[0].problem==="缺少子 Agent"?"type":"basic"))),!1),Ts=async()=>{Le(null);const q=[...ge.current.values()];ge.current.clear(),we(0),J(ae=>ae.map(Fe=>({...Fe,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(q.map(async({run:ae})=>{try{await Yl(ae.runId),fd(ae.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}))},Qs=async q=>{const ae=ge.current.get(q);if(ae){ge.current.delete(q),we(ge.current.size);try{await Yl(ae.run.runId),fd(ae.run.runId)}catch(Fe){console.warn("清理调试运行失败",Fe)}}},ka=q=>{const ae=ge.current.get(q),Fe=ce.find(We=>We.id===q);!ae||!Fe||Le({runId:ae.run.runId,sessionId:ae.sessionId,variantName:Fe.name})},Ur=q=>{const ae=ve.current;ve.current=null,ae==null||ae(q)},wo=()=>{ze||(Ze(!1),Ur(!1))},Na=async()=>{if(!ze){le(!0);try{await Ts(),Ze(!1),Ur(!0)}finally{le(!1)}}},Zs=async()=>j!=="validate"||xe===0?!0:ve.current?!1:new Promise(q=>{ve.current=q,Ze(!0)}),Cl=async q=>{if(await Zs()){if(Z(""),!wr()){F("build");return}W(!0);try{const ae=q?ce.find(pn=>pn.id===q):kn;ae&&ee(ae.id);const Fe=ae?{...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction}:h,We=await Pv(wB(Fe));Fe!==h&&p(Fe),A(We),F("publish")}catch(ae){Z(ae instanceof Error?ae.message:String(ae))}finally{W(!1)}}},Js=async q=>{if(!X||H||!wr())return;const ae=ce.find(Ut=>Ut.id===q);if(!ae||ae.phase==="starting"||ae.phase==="sending")return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=vc(ae),jn=ce.findIndex(Ut=>Ut.id===q),$n=ce.findIndex(Ut=>vc(Ut)===ln);if(!Fe||!We||!pn||$n!==jn)return;const jt=Bg(Ot,ae);J(Ut=>Ut.map(ur=>ur.id===q?{...ur,configOpen:!1,phase:"starting",messages:[],error:null}:ur)),Re("");let Xt=null;try{await Qs(q),await rt();const Ut={...h,modelName:ae.modelName||h.modelName,description:ae.description,instruction:ae.instruction};Xt=await gj(vB(Ut)),Dye(Xt.runId);const ur=await yj(Xt.runId,"test_user");ge.current.set(q,{run:Xt,sessionId:ur}),we(ge.current.size),J(mn=>mn.map(qi=>qi.id===q?{...qi,phase:"ready",runtimeSnapshot:jt}:qi))}catch(Ut){if(Xt)try{await Yl(Xt.runId),fd(Xt.runId)}catch(ur){console.warn("清理调试运行失败",ur)}J(ur=>ur.map(mn=>mn.id===q?{...mn,phase:"error",runtimeSnapshot:"",error:Ut instanceof Error?Ut.message:String(Ut)}:mn))}},Il=async()=>{const q=Ae.trim(),ae=ce.filter(We=>We.phase==="ready"&&We.runtimeSnapshot===Bg(Ot,We)&&ge.current.has(We.id));if(!q||ae.length===0)return;Re("");const Fe=new Set(ae.map(We=>We.id));J(We=>We.map(pn=>Fe.has(pn.id)?{...pn,phase:"sending",messages:[...pn.messages,{role:"user",content:q},{role:"assistant",content:"",blocks:[]}]}:pn)),await Promise.all(ae.map(async We=>{const pn=ge.current.get(We.id);if(pn)try{let ln=hi();for await(const jn of Ej({runId:pn.run.runId,userId:"test_user",sessionId:pn.sessionId,text:q})){const $n=jn.error||jn.errorMessage||jn.error_message;if(J(jt=>jt.map(Xt=>{if(Xt.id!==We.id)return Xt;const Ut=[...Xt.messages],ur={...Ut[Ut.length-1]};return $n?ur.error=String($n):(ln=Xc(ln,jn),ur.content=ln.blocks.filter(mn=>mn.kind==="text").map(mn=>mn.text).join(""),ur.blocks=ln.blocks),Ut[Ut.length-1]=ur,{...Xt,messages:Ut}})),$n)break}}catch(ln){J(jn=>jn.map($n=>{if($n.id!==We.id)return $n;const jt=[...$n.messages],Xt={...jt[jt.length-1]};return Xt.error=ln instanceof Error?ln.message:String(ln),jt[jt.length-1]=Xt,{...$n,messages:jt}}))}finally{J(ln=>ln.map(jn=>jn.id===We.id?{...jn,phase:"ready"}:jn))}}))},vo=()=>{J(q=>{if(q.length>=3)return q;const ae=Ee.current++,Fe=`variant-${ae}`;return[...q,{id:Fe,name:`对照组 ${ae}`,modelName:h.modelName??"",description:h.description,instruction:h.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},_o=async q=>{await Qs(q),J(ae=>ae.filter(Fe=>Fe.id!==q)),fe===q&&ee("baseline")},Sa=(q,ae)=>J(Fe=>Fe.map(We=>We.id===q?{...We,...ae}:We)),mr=(q,ae,Fe)=>{Sa(q,{[ae]:Fe}),!(fe!==q||q==="baseline")&&ee("baseline")},ko=q=>{const ae=ce.find(jt=>jt.id===q);if(!ae)return;const Fe=ae.modelName.trim(),We=ae.description.trim(),pn=ae.instruction.trim(),ln=vc(ae),jn=ce.findIndex(jt=>jt.id===q),$n=ce.findIndex(jt=>vc(jt)===ln);if(!(!Fe||!We||!pn||$n!==jn)){if(q==="baseline"){Sa(q,{configOpen:!1});return}Js(q)}},No=async(q,ae,Fe)=>{var ln;const We=(ln=h.deployment)==null?void 0:ln.network,pn=We&&We.mode&&We.mode!=="public"?{mode:We.mode,vpc_id:We.vpcId,subnet_ids:We.subnetIds,enable_shared_internet_access:We.enableSharedInternetAccess}:void 0;return y0(q.name,q.files,{region:(a==null?void 0:a.region)??P,projectName:"default",network:pn},{...Fe,onStage:ae,runtimeId:a==null?void 0:a.runtimeId,description:h.description})},Rl=()=>{wr()&&(J(q=>q.map(ae=>ae.id==="baseline"&&!ge.current.has(ae.id)?{...ae,modelName:h.modelName??"",description:h.description,instruction:h.instruction}:ae)),F("validate"))},Du=async q=>{if(q==="publish"){if(!wr())return;D?F("publish"):Cl();return}if(q==="validate"){Rl();return}await Zs()&&F(q)},As=Oe.current,Cs=q=>hI.find(ae=>ae.id===q);return o.jsxs("div",{className:"cw-root",children:[o.jsx(nbe,{mode:j,agentName:Jye(h),busy:H,onChange:Du,onDiscard:f?()=>{R?L(!0):f()}:void 0}),G&&o.jsx("div",{className:"cw-workspace-alert",role:"alert",children:G}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[j==="build"&&o.jsxs("div",{className:"cw-build-workspace",children:[o.jsx("section",{className:`cw-ai-compose${w?" is-generating":""}${b?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(di,{initial:!1,mode:"wait",children:b?o.jsxs(nn.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:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>x(!1),children:"重新生成"})]},"success"):o.jsxs(nn.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:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:q=>{q.preventDefault(),Bt()},children:[o.jsx("input",{type:"text",value:m,maxLength:8e3,disabled:w,placeholder:"输入您的目标",onChange:q=>g(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),Bt())}}),o.jsx("button",{type:"submit",disabled:w||!m.trim(),"aria-label":w?"正在智能生成":"智能生成",children:w?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),o.jsx("p",{className:"cw-ai-compose-note",children:"使用 doubao-seed-2-0-lite-260428 模型生成,将会产生 Token 消耗"})]},"compose")})}),o.jsxs("div",{className:"cw-editor",children:[o.jsx(Rg,{draft:h,direction:"vertical",selectedPath:gt,onSelect:rn,onAdd:Kn,onInsert:ue,onDelete:Ce}),o.jsxs("div",{className:"cw-detail",children:[o.jsx("div",{className:"cw-detail-scroll",ref:sn,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsxs("div",{className:"cw-lower",children:[o.jsxs("div",{className:"cw-form-col",children:[o.jsxs(As,{meta:Cs("type"),children:[o.jsx("div",{className:"cw-agent-type-options",role:"radiogroup","aria-label":"Agent 类型",children:dye.map(q=>{const ae=(Se.agentType??"llm")===q.id,Fe=pe&&q.id==="a2a",We=Fe?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("label",{"data-agent-type":q.id,className:`cw-agent-type-option ${ae?"is-on":""} ${Fe?"is-disabled":""}`,title:Fe?void 0:pI[q.id],tabIndex:Fe?0:void 0,"aria-describedby":We,children:[o.jsx("input",{type:"radio",name:"agentType",className:"cw-agent-type-radio",checked:ae,disabled:Fe,onChange:()=>lr(q.id)}),o.jsxs("span",{className:"cw-agent-type-copy",children:[o.jsx("strong",{children:Fye[q.id]}),o.jsx("small",{children:pI[q.id]})]}),Fe&&o.jsx("span",{id:We,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},q.id)})}),U&&dt&&Se.subAgents.length===0&&o.jsx("span",{className:"cw-error-text",children:Zye({name:Se.name.trim()||"未命名",typeLabel:iB(Se.agentType).label})})]}),o.jsx(As,{meta:Cs("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Ve&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Ln(Gt)}`,value:Se.name,placeholder:"customer_service",onChange:q=>pt({name:q.target.value})}),U&&ft?o.jsx("span",{className:"cw-error-text",children:ft}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[pe?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Ln(cr)}`,value:Se.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:q=>pt({description:q.target.value})}),U&&cr?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:pe?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),dt?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),Se.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:Se.maxIterations??3,onChange:q=>pt({maxIterations:Math.max(1,Number(q.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Ve?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(Hye,{value:((Ol=Se.a2aRegistry)==null?void 0:Ol.registrySpaceId)??"",region:((So=Se.a2aRegistry)==null?void 0:So.registryRegion)||Ei.region,invalid:U&&hn,onChange:q=>On(mB,q)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":qe,"aria-controls":at,onClick:()=>nt(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${qe?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:qe&&o.jsx(nn.div,{id:at,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:o.jsx(Vl,{env:Uye,values:gB(Se.a2aRegistry,{includeDefaults:!1}),onChange:On})})}),U&&hn&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(E.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(jye,{value:Se.instruction,invalid:Yn,onChange:q=>pt({instruction:q})})}),U&&Yn?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!dt&&!Ve&&o.jsxs(o.Fragment,{children:[o.jsx(As,{meta:Cs("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:Se.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:q=>pt({modelName:q.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":he,"aria-controls":Je,onClick:()=>De(q=>!q),children:[o.jsx("span",{children:"更多选项"}),o.jsx($s,{className:`cw-more-options-chevron ${he?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:he&&o.jsxs(nn.div,{id:Je,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:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:Se.modelProvider??"",placeholder:"openai",onChange:q=>pt({modelProvider:q.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:Se.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:q=>pt({modelApiBase:q.target.value})}),o.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(As,{meta:Cs("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(gI,{items:dl,selected:Qe,onToggle:oe,scrollRows:6})}),o.jsx(di,{initial:!1,children:Qe.includes("run_code")&&o.jsxs(nn.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:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(Vl,{env:((ei=dl.find(q=>q.id==="run_code"))==null?void 0:ei.env)??[],values:((xt=h.deployment)==null?void 0:xt.envValues)??{},onChange:Lt})]})})]}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":Kt,"aria-controls":dn,onClick:()=>Et(q=>!q),children:[o.jsx("span",{children:"更多类型工具"}),ot.length>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",ot.length]}),o.jsx($s,{className:`cw-more-options-chevron ${Kt?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(di,{initial:!1,children:Kt&&o.jsx(nn.div,{id:dn,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:o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),o.jsx(Vye,{tools:ot,onChange:q=>pt({mcpTools:q})})]})})})]})}),o.jsx(As,{meta:Cs("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(Yye,{selected:Ct,onChange:q=>pt({selectedSkills:q})})})}),o.jsx(As,{meta:Cs("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Se.knowledgebase,onChange:q=>pt({knowledgebase:q}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:im}),Se.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(t1,{options:$E,value:Se.knowledgebaseBackend,onChange:q=>pt({knowledgebaseBackend:q,knowledgebaseIndex:q==="viking"?Se.knowledgebaseIndex:""})}),(Se.knowledgebaseBackend??Jc)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(zye,{value:Se.knowledgebaseIndex??"",onChange:q=>pt({knowledgebaseIndex:q})})]}),o.jsx(Vl,{env:((z=$E.find(q=>q.id===(Se.knowledgebaseBackend??Jc)))==null?void 0:z.env)??[],values:((se=h.deployment)==null?void 0:se.envValues)??{},onChange:Lt})]})]})}),pe&&o.jsxs("section",{ref:q=>{_t.current.advanced=q},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[o.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":Pt,"aria-controls":an,onClick:()=>Yt(q=>!q),children:[o.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),o.jsx($s,{className:`cw-advanced-disclosure-chevron ${Pt?"is-open":""}`,"aria-hidden":!0}),Wt>0&&o.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",Wt]})]}),o.jsx(di,{initial:!1,children:Pt&&o.jsxs(nn.div,{id:an,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:[o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"记忆"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Se.memory.shortTerm,onChange:q=>pt({memory:{...Se.memory,shortTerm:q}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OM}),Se.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(t1,{options:FE,value:Se.shortTermBackend,onChange:q=>pt({shortTermBackend:q})}),o.jsx(Vl,{env:((ye=FE.find(q=>q.id===(Se.shortTermBackend??"local")))==null?void 0:ye.env)??[],values:((Ue=h.deployment)==null?void 0:Ue.envValues)??{},onChange:Lt})]}),o.jsx(hd,{checked:Se.memory.longTerm,onChange:q=>pt({memory:{...Se.memory,longTerm:q}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:im}),Se.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(t1,{options:UE,value:Se.longTermBackend,onChange:q=>pt({longTermBackend:q})}),o.jsx(Vl,{env:((It=UE.find(q=>q.id===(Se.longTermBackend??"local")))==null?void 0:It.env)??[],values:((Qt=h.deployment)==null?void 0:Qt.envValues)??{},onChange:Lt}),o.jsx(hd,{checked:!!Se.autoSaveSession,onChange:q=>pt({autoSaveSession:q}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:im})]})]})]}),o.jsxs("div",{className:"cw-advanced-group",children:[o.jsx("div",{className:"cw-advanced-group-head",children:o.jsx("span",{children:"观测"})}),o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(hd,{checked:Se.tracing,onChange:q=>pt({tracing:q}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:xv}),Se.tracing&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),o.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),o.jsx(gI,{items:HE,selected:et,onToggle:be}),o.jsx(Vl,{env:HE.filter(q=>et.includes(q.id)).flatMap(q=>q.env),values:((Sn=h.deployment)==null?void 0:Sn.envValues)??{},onChange:Lt})]})]})]})]})})]})]})]}),o.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:o.jsxs("ol",{className:"cw-steps",children:[o.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:o.jsx(nn.div,{className:"cw-rail-fill",animate:{height:`${Math.max(Xs,0)/Math.max(pr.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),pr.map(q=>{const ae=q.id===ct,Fe=en[q.id];return o.jsx("li",{children:o.jsxs("button",{type:"button",className:`cw-step ${ae?"is-active":""} ${Fe?"is-done":""}`,onClick:()=>Zr(q.id),"aria-current":ae?"step":void 0,"aria-label":q.label,children:[o.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:ae?o.jsx("span",{className:"cw-dot"}):Fe?o.jsx(Gs,{className:"cw-step-check"}):o.jsx("span",{className:"cw-dot"})}),o.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:q.label})]})},q.id)})]})})]})})}),o.jsx("button",{type:"button",className:"cw-build-next studio-update-action",onClick:Rl,children:o.jsx("span",{children:"开始调试"})})]})]})]}),j==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(tbe,{enabled:X,disabledReason:ne,variants:ce,draftSnapshot:Ot,input:Ae,onInput:Re,onSend:Il,onStartVariant:Js,onDeployVariant:q=>void Cl(q),onAddVariant:vo,onRemoveVariant:_o,onToggleConfig:q=>{const ae=ce.find(Fe=>Fe.id===q);ae&&Sa(q,{configOpen:!ae.configOpen})},onCompleteConfig:ko,onConfigChange:mr,onOpenTrace:ka})})}),j==="publish"&&o.jsx("div",{className:"cw-preview-body",children:D?o.jsx(ny,{embedded:!0,project:D,agentDraft:h,agentName:h.name||"未命名 Agent",agentCount:EB(h),releaseConfiguration:kn?{modelName:kn.modelName||h.modelName||"默认模型",description:kn.description,instruction:kn.instruction,optimizations:kn.optimizations.flatMap(q=>{const ae=_B.find(Fe=>Fe.id===q);return ae?[ae.label]:[]})}:void 0,onChange:A,onDeploy:No,onAgentAdded:n,onDeploymentTaskChange:i,deploymentActionLabel:a?"更新并发布":"部署",deploymentRuntimeId:a==null?void 0:a.runtimeId,onDeploymentStarted:u,onDeploymentComplete:c,feishuEnabled:!!((Mn=h.deployment)!=null&&Mn.feishuEnabled),onFeishuEnabledChange:q=>{const ae={...h,deployment:{...h.deployment??{feishuEnabled:!1},feishuEnabled:q}};p(ae)},deploymentEnv:Nn.specs,deploymentEnvValues:{...(Ft=h.deployment)==null?void 0:Ft.envValues,...Nn.fixedValues},onDeploymentEnvChange:Lt,network:(qt=h.deployment)==null?void 0:qt.network,onNetworkChange:q=>p(ae=>({...ae,deployment:{...ae.deployment??{feishuEnabled:!1},network:q}})),deployRegion:P,onDeployRegionChange:te,onExportYaml:()=>Pye(`${h.name||"agent"}.yaml`,R0e(h),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx($t,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),Ye&&o.jsx(dB,{testRunId:Ye.runId,sessionId:Ye.sessionId,title:`调用链路 · ${Ye.variantName}`,onClose:()=>Le(null)}),bt&&o.jsx(U6,{variant:"warning",title:"离开调试?",description:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",confirmLabel:ze?"清理中...":"确定离开",closeLabel:"关闭离开调试确认",busy:ze,onCancel:wo,onConfirm:()=>void Na()}),Y&&o.jsx("div",{className:"confirm-scrim",onClick:()=>L(!1),children:o.jsxs("div",{className:"confirm-box",role:"dialog","aria-modal":"true","aria-labelledby":"discard-edit-title",onClick:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"discard-edit-title",children:"放弃本次编辑?"}),o.jsx("div",{className:"confirm-text",children:"本次修改将不会保留,智能体会恢复到进入编辑前的状态。"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>L(!1),children:"继续编辑"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",onClick:()=>{L(!1),f==null||f()},children:"放弃编辑"})]})]})}),_&&o.jsx("div",{className:"confirm-scrim",onClick:()=>k(null),children:o.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:q=>q.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:_}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>k(null),children:"关闭"})})]})})]})}function ea(e){return{...Wr(),...e}}const sbe=[{id:"support",icon:sV,draft:ea({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:$z,draft:ea({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:iV,draft:ea({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:bv,draft:ea({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:fV,draft:ea({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:SV,draft:ea({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[ea({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),ea({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),ea({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function ibe(e){const t=[];return e.tools.length&&t.push({icon:PM,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:Uz,label:"记忆"}),e.knowledgebase&&t.push({icon:Fz,label:"知识库"}),e.tracing&&t.push({icon:Pz,label:"观测"}),e.subAgents.length&&t.push({icon:jM,label:`子Agent ${e.subAgents.length}`}),t}function abe({onBack:e,onCreate:t}){const[n,r]=E.useState(null);return o.jsx("div",{className:"tpl-root",children:n?o.jsx(lbe,{template:n,onBack:()=>r(null),onCreate:t}):o.jsx(obe,{onPick:r})})}function obe({onPick:e}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:sbe.map((t,n)=>o.jsxs(nn.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:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(t.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:t.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:Ws(t.draft.description)})]},t.id))})]})}function lbe({template:e,onBack:t,onCreate:n}){const[r,s]=E.useState(e.draft.name),i=e.icon,a=ibe(e.draft);function l(){const c=r.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(gv,{className:"icon"})," 返回模板列表"]}),o.jsxs(nn.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(i,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:Ws(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:r,onChange:c=>s(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:cbe(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:Ws(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx($s,{className:"icon"})]})]})]})}function cbe(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const ube=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:LM},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:NM},{type:"loop",label:"循环",desc:"节点循环执行",Icon:kv}];let Bx=0;function a1(){return Bx+=1,`node_${Bx}`}function o1(e,t,n){const r=Wr();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function dbe({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Dr,{type:"target",position:He.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(cl,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Dr,{type:"source",position:He.Right,className:"wfb-handle"})]})}const fbe={agentNode:dbe},EI={type:"smoothstep",markerEnd:{type:lu.ArrowClosed,width:16,height:16}};function hbe({onBack:e,onCreate:t}){const n=E.useRef(null),[r,s]=E.useState(""),[i,a]=E.useState(""),[l,c]=E.useState("sequential"),u=E.useMemo(()=>{Bx=0;const C=a1();return o1(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=a6([u]),[p,m,g]=o6([]),[w,y]=E.useState(u.id),b=d.find(C=>C.id===w)??null,x=r.trim()||"workflow_agent",_=E.useMemo(()=>sB({name:x,subAgents:d.map(C=>C.data.agent)}),[x,d]),k=Fc(x)??(_.has(x)?"名称须与 Agent 节点名称保持唯一":null),N=b?Fc(b.data.agent.name)??(_.has(b.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=d.length>0&&k===null&&d.every(C=>Fc(C.data.agent.name)===null&&!_.has(C.data.agent.name)),S=E.useCallback(C=>m(M=>M4({...C,...EI},M)),[m]),R=E.useCallback(()=>{const C=a1(),M=d.length*28,O=o1(C,{x:80+M,y:120+M});f(D=>D.concat(O)),y(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},j=E.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=E.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const O=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),D=a1(),A=o1(D,O);f(H=>H.concat(A)),y(D)},[f]),Y=E.useCallback(C=>{w&&f(M=>M.map(O=>O.id===w?{...O,data:{...O.data,agent:{...O.data.agent,...C}}}:O))},[w,f]),L=E.useCallback(()=>{w&&(f(C=>C.filter(M=>M.id!==w)),m(C=>C.filter(M=>M.source!==w&&M.target!==w)),y(null))},[w,f,m]),U=E.useCallback(()=>{if(!T)return;const C=d.map(O=>O.data.agent),M={...Wr(),name:x,description:i.trim(),instruction:i.trim(),subAgents:C,workflow:{type:l,nodes:d.map(O=>({id:O.id,agent:O.data.agent})),edges:p.map(O=>({from:O.source,to:O.target}))}};t(M)},[T,d,p,x,i,l,t]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:r,onChange:C=>s(C.target.value),placeholder:"my_workflow"}),k&&o.jsx("span",{className:"wfb-field-error",children:k})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:i,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:ube.map(({type:C,label:M,desc:O,Icon:D})=>o.jsxs("button",{type:"button",className:`wfb-type ${l===C?"wfb-type--active":""}`,onClick:()=>c(C),children:[o.jsx(D,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:M}),o.jsx("span",{className:"wfb-type-desc",children:O})]})]},C))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(rV,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(cl,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[o.jsx(Nr,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:U,disabled:!T,type:"button",children:[o.jsx(ul,{className:"icon"}),"创建工作流"]}),o.jsxs(i6,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:g,onConnect:S,onInit:C=>n.current=C,nodeTypes:fbe,defaultEdgeOptions:EI,onDrop:F,onDragOver:j,onNodeClick:(C,M)=>y(M.id),onPaneClick:()=>y(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(c6,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(d6,{showInteractive:!1}),o.jsx(ffe,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:b?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:L,title:"删除节点",children:o.jsx(Vi,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:b.data.agent.name,onChange:C=>Y({name:C.target.value}),placeholder:"agent_name"}),N?o.jsx("span",{className:"wfb-field-error",children:N}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.description,onChange:C=>Y({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:b.data.agent.instruction,onChange:C=>Y({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:b.data.agent.tools.join(", "),onChange:C=>Y({tools:C.target.value.split(",").map(M=>M.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:b.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(cl,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function pbe(e){return o.jsx(O_,{children:o.jsx(hbe,{...e})})}const xI=50*1024*1024,Fx=800,mbe={name:"code_package",files:[]};function gbe(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 ybe(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 bbe(e){const t=e.flatMap(a=>{const l=ybe(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>Fx)throw new Error(`代码包文件数不能超过 ${Fx} 个。`);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 Ebe({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,initialDeployRegion:i="cn-beijing"}){const a=E.useRef(null),l=E.useRef(0),[c,u]=E.useState(null),[d,f]=E.useState(""),[h,p]=E.useState(!1),[m,g]=E.useState(!1),[w,y]=E.useState(!1),[b,x]=E.useState(""),[_,k]=E.useState(i),[N,T]=E.useState();E.useEffect(()=>()=>{l.current+=1},[]);async function S(F){const Y=++l.current;if(x(""),!F.name.toLowerCase().endsWith(".zip")){x("请选择 .zip 格式的代码包。");return}if(F.size>xI){x("代码包不能超过 50 MB。");return}g(!0);try{const L=await oB(new Uint8Array(await F.arrayBuffer()),{maxEntries:Fx,maxUncompressedBytes:xI}),U=bbe(L);if(Y!==l.current)return;f(F.name),u({name:gbe(F.name),files:U})}catch(L){if(Y!==l.current)return;f(""),u(null),x(L instanceof Error?L.message:String(L))}finally{Y===l.current&&g(!1)}}function R(F){var L;const Y=(L=F.currentTarget.files)==null?void 0:L[0];F.currentTarget.value="",Y&&S(Y)}function I(F){var L;F.preventDefault(),y(!1);const Y=(L=F.dataTransfer.files)==null?void 0:L[0];Y&&S(Y)}async function j(F,Y,L){const U=N&&N.mode!=="public"?{mode:N.mode,vpc_id:N.vpcId,subnet_ids:N.subnetIds,enable_shared_internet_access:N.enableSharedInternetAccess}:void 0;return y0(F.name,F.files,{region:_,projectName:"default",network:U},{...L,onStage:Y})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(ny,{project:c??mbe,agentName:(c==null?void 0:c.name)||"代码包",onChange:c?u:void 0,onDeploy:j,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:r,onDeploymentComplete:s,network:N,onNetworkChange:T,deployRegion:_,onDeployRegionChange:k,onBack:e,backLabel:"返回创建方式",deployDisabled:!c||m,deployDisabledReason:m?"正在读取代码包":c?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${w?" is-dragging":""}${c?" is-ready":""}`,onDragEnter:F=>{F.preventDefault(),y(!0)},onDragOver:F=>F.preventDefault(),onDragLeave:F=>{F.currentTarget.contains(F.relatedTarget)||y(!1)},onDrop:I,onClick:()=>{var F;m||(F=a.current)==null||F.click()},onKeyDown:F=>{var Y;!m&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),(Y=a.current)==null||Y.click())},role:"button",tabIndex:m?-1:0,"aria-label":c?"重新上传代码包":"上传代码包","aria-disabled":m,children:[o.jsx("strong",{children:m?"正在读取代码包…":c?d:"请上传代码包"}),o.jsx("span",{children:c?`已识别 ${c.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:c&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:F=>{F.stopPropagation(),p(!0)},onKeyDown:F=>F.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:a,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:R})]}),b&&o.jsx("div",{className:"package-create-error",role:"alert",children:b})]})}),c&&o.jsx(rB,{project:c,open:h,onClose:()=>p(!1),onChange:u})]})}const xbe=3*60*1e3,wbe=3e3,vbe=10*60*1e3,Fg="veadk.studio.pending-update",wI=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],_be={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function kbe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function Nbe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function Sbe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(Fg);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(Fg),null}function l1(e,t){window.localStorage.setItem(Fg,JSON.stringify({targetVersion:e,startedAt:t}))}function $p(){window.localStorage.removeItem(Fg)}function vI({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function Tbe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function Abe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function _I({lines:e,phase:t,copyState:n,onCopy:r}){const s=E.useRef(null),i=E.useRef(!0);return E.useEffect(()=>{const a=s.current;a&&i.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:r,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:s,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;i.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function Cbe(){var Y,L;const[e]=E.useState(Sbe),[t,n]=E.useState(null),[r,s]=E.useState(e?"submitting":"idle"),[i,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState((e==null?void 0:e.targetVersion)??""),[f,h]=E.useState(!1),[p,m]=E.useState("idle"),[g,w]=E.useState(0),y=E.useRef(null),b=E.useRef((e==null?void 0:e.targetVersion)??""),x=E.useRef((e==null?void 0:e.startedAt)??0);E.useEffect(()=>{if(!f)return;const U=M=>{var O;M.target instanceof Node&&!((O=y.current)!=null&&O.contains(M.target))&&h(!1)},C=M=>{M.key==="Escape"&&h(!1)};return window.addEventListener("pointerdown",U),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",U),window.removeEventListener("keydown",C)}},[f]);const _=E.useCallback(async()=>{const U=await dj(b.current||void 0,x.current||void 0);return n(U),U},[]);if(E.useEffect(()=>{let U=!0;const C=()=>{_().catch(()=>{U&&n(O=>O)})};C();const M=window.setInterval(C,xbe);return()=>{U=!1,window.clearInterval(M)}},[_]),E.useEffect(()=>{if(r!=="submitting")return;const U=window.setInterval(()=>{_().then(C=>{const M=b.current;if(M&&Nbe(C.currentVersion,M)||!M&&!C.available&&C.latestVersion){window.clearInterval(U),$p(),s("published"),c("Studio 已更新,刷新页面即可使用新版本");return}if(C.state==="error"){window.clearInterval(U),$p(),s("error"),c(C.message||"Studio 更新失败");return}Date.now()-x.current>vbe&&(window.clearInterval(U),$p(),s("error"),c("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},wbe);return()=>window.clearInterval(U)},[r,_]),E.useEffect(()=>{r!=="idle"||(t==null?void 0:t.state)!=="updating"||(b.current=t.targetVersion,x.current=t.startedAt||Date.now(),l1(t.targetVersion,x.current),d(t.targetVersion),s("submitting"))},[r,t]),E.useEffect(()=>{if(r!=="submitting"){w(0);return}const U=()=>{const M=x.current||Date.now();w(Math.max(0,Math.floor((Date.now()-M)/1e3)))};U();const C=window.setInterval(U,1e3);return()=>window.clearInterval(C)},[r]),!(t!=null&&t.enabled)||!(t.available||t.state==="updating"||r!=="idle"))return null;const N=t.releases??[],T=u||((Y=N[0])==null?void 0:Y.version)||t.latestVersion,S=N.find(U=>U.version===T),R=async()=>{b.current=T,x.current=Date.now(),l1(T,x.current),s("submitting"),c(""),m("idle");try{const U=await fj(T);b.current=U.version,l1(U.version,x.current),c("更新已提交,正在等待 VeFaaS 发布新版本")}catch(U){if(U instanceof TypeError){c("连接已切换,正在确认新版本状态");return}$p(),s("error");const C=U instanceof Error?U.message:"Studio 更新失败";try{const M=await _();c(M.message||C)}catch{c(C)}}},I=(L=t.updateLogs)!=null&&L.length?t.updateLogs:(t.errorLog||t.progressMessage||l).split(` `).filter(Boolean),j=async()=>{try{await navigator.clipboard.writeText(I.join(` -`)),m("copied")}catch{m("error")}},F=()=>{var U;h(!1),m("idle"),c(""),d(b.current||((U=N[0])==null?void 0:U.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var U;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((U=N[0])==null?void 0:U.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(vI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(Ea,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(vI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:wbe[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(_I,{lines:I,phase:"error",copyState:p,onCopy:()=>void j()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":vbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:wI.map((U,C)=>{const M=wI.findIndex(A=>A.id===t.progressStage),O=r==="published"||Cvoid j()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(U=>!U),onKeyDown:U=>{(U.key==="ArrowDown"||U.key==="ArrowUp")&&(U.preventDefault(),h(!0))},children:[o.jsx("span",{children:T}),o.jsx(Nbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(U=>{const C=U.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d(U.version),h(!1)},children:[o.jsx("span",{children:U.version}),C&&o.jsx(Sbe,{})]},U.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map(U=>o.jsx("li",{children:U},U))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:F,children:"重新尝试"})]})]})})]})}const Abe="/web/skill-creator";class ok extends Error{constructor(n,r){super(n);Pk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function Al(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function An(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function _B(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Oh(e,t){return fetch(Hi(`${Abe}${e}`),{...t,headers:p0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function lk(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=Al(await e.json(),"错误响应");return An(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ck(e,t){if(!e.ok)throw new ok(await lk(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Cbe(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 Ibe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Rbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=Al(t,`文件 ${n+1}`),s=An(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=_B(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Obe(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 Lbe(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=Al(t,`活动 ${n+1}`),s=An(r,"id"),i=An(r,"kind"),a=An(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=An(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 l=An(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function Mbe(e,t){const n=Al(e,`候选方案 ${t+1}`),r=An(n,"id","candidate_id","candidateId"),s=An(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:An(n,"modelLabel","model_label")??s,status:Cbe(n.status),stage:Ibe(n.stage),name:An(n,"name","skill_name","skillName"),description:An(n,"description"),skillMd:An(n,"skillMd","skill_md"),files:Rbe(n.files),activities:Lbe(n.activities),validation:Obe(n.validation),durationMs:_B(n,"elapsedMs","elapsed_ms"),error:An(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:An(n,"skill_id","skillId"),version:An(n,"version")}}function Ux(e,t=""){const n=Al(e,"Skill 创建任务"),r=An(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Mbe):[],i=An(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:An(n,"prompt")??t,status:i,candidates:s}}async function jbe(e,t){const n=await Oh("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ok(await lk(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Ux(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="",l;const c=u=>{if(!u.trim())return;const d=Al(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(An(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Ux(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Dbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`);return Ux(await ck(t,"读取 Skill 任务失败"))}async function Pbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ck(t,"清理 Skill 任务失败")}async function Bbe(e,t){var l;const n=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await lk(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 Fbe(e,t,n){const r=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=Al(await ck(r,"添加到 AgentKit 失败"),"发布结果"),i=An(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:An(s,"name"),version:An(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:An(s,"message")}}const Ube=()=>{};function $be(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 Hbe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map($be),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(H_,{blocks:t,onAction:Ube})})}const kI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},NI=12e4;function zbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Vbe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function Kbe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Ybe({candidate:e}){var c,u;const[t,n]=E.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,NI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>NI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function Wbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),T=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",j=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(zbe,{status:n.status})}),R?o.jsx(Ea,{duration:2.2,spread:16,children:kI[n.stage]}):o.jsx("span",{children:kI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Hbe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var F;return(F=S.current)==null?void 0:F.focus()})},children:[o.jsx(Vbe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var F;return(F=T.current)==null?void 0:F.focus()})},children:[o.jsx(Kbe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(j==null?void 0:j.valid)===!1?"is-invalid":"is-valid",children:(j==null?void 0:j.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,j&&(j.errors.length>0||j.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...j.errors,...j.warnings].map((F,Y)=>o.jsx("div",{children:F},`${F}-${Y}`))]}):null,o.jsx(Ybe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Bbe(t,n.id).catch(F=>{w(F instanceof Error?F.message:String(F))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:F=>{F.preventDefault();const Y=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:Y,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:F=>b(F.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:F=>_(F.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:F=>N(F.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const SI=new Set(["completed"]),Hp=1100,Gbe=3e4;function qbe(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 Xbe({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(SI.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Gbe,_=async()=>{try{const k=await Dbe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),SI.has(k.status)||(b=window.setTimeout(_,Hp)))}catch(k){if(!y){const N=k instanceof ok?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=z_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??qbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await Fbe(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(Wbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const c1="/web/sandbox/sessions",Qbe=33e4,Zbe=6e5,Jbe=15e3;function u1(e){const t=p0(e);return t.set("Accept","application/json"),t}async function d1(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 e1e(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 f1={async startSession(e={}){const t=await fetch(Hi(c1),{method:"POST",headers:u1({"Content-Type":"application/json"}),signal:bi(e.signal,Qbe)});if(!t.ok)throw await d1(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(Hi(`${c1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:u1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:bi(t.signal,Zbe)});if(!n.ok)throw await d1(n,"沙箱对话失败,请稍后重试。");return e1e(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Hi(`${c1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:u1(),signal:bi(t.signal,Jbe)});if(!n.ok&&n.status!==404)throw await d1(n,"无法清理 AgentKit 沙箱会话。")}},t1e=1e4;async function kB(e){const t=await fetch(Hi(e),{headers:p0({Accept:"application/json"}),signal:bi(void 0,t1e)});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 n1e(){return kB("/web/sandbox/capabilities")}async function r1e(){return kB("/web/skill-creator/capabilities")}function s1e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 i1e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return vs.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(s1e,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function a1e({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function o1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 l1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function c1e(e){return e.toLowerCase()==="github"?o.jsx(tV,{className:"icon"}):o.jsx(oV,{className:"icon"})}function u1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),UM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=CV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(Ea,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>RV(m.loginUrl),children:[c1e(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Hd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function d1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?vs.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(u0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function f1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}Tl("Button",f1e);function h1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Tl("Card",h1e);const p1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},m1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function NB(e){return p1e[e]??"flex-start"}function SB(e){return m1e[e]??"stretch"}function g1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:NB(e.justify),alignItems:SB(e.align)},children:n.map(r=>t.render(r))})}Tl("Column",g1e);function y1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Tl("Divider",y1e);const b1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function E1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:b1e[t]??"•"})}Tl("Icon",E1e);function x1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:NB(e.justify),alignItems:SB(e.align??"center")},children:n.map(r=>t.render(r))})}Tl("Row",x1e);const w1e=new Set(["h1","h2","h3","h4","h5"]);function v1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=w1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Tl("Text",v1e);async function zp(e){const[t,n,r]=await Promise.allSettled([n1e(),r1e(),Lv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const _1e="创建 Agent",k1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Ri={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},N1e=new Set,S1e=[];function ta(){return{skills:[]}}function $o(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function h1(e){return`${$o(e)}.active`}function $x(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function T1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($o(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function A1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($x(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Hx(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Hx(n,t);if(r)return r}}function TB(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(...TB(n)));return t}function TI(){const e=typeof localStorage<"u"?localStorage.getItem(Ri.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function C1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 I1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function AB(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 R1e(e){if(!e)return"";const t=[];return e.ts&&t.push(AB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function AI(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const O1e="send_a2ui_json_to_client";function L1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===O1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?Y6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function M1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function j1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function D1e(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 CI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(Gs,{className:"icon"}):o.jsx(d0,{className:"icon"})})}function P1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function B1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx($t,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(CM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(u0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(TE,{className:"global-deploy-task-icon"}):o.jsx(aV,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(yv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:P1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Dg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const II=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],RI=()=>II[Math.floor(Math.random()*II.length)];function p1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function F1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function U1e(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 zx(e){return e.flatMap(t=>t.apps.map(n=>bo(t.id,n)))}function $1e(e,t){var n;return((n=e.find(r=>r.runtimeId&&r.apps.some(s=>bo(r.id,s)===t)))==null?void 0:n.runtimeId)??""}function H1e(e,t,n){return e?t.includes(e)||zx(n).includes(e):!1}function z1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[T,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[j,F]=E.useState({}),Y=a?j[a]??[]:f,L=p?g:Y,U=(B,V)=>F(re=>({...re,[B]:typeof V=="function"?V(re[B]??[]):V})),[C,M]=E.useState(""),[O,D]=E.useState("agent"),[A,H]=E.useState(null),[W,P]=E.useState({}),te=E.useRef(new Map),X=W.ready===!0&&W.agentId===n,[ne,ce]=E.useState(null),[J,fe]=E.useState(!1),ee=E.useRef(0),[Ee,ge]=E.useState([]),[xe,we]=E.useState(ta),[Te,Re]=E.useState(null),[Ye,Le]=E.useState(0),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(null),[ve,ct]=E.useState(!1),[ht,G]=E.useState([]),[Z,he]=E.useState(!1),De=E.useRef(new Set),[qe,nt]=E.useState(()=>new Set),[Vt,Et]=E.useState(()=>new Set),Pt=E.useRef(new Map),Kt=E.useRef(new Map),Nt=(B,V)=>nt(re=>{const me=new Set(re);return V?me.add(B):me.delete(B),me}),rn=B=>{const V=Kt.current.get(B);V!==void 0&&window.clearTimeout(V),Kt.current.delete(B),Et(re=>new Set(re).add(B))},sn=B=>{const V=Kt.current.get(B);V!==void 0&&window.clearTimeout(V);const re=window.setTimeout(()=>{Kt.current.delete(B),Et(me=>{const Ne=new Set(me);return Ne.delete(B),Ne})},2400);Kt.current.set(B,re)},_t=E.useRef(""),[rt,Oe]=E.useState(""),[gt,Ae]=E.useState(""),pe=E.useRef(null);E.useEffect(()=>()=>{pe.current!==null&&window.clearTimeout(pe.current)},[]);const[Je,at]=E.useState(()=>new Set),[dn,an]=E.useState(!1),[pt,Lt]=E.useState(!1),on=E.useRef(null),On=E.useCallback(()=>Lt(!1),[]),[lr,fn]=E.useState(RI),[Bt,Kn]=E.useState(null),[ue,Se]=E.useState(!1),[Ce,Qe]=E.useState(!1),[ot,et]=E.useState(""),Ct=E.useRef(!1),[Yt,oe]=E.useState(null),[be,ft]=E.useState(""),[Ve,Ke]=E.useState(),[dt,Wt]=E.useState(null),[cr,Yn]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[hn,Ln]=E.useState("cloud"),[Gt,Jt]=E.useState(Rf),[Ot,kn]=E.useState(""),[Nn,en]=E.useState("chat"),[tr,Wn]=E.useState(!1),[pr,nr]=E.useState(!1),[Si,Xs]=E.useState(!1),[Zr,Ar]=E.useState({}),[Ts,Qs]=E.useState({}),[ka,Ur]=E.useState({}),wo=qe.has(a),Na=Vt.has(a),Zs=wo||u,Cl=!!a&&ve,Js=p?y:Zs,Il=Js||!p&&Na,vo=Zr[a]??"",_o=Ts[a]??N1e,Sa=ka[a]??S1e,mr=Te==null?void 0:Te.graph,ko=[Te==null?void 0:Te.name,mr==null?void 0:mr.name,mr==null?void 0:mr.id].filter(B=>!!B),No=xe.targetAgent&&mr?Hx(mr,xe.targetAgent.name):mr,Rl=(No==null?void 0:No.skills)??(xe.targetAgent?[]:(Te==null?void 0:Te.skills)??[]),ju=mr?TB(mr):[];function As(B){p1(B);for(const V of B)V.status==="uploading"?De.current.add(V.id):V.uri&&om(n,V.uri).catch(re=>Oe(String(re)))}function Cs(){ee.current+=1;const B=ne;ce(null),fe(!1),B&&!B.id.startsWith("pending-")&&Pbe(B.id).catch(V=>{Oe(V instanceof Error?V.message:String(V))})}async function Ta(B){try{await OE(n,be,B),await RE(n,be,B),i(V=>V.filter(re=>re.id!==B)),F(V=>{const{[B]:re,...me}=V;return me})}catch(V){Oe(String(V))}}function Ol(B){const V=Ee.find(Ne=>Ne.id===B);if(!V)return;const re=Ee.filter(Ne=>Ne.id!==B);p1([V]),V.status==="uploading"&&De.current.add(B),ge(re),re.length===0&&!C.trim()&&!!a&&L.length===0?(_t.current="",l(""),Ta(a)):V.uri&&om(n,V.uri).catch(Ne=>Oe(String(Ne)))}const So=(B,V)=>{var Be,ut,$e,Ge,tt;const re=V.author&&V.author!=="user"?V.author:void 0;re&&(Ar(_e=>({..._e,[B]:re})),Qs(_e=>({..._e,[B]:new Set(_e[B]??[]).add(re)})),Ur(_e=>{var st;return(st=_e[B])!=null&&st.length?_e:{..._e,[B]:[re]}}));const me=((Be=V.actions)==null?void 0:Be.transferToAgent)??((ut=V.actions)==null?void 0:ut.transfer_to_agent);me&&Ur(_e=>{const st=_e[B]??[];return st[st.length-1]===me?_e:{..._e,[B]:[...st,me]}}),((($e=V.actions)==null?void 0:$e.endOfAgent)??((Ge=V.actions)==null?void 0:Ge.end_of_agent)??((tt=V.actions)==null?void 0:tt.escalate))&&Ur(_e=>{const st=_e[B]??[];return st.length<=1?_e:{..._e,[B]:st.slice(0,-1)}})},[ei,xt]=E.useState(TI),[z,se]=E.useState([]),ye=E.useCallback(B=>{se(V=>{const re=V.findIndex(Ne=>Ne.id===B.id);if(re===-1)return[B,...V];const me=[...V];return me[re]={...me[re],...B},me})},[]),Ue=E.useCallback(async B=>{try{await oj(B.id),se(V=>V.map(re=>re.id===B.id?{...re,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:re))}catch(V){const re=V instanceof Error?V.message:String(V);se(me=>me.map(Ne=>Ne.id===B.id?{...Ne,message:`取消失败:${re}`}:Ne))}},[]),[It,Qt]=E.useState(!0),[Sn,Mn]=E.useState(!1),[Ft,qt]=E.useState(!1),[q,ae]=E.useState(!1),[Fe,We]=E.useState(null),[pn,ln]=E.useState([]),[jn,$n]=E.useState([]),[jt,Xt]=E.useState(""),Ut=E.useRef(null),[ur,mn]=E.useState(!1),[qi,cn]=E.useState(!1),[uk,sy]=E.useState(""),[CB,IB]=E.useState("good"),[RB,Du]=E.useState("basic"),[OB,LB]=E.useState("good"),[Lh,Mh]=E.useState(""),[ti,wr]=E.useState(!1),iy=E.useRef(null),[Xi,Ll]=E.useState(()=>{const B=Ls();return vu(B),B}),[MB,dk]=E.useState(!1),[jB,fk]=E.useState(""),[hk,jh]=E.useState(null),[DB,pk]=E.useState({}),[PB,mk]=E.useState(()=>new Set),[Ml,Ti]=E.useState(null),[Dh,ay]=E.useState("cn-beijing"),[gk,$r]=E.useState(""),[oy,Cr]=E.useState(""),[Ht,us]=E.useState(null),[BB,Ph]=E.useState(!1),ly=E.useRef(!1),Bh=E.useRef(!1),Fh=E.useRef(!1),FB=E.useCallback((B,V,re)=>{!B||!be||ln(me=>{const Be=[{id:B,draft:V,updatedAt:Date.now(),deploymentTarget:re},...me.filter(ut=>ut.id!==B)];return localStorage.setItem($o(be),JSON.stringify(Be)),Be})},[be]),cy=E.useCallback(B=>{!B||!be||ln(V=>{const re=V.filter(me=>me.id!==B);return localStorage.setItem($o(be),JSON.stringify(re)),re})},[be]),UB=E.useCallback(B=>{if(!be||B.length===0)return;const V=new Set(B.map(re=>re.id));ln(re=>{const me=re.filter(Ne=>!V.has(Ne.id));return localStorage.setItem($o(be),JSON.stringify(me)),me}),V.has(jt)&&(Xt(""),We(null),Ti(null),Ut.current=null,localStorage.removeItem(h1(be)))},[jt,be]),yk=E.useCallback(B=>{if(!B||!be)return;const V=Ut.current;ln(re=>{const me=re.filter(Be=>Be.id!==B),Ne=(V==null?void 0:V.id)===B?[V,...me]:me;return localStorage.setItem($o(be),JSON.stringify(Ne)),Ne})},[be]);E.useEffect(()=>{if(!be){ln([]),$n([]),Xt(""),Ut.current=null;return}const B=T1e(be);ln(B),$n(A1e(be));const V=localStorage.getItem(h1(be))||"",re=B.find(me=>me.id===V);Ut.current=re??null,ei==="custom"&&re&&(Xt(re.id),We(re.draft),Ti(re.deploymentTarget??null))},[be]),E.useEffect(()=>{if(!be)return;const B=h1(be);ei==="custom"&&jt?localStorage.setItem(B,jt):localStorage.removeItem(B)},[ei,jt,be]);const $B=E.useCallback(B=>{if(!be)return;const V=[...new Set(B.filter(Boolean))];$n(V),localStorage.setItem($x(be),JSON.stringify(V))},[be]),HB=E.useCallback(async B=>{const V=B.filter(Ge=>!!Ge.runtimeId&&Ge.canDelete===!0);if(V.length===0)return;const re=$1e(Xi,n),me=new Set(V.map(Ge=>Ge.runtimeId));mk(Ge=>{const tt=new Set(Ge);for(const _e of me)tt.add(_e);return tt}),PC(me);const Ne=new Set,Be=new Set,ut=new Set,$e=[];for(const Ge of V)try{if(!Ge.region)throw new Error("Runtime 缺少地域信息,无法删除");await pj(Ge.runtimeId,Ge.region),lg(Ge.runtimeId),Ne.add(Ge.runtimeId),Be.add(Ge.id)}catch(tt){const _e=tt instanceof Error?tt.message:String(tt);ut.add(Ge.runtimeId),$e.push(`${Ge.label}: ${_e}`)}if(Ne.size>0&&(PC(Ne),Ll(Ls()),jh(tt=>{if(!tt)return tt;const _e=new Set(tt);for(const st of Ne)_e.delete(st);return _e}),pk(tt=>Object.fromEntries(Object.entries(tt).filter(([_e])=>!Ne.has(_e)))),$n(tt=>{const _e=tt.filter(st=>!Be.has(st));return be&&localStorage.setItem($x(be),JSON.stringify(_e)),_e}),ln(tt=>{const _e=tt.filter(st=>{var zt;return!((zt=st.deploymentTarget)!=null&&zt.runtimeId)||!Ne.has(st.deploymentTarget.runtimeId)});return be&&localStorage.setItem($o(be),JSON.stringify(_e)),_e}),(re?Ne.has(re):V.some(tt=>tt.id===n))&&(vk(),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe("")),Ht!=null&&Ht.runtime&&Ne.has(Ht.runtime.runtimeId)&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe(""))),ut.size>0&&mk(Ge=>{const tt=new Set(Ge);for(const _e of ut)tt.delete(_e);return tt}),$e.length>0){const Ge=$e.slice(0,3).join(";"),tt=$e.length>3?`;另有 ${$e.length-3} 个失败`:"";throw new Error(`${$e.length} 个 Agent 删除失败:${Ge}${tt}`)}},[Ht,n,Xi,be]),uy=E.useCallback(async()=>{dk(!0),fk("");try{const B=[];let V="";do{const re=await Cc({scope:"mine",region:"all",pageSize:100,nextToken:V});B.push(...re.runtimes),V=re.nextToken}while(V&&B.length<2e3);jh(new Set(B.map(re=>re.runtimeId))),pk(Object.fromEntries(B.map(re=>[re.runtimeId,{canDelete:re.canDelete}])))}catch(B){fk(B instanceof Error?B.message:String(B))}finally{dk(!1)}},[]);function Uh(B){console.log("create agent draft:",B),xt(null),Ca()}function dy(B,V){console.log("Agent added, navigating to:",B,V),Ll(Ls()),jh(null),cy(jt),Xt(""),Ut.current=null,Ti(null),$r(""),Cr(B),Du("basic"),xt(null),cn(!0),r(B)}const bk=E.useCallback(B=>{xt(null),ae(!1),us(null),cn(!0),Cr(""),Du("basic"),$r(B.id),Oe("")},[]),Ek=E.useCallback(async B=>{if(!B.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const V=(Ml==null?void 0:Ml.region)??Dh,re=await og(B.runtimeId,B.agentName,B.region??V,B.version);Ll(Ls()),Le(Ne=>Ne+1);const me=await zp(re);te.current.set(re,me),P(me),jh(Ne=>{const Be=new Set(Ne??[]);return Be.add(B.runtimeId),Be}),Ti(null),cy(jt),Xt(""),Ut.current=null,Cr(re),Du("basic"),xt(null),cn(!0),r(re)},[jt,Dh,cy,Ml]),Pu=E.useRef(null),fy=E.useRef(new Map),To=E.useRef(!0),Aa=E.useRef(!1),Ao=E.useRef(null),xk=E.useRef({key:"",turnCount:0}),hy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const B=Pu.current,V=xk.current,re=V.key!==hy,me=!re&&L.length>V.turnCount;if(xk.current={key:hy,turnCount:L.length},!B||L.length===0||!re&&!me)return;To.current=!0,Aa.current=!1,Ao.current!==null&&(window.clearTimeout(Ao.current),Ao.current=null);const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(re||Ne){B.scrollTop=B.scrollHeight;return}Aa.current=!0,B.scrollTo({top:B.scrollHeight,behavior:"smooth"}),Ao.current=window.setTimeout(()=>{Aa.current=!1,Ao.current=null},450)},[hy,L.length]),E.useLayoutEffect(()=>{const B=Pu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[Js,L]),E.useEffect(()=>{if(!Lh||qi||L.length===0)return;const B=fy.current.get(Lh);if(!B)return;To.current=!1,B.scrollIntoView({behavior:"smooth",block:"center"});const V=window.setTimeout(()=>{Mh("")},2600);return()=>window.clearTimeout(V)},[Lh,qi,L]),E.useEffect(()=>()=>{Ao.current!==null&&window.clearTimeout(Ao.current)},[]);const zB=E.useCallback(()=>{const B=Pu.current;!B||Aa.current||(To.current=B.scrollHeight-B.scrollTop-B.clientHeight<32)},[]),VB=E.useCallback(B=>{B.deltaY<0&&(Aa.current=!1,To.current=!1)},[]),KB=E.useCallback(()=>{Aa.current=!1,To.current=!1},[]),YB=E.useCallback(()=>{const B=Pu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[]),py=E.useCallback(()=>{oe(null),AE().then(B=>{ft(B.userId),Ke(B.info),nr(!!B.local),Kn(B.status),B.status==="authenticated"&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),wr(!0))}).catch(B=>{oe(B instanceof Error?B.message:String(B))})},[]);E.useEffect(()=>{py()},[py]),E.useEffect(()=>{const B=()=>{et(""),Se(!0)};return window.addEventListener(CE,B),FV()&&B(),()=>window.removeEventListener(CE,B)},[]);const WB=E.useCallback(async()=>{if(Ct.current)return;Ct.current=!0;const B=OV();if(!B){Ct.current=!1,et("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),et("");try{for(;;){await new Promise(V=>window.setTimeout(V,1e3));try{const V=await AE();if(V.status==="authenticated"){ft(V.userId),Ke(V.info),nr(!!V.local),Kn(V.status),Se(!1),UV(),B.close();return}}catch{}if(B.closed){et("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{Ct.current=!1,Qe(!1)}},[]);E.useEffect(()=>{pr&&be&&mT(be)},[pr,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be||!n){P({});return}const B=te.current.get(n);if(B){P(B);return}let V=!1;return P({}),zp(n).then(re=>{V||(te.current.set(n,re),P(re))}),()=>{V=!0}},[n,Bt,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be){Wt(null);return}let B=!1;return Wt(null),uj().then(V=>{B||Wt(V)}).catch(V=>{console.warn("[app] /web/access failed; using ordinary-user access:",V),B||Wt(cj)}),()=>{B=!0}},[Bt,be]),E.useEffect(()=>{lj().then(B=>{Yn(B.features),Ln(B.agentsSource),Jt(B.branding),kn(B.version),en(B.defaultView),Wn(!0)})},[]),E.useEffect(()=>{!dt||!tr||Bh.current||ti||(Bh.current=!0,Nn==="addAgent"&&dt.capabilities.createAgents&&(xt(null),Mn(!1),mn(!1),cn(!1),qt(!1),ae(!0)))},[dt,Nn,ti,tr]),E.useEffect(()=>{dt&&(dt.capabilities.createAgents||(xt(null),We(null),qt(!1),ae(!1),se([])),dt.capabilities.manageAgents||cn(!1))},[dt]),E.useEffect(()=>{Bt!=="authenticated"||hn!=="cloud"||!tr||!qi||Ht||uy()},[Ht,hn,Bt,qi,uy,tr]),E.useEffect(()=>{document.title=Gt.title;let B=document.querySelector('link[rel~="icon"]');B||(B=document.createElement("link"),B.rel="icon",document.head.appendChild(B)),B.removeAttribute("type"),B.href=Gt.logoUrl||Bv},[Gt]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(B=>B.ok?B.json():null).then(B=>{B&&Qt(!!B.credentials)}).catch(B=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",B)})},[]);function GB(B){mT(B),ly.current=!0,Bh.current=!1,Wt(null),xt(null),We(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),Ca(),wr(!0),ft(B),Ke({name:B}),nr(!0),Kn("authenticated")}function qB(){Bh.current=!1,Wt(null),pr?(IV(),ft(""),Ke(void 0),Kn("unauthenticated")):MV()}E.useEffect(()=>{if(Bt==="authenticated"){if(hn==="cloud"){const B=localStorage.getItem(Ri.app),V=zx(Xi);r(re=>re&&V.includes(re)?re:re?(Fh.current=!0,localStorage.removeItem(Ri.app),""):Fh.current?"":B&&V.includes(B)?B:"");return}VM().then(B=>{t(B);const V=localStorage.getItem(Ri.app),re=zx(Xi),me=V&&(B.includes(V)||re.includes(V)),Ne=["web_search_agent","web_demo"].find(Be=>B.includes(Be))??B.find(Be=>!/^\d/.test(Be))??B[0];r(me?V:Ne||"")}).catch(B=>Oe(String(B)))}},[Bt,hn,Xi]),E.useEffect(()=>{n?(Fh.current=!1,localStorage.setItem(Ri.app,n)):localStorage.removeItem(Ri.app)},[n]),E.useEffect(()=>{let B=!1;if(le(null),G([]),ti||Ht||!n||!be||!a){ct(!1);return}return ct(!0),LE(n,be,a).then(V=>{B||(le(V),Lv(n).then(re=>{B||G(re)}).catch(()=>{B||G([])}))}).catch(()=>{B||le(null)}).finally(()=>{B||ct(!1)}),()=>{B=!0}},[Ht,n,ti,be,a]),E.useEffect(()=>{let B=!1;if(Re(null),we(ta()),Bt!=="authenticated"||ti||Ht||!n){Ze(!1);return}return Ze(!0),Mv(n).then(V=>{B||Re(V)}).catch(()=>{B||Re(null)}).finally(()=>{B||Ze(!1)}),()=>{B=!0}},[Ht,n,Ye,Bt,ti]),E.useEffect(()=>{dt&&localStorage.setItem(Ri.view,dt.capabilities.createAgents?ei??"chat":"chat")},[dt,ei]),E.useEffect(()=>{localStorage.setItem(Ri.session,a),_t.current=a},[a]),E.useEffect(()=>()=>Pt.current.forEach(B=>B.abort()),[]),E.useEffect(()=>()=>Kt.current.forEach(B=>{window.clearTimeout(B)}),[]),E.useEffect(()=>()=>{var B,V;(B=R.current)==null||B.abort(),(V=I.current)==null||V.abort()},[]),E.useEffect(()=>{if(ti||Ht||p||!n||!be)return;let B=!1;return(async()=>{const V=await $h(n);if(!B){if(!ly.current){ly.current=!0;const re=localStorage.getItem(Ri.session)||"";if(TI()===null&&re&&V.some(me=>me.id===re)){Bu(re);return}}Ca()}})(),()=>{B=!0}},[Ht,n,ti,p,be]),E.useEffect(()=>{const B=iy.current;B&&B.app===n&&(iy.current=null,Bu(B.sid))},[n]);function XB(B,V){mn(!1),B===n?Bu(V):(iy.current={app:B,sid:V},r(B))}async function $h(B){try{const V=await Iv(B,be),re=await Promise.all(V.map(me=>{var Ne;return(Ne=me.events)!=null&&Ne.length?Promise.resolve(me):ig(B,be,me.id)}));return i(re),re}catch(V){return Oe(String(V)),[]}}function wk(){p||(Oe(""),S(""),N("confirm"),_(!0))}function QB(){var B;(B=R.current)==null||B.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&O==="temporary"&&D("agent")}async function ZB(){var V;(V=R.current)==null||V.abort();const B=new AbortController;R.current=B,N("loading"),S("");try{const re=await f1.startSession({signal:B.signal});if(R.current!==B)return;_t.current="",l(""),h([]),M(""),we(ta()),D("temporary"),Cs(),fe(!1),As(Ee),ge([]),w([]),m(re),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),_(!1),N("confirm")}catch(re){if((re==null?void 0:re.name)==="AbortError"||R.current!==B)return;S(re instanceof Error?re.message:String(re)),N("error")}finally{R.current===B&&(R.current=null)}}function Co(){var V;(V=I.current)==null||V.abort(),I.current=null,b(!1),w([]),M(""),Oe(""),D("agent");const B=p;m(null),B&&f1.closeSession(B.id).catch(re=>Oe(String(re)))}async function JB(B){var Ne;const V=p;if(!V||y||!B.trim())return;Oe("");const re=new AbortController;(Ne=I.current)==null||Ne.abort(),I.current=re;const me=[{role:"user",blocks:[{kind:"text",text:B}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Be=>[...Be,...me]),b(!0);try{const Be=await f1.sendMessage({sessionId:V.id,text:B},{signal:re.signal,onBlocks:ut=>{I.current===re&&w($e=>{const Ge=$e.slice(),tt=Ge[Ge.length-1];return(tt==null?void 0:tt.role)==="assistant"&&(Ge[Ge.length-1]={...tt,blocks:ut}),Ge})}});if(I.current!==re)return;w(ut=>{const $e=ut.slice(),Ge=$e[$e.length-1];return(Ge==null?void 0:Ge.role)==="assistant"&&($e[$e.length-1]={...Ge,blocks:Be.blocks,meta:{ts:Date.now()/1e3}}),$e})}catch(Be){if((Be==null?void 0:Be.name)==="AbortError"||I.current!==re)return;w(ut=>ut.slice(0,-2)),M(B),Oe(`内置智能体发送失败:${Be instanceof Error?Be.message:String(Be)}`)}finally{I.current===re&&(I.current=null,b(!1))}}function Ca(){Co(),Oe(""),Lt(!1),fn(RI()),D("agent"),H(null),Cs(),fe(!1);const B=a&&Y.length===0&&Ee.length>0?a:"";_t.current="",l(""),le(null),G([]),d(!1),h([]),we(ta()),As(Ee),ge([]),B&&Ta(B)}function vk(){var B;Fh.current=!0,localStorage.removeItem(Ri.app),a&&((B=Pt.current.get(a))==null||B.abort()),c.current=null,Ca(),r(""),P({}),Re(null)}function e8(B){pe.current!==null&&window.clearTimeout(pe.current),Ae(B),pe.current=window.setTimeout(()=>{Ae(""),pe.current=null},3e3)}function t8(){if(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),!p&&!H1e(n,e,Xi)){n&&vk(),wr(!0),e8("请先选择 agent");return}wr(!1),Ca()}async function n8(B){var V;try{(V=Pt.current.get(B))==null||V.abort(),await OE(n,be,B),await RE(n,be,B);const re=Kt.current.get(B);re!==void 0&&window.clearTimeout(re),Kt.current.delete(B),Et(me=>{if(!me.has(B))return me;const Ne=new Set(me);return Ne.delete(B),Ne}),F(me=>{const{[B]:Ne,...Be}=me;return Be}),B===a&&Ca(),await $h(n)}catch(re){Oe(String(re))}}async function Bu(B){if(p&&Co(),B!==a&&(_t.current=B,Oe(""),d(!1),h([]),D("agent"),H(null),Cs(),we(ta()),le(null),G([]),l(B),j[B]===void 0)){Xs(!0);try{const V=await ig(n,be,B);U(B,pK(V.events??[],V.state))}catch(V){Oe(String(V))}finally{Xs(!1)}}}async function r8(B){if(!B.sessionId||!B.messageId){Oe("这条案例缺少会话定位信息,无法跳转。");return}mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),cn(!1),sy(n),IB(B.kind),Mh(B.messageId),await Bu(B.sessionId)}function s8(){const B=uk||n;mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),$r(""),Cr(B),Du("evaluations"),LB(CB),cn(!0),sy(""),Mh("")}function i8(B){const V=new Map,re=new Map;for(const me of B){if(!me.sessionId||!me.messageId)continue;const Ne=V.get(me.sessionId)??new Set;if(Ne.add(me.messageId),V.set(me.sessionId,Ne),me.runtimeId&&me.userId){const Be=[me.runtimeId,n,me.userId,me.sessionId].join(":"),ut=re.get(Be)??{runtimeId:me.runtimeId,appName:n,userId:me.userId,sessionId:me.sessionId,eventIds:new Set};ut.eventIds.add(me.messageId),re.set(Be,ut)}}if(V.size!==0){F(me=>{const Ne={...me};for(const[Be,ut]of V){const $e=Ne[Be];$e&&(Ne[Be]=$e.map(Ge=>{var tt;return(tt=Ge.meta)!=null&&tt.eventId&&ut.has(Ge.meta.eventId)?{...Ge,meta:{...Ge.meta,feedback:void 0}}:Ge}))}return Ne}),i(me=>me.map(Ne=>{const Be=V.get(Ne.id);if(!Be||!Ne.state)return Ne;const ut={...Ne.state};for(const $e of Be)delete ut[`veadk_feedback:${$e}`];return{...Ne,state:ut}})),at(me=>{const Ne=new Set(me);for(const Be of V.values())for(const ut of Be)Ne.delete(ut);return Ne});for(const me of re.values())$M({runtimeId:me.runtimeId,appName:me.appName,userId:me.userId,sessionId:me.sessionId,eventIds:[...me.eventIds]})}}async function _k(B=!0){if(a)return a;c.current||(c.current=sg(n,be));const V=c.current;try{const re=await V;B&&l(re);const me=Date.now()/1e3,Ne={id:re,lastUpdateTime:me,events:[]};return i(Be=>[Ne,...Be.filter(ut=>ut.id!==re)]),re}finally{c.current===V&&(c.current=null)}}async function kk(B){if(!n||!be||!a||!ze)return!1;he(!0),Oe("");try{const V=await ME(n,be,a,B,ze.revision);return le(V),!0}catch(V){return Oe(String(V)),!1}finally{he(!1)}}async function Nk(B){if(!(!n||!be||!a||!ze)){he(!0),Oe("");try{const V=await rj(n,be,a,B,ze.revision);le(V)}catch(V){Oe(String(V))}finally{he(!1)}}}async function a8(B){Oe("");let V;try{V=await _k()}catch(me){Oe(String(me));return}const re=Array.from(B).map(me=>({file:me,attachment:{id:F1e(),mimeType:U1e(me),name:me.name,sizeBytes:me.size,status:"uploading"}}));ge(me=>[...me,...re.map(Ne=>Ne.attachment)]),await Promise.all(re.map(async({file:me,attachment:Ne})=>{try{const Be=await ZM(n,be,V,me);if(De.current.delete(Ne.id)){Be.uri&&await om(n,Be.uri);return}ge(ut=>ut.map($e=>$e.id===Ne.id?Be:$e))}catch(Be){if(De.current.delete(Ne.id))return;const ut=Be instanceof Error?Be.message:String(Be);ge($e=>$e.map(Ge=>Ge.id===Ne.id?{...Ge,status:"error",error:ut}:Ge)),Oe(ut)}}))}async function Sk(B,V=[],re=ta()){if(!B.trim()&&V.length===0||Zs||Cl||!n||!be)return;Oe("");const me=[];(re.skills.length>0||re.targetAgent)&&me.push({kind:"invocation",value:re}),V.length&&me.push({kind:"attachment",files:V.map(_e=>({id:_e.id,mimeType:_e.mimeType,data:_e.data,uri:_e.uri,name:_e.name,sizeBytes:_e.sizeBytes}))}),B.trim()&&me.push({kind:"text",text:B});const Ne=[{role:"user",blocks:me,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Be=!a;Be&&(h(Ne),d(!0));const ut=A;let $e;try{$e=await _k(!Be)}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(String(_e));return}let Ge=ze!==null;if(ut)try{let _e=await LE(n,be,$e);const st=fge[ut].filter(zt=>{var gr;return(gr=W.builtinTools)==null?void 0:gr.includes(zt)});for(const zt of[...r5[ut],...st])_e.tools.some(gr=>gr.name===zt)||(_e=await ME(n,be,$e,{kind:"tool",name:zt},_e.revision));le(_e),Ge=!0}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(`任务能力挂载失败:${String(_e)}`);return}U($e,_e=>Be?Ne:[..._e,...Ne]),Be&&(_t.current=$e,l($e),h([]),d(!1));const tt=new AbortController;Pt.current.set($e,tt),Nt($e,!0),rn($e),_t.current=$e,Ar(_e=>({..._e,[$e]:""})),Qs(_e=>({..._e,[$e]:new Set})),Ur(_e=>({..._e,[$e]:[]}));try{let _e=hi(),st="",zt=0,gr=Date.now()/1e3,Ia="",Ra="";for await(const Hn of If({appName:n,userId:be,sessionId:$e,text:B,attachments:V,invocation:re,signal:tt.signal,sessionCapabilities:Ge})){if(tt.signal.aborted)break;const Zi=Hn.error??Hn.errorMessage??Hn.error_message;if(typeof Zi=="string"&&Zi){_t.current===$e&&Oe(Zi);break}So($e,Hn);const rr=Hn.author&&Hn.author!=="user"?Hn.author:"";rr&&rr!==st&&(st=rr,_e=hi()),_e=qc(_e,Hn);const Gn=Hn.usageMetadata??Hn.usage_metadata;Gn!=null&&Gn.totalTokenCount&&(zt=Gn.totalTokenCount),Hn.timestamp&&(gr=Hn.timestamp),Hn.id&&(Ia=Hn.id);const Jr=Hn.invocationId??Hn.invocation_id;Jr&&(Ra=Jr);const Ai=_e.blocks,ds={author:st||void 0,tokens:zt||void 0,ts:gr,eventId:Ia||void 0,invocationId:Ra||void 0};U($e,gy=>{var zu;const fs=gy.slice(),xn=fs[fs.length-1];return(xn==null?void 0:xn.role)==="assistant"&&(!((zu=xn.meta)!=null&&zu.author)||xn.meta.author===st)?fs[fs.length-1]={...xn,blocks:Ai,meta:ds}:fs.push({role:"assistant",blocks:Ai,meta:ds}),fs})}$h(n)}catch(_e){(_e==null?void 0:_e.name)!=="AbortError"&&!tt.signal.aborted&&_t.current===$e&&Oe(String(_e))}finally{Pt.current.get($e)===tt&&Pt.current.delete($e),Nt($e,!1),sn($e),Ar(_e=>({..._e,[$e]:""})),Ur(_e=>({..._e,[$e]:[]}))}}function o8(B,V){var Ne,Be;const re=((Ne=B==null?void 0:B.event)==null?void 0:Ne.name)??V.id,me=((Be=B==null?void 0:B.event)==null?void 0:Be.context)??{};Sk(`[ui-action] ${re}: ${JSON.stringify(me)}`)}async function l8(B){var Ge,tt,_e;if(!B.authUri)throw new Error("事件中没有授权地址。");if(!n||!be||!a)throw new Error("会话尚未就绪。");const V=a,re=await j1e(B.authUri),me=D1e(B.authConfig,re),Ne=st=>st.map(zt=>zt.kind==="auth"&&!zt.done?{...zt,done:!0}:zt);U(V,st=>{const zt=st.slice(),gr=zt[zt.length-1];return(gr==null?void 0:gr.role)==="assistant"&&(zt[zt.length-1]={...gr,blocks:Ne(gr.blocks)}),zt});const Be=L[L.length-1],ut=Ne(Be&&Be.role==="assistant"?Be.blocks:[]),$e=new AbortController;Pt.current.set(V,$e),Nt(V,!0),rn(V);try{let st=hi(),zt=((Ge=Be==null?void 0:Be.meta)==null?void 0:Ge.author)??"",gr=ut,Ia=0,Ra=Date.now()/1e3,Hn=((tt=Be==null?void 0:Be.meta)==null?void 0:tt.eventId)??"",Zi=((_e=Be==null?void 0:Be.meta)==null?void 0:_e.invocationId)??"";for await(const rr of If({appName:n,userId:be,sessionId:a,text:"",functionResponses:[{id:B.callId,name:"adk_request_credential",response:me}],signal:$e.signal,sessionCapabilities:ze!==null})){if($e.signal.aborted)break;So(V,rr);const Gn=rr.author&&rr.author!=="user"?rr.author:"";Gn&&Gn!==zt&&(zt=Gn,gr=[],st=hi()),st=qc(st,rr);const Jr=rr.usageMetadata??rr.usage_metadata;Jr!=null&&Jr.totalTokenCount&&(Ia=Jr.totalTokenCount),rr.timestamp&&(Ra=rr.timestamp),rr.id&&(Hn=rr.id);const Ai=rr.invocationId??rr.invocation_id;Ai&&(Zi=Ai);const ds=[...gr,...st.blocks];U(V,gy=>{var Ok,Lk,Mk,jk,Dk;const fs=gy.slice(),xn=fs[fs.length-1],zu={author:zt||((Ok=xn==null?void 0:xn.meta)==null?void 0:Ok.author),tokens:Ia||((Lk=xn==null?void 0:xn.meta)==null?void 0:Lk.tokens),ts:Ra,eventId:Hn||((Mk=xn==null?void 0:xn.meta)==null?void 0:Mk.eventId),invocationId:Zi||((jk=xn==null?void 0:xn.meta)==null?void 0:jk.invocationId)};return(xn==null?void 0:xn.role)==="assistant"&&(!((Dk=xn.meta)!=null&&Dk.author)||xn.meta.author===zt)?fs[fs.length-1]={...xn,blocks:ds,meta:zu}:fs.push({role:"assistant",blocks:ds,meta:zu}),fs})}$h(n)}catch(st){(st==null?void 0:st.name)!=="AbortError"&&!$e.signal.aborted&&_t.current===V&&Oe(String(st))}finally{Pt.current.get(V)===$e&&Pt.current.delete(V),Nt(V,!1),sn(V),Ar(st=>({...st,[V]:""})),Ur(st=>({...st,[V]:[]}))}}if(Yt)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Yt}),o.jsx("button",{type:"button",onClick:py,children:"重试"})]});if(Bt===null)return o.jsx("div",{className:"boot"});if(Bt==="unauthenticated")return o.jsx(u1e,{branding:Gt,onUsername:GB});if(!dt)return o.jsx("div",{className:"boot"});const ni=dt.capabilities.createAgents,Tk=dt.capabilities.manageAgents,Is=ni?ei:null,Fu=ni&&q,Uu=ni&&Ft,$u=qi,Ak=Sj(e,Xi),Hu=Ak.filter(B=>B.runtimeId&&(hk===null||hk.has(B.runtimeId))).map(B=>{var V;return{...B,canDelete:B.runtimeId?((V=DB[B.runtimeId])==null?void 0:V.canDelete)===!0:!1}}),c8=(()=>{if(Hu.length===0)return Hu;const B=new Map(jn.map((V,re)=>[V,re]));return[...Hu].sort((V,re)=>{const me=B.get(V.id),Ne=B.get(re.id);return me!=null&&Ne!=null?me-Ne:me!=null?-1:Ne!=null?1:Hu.indexOf(V)-Hu.indexOf(re)})})(),Hh=B=>{var V;return((V=Ak.find(re=>re.id===B))==null?void 0:V.label)??B},Hr=Xi.find(B=>B.runtimeId&&B.apps.some(V=>bo(B.id,V)===n)),jl=Hr&&Hr.runtimeId&&Hr.region?{runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region}:void 0,u8=(jl==null?void 0:jl.runtimeId)??"",Ck=async(B,V)=>{var ut,$e;const re=(ut=B.meta)==null?void 0:ut.eventId,me=a;if(!re||!me||!jl)return;const Ne=($e=B.meta)==null?void 0:$e.feedback,Be={...Ne,rating:V,syncStatus:"syncing",updatedAt:Date.now()/1e3};U(me,Ge=>Ge.map(tt=>{var _e;return((_e=tt.meta)==null?void 0:_e.eventId)===re?{...tt,meta:{...tt.meta,feedback:Be}}:tt})),at(Ge=>new Set(Ge).add(re));try{const Ge=await YM({appName:n,userId:be,sessionId:me,eventId:re,rating:V});U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ge}}:_e})),i(tt=>tt.map(_e=>_e.id===me?{..._e,state:{..._e.state??{},[`veadk_feedback:${re}`]:Ge}}:_e))}catch(Ge){U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ne}}:_e})),_t.current===me&&Oe(Ge instanceof Error?Ge.message:String(Ge))}finally{at(Ge=>{const tt=new Set(Ge);return tt.delete(re),tt})}},zh=async B=>{Ll(Ls());let V=te.current.get(B);V||(V=await zp(B),te.current.set(B,V)),P(V),B===n&&Le(re=>re+1),_t.current="",l(""),wr(!1),r(B)},d8=B=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}wr(!1),cn(!1),ay(B),We(null),xt(null),ae(!0),Oe("")},Ik=async B=>{if(B.runtime)try{const V=await og(B.runtime.runtimeId,B.name,B.runtime.region,B.runtime.currentVersion);Ll(Ls()),Le(me=>me+1);const re=await zp(V);te.current.set(V,re),P(re),us(null),wr(!1),cn(!1),Ca(),r(V)}catch(V){Oe(V instanceof Error?V.message:String(V))}},f8=B=>{B.runtime&&(us(B),$r(""),Cr(""),wr(!1),cn(!0),Oe(""))},Rk=()=>{p&&Co(),_t.current="",l(""),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),wr(!0),Oe("")},h8=B=>{if(sy(""),Mh(""),Ht){Ik(Ht);return}$r(""),Cr(""),cn(!1),zh(B)},p8=B=>($r(""),Cr(B),Du("basic"),zh(B)),my=Ht!=null&&Ht.runtime?Xi.find(B=>{var V;return B.runtimeId===((V=Ht.runtime)==null?void 0:V.runtimeId)}):void 0,Qi=Ht!=null&&Ht.runtime?{id:`detail:${Ht.runtime.runtimeId}`,label:Ht.name,app:Ht.name,remote:!0,runtimeApp:my==null?void 0:my.apps[0],runtimeId:Ht.runtime.runtimeId,region:Ht.runtime.region,currentVersion:Ht.runtime.currentVersion,canDelete:Ht.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(MK,{branding:Gt,access:dt,features:cr,sessions:s,currentSessionId:a,streamingSids:qe,onNewChat:t8,onSearch:()=>{p&&Co(),xt(null),Mn(!1),qt(!1),ae(!1),cn(!1),us(null),wr(!1),mn(!0),Oe("")},onQuickCreate:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",l(""),Mn(!1),qt(!1),mn(!1),cn(!1),us(null),wr(!1),xt(null),We(null),ay("cn-beijing"),ae(!0),Oe("")},onSkillCenter:()=>{p&&Co(),xt(null),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),Mn(!0),Oe("")},onAddAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",xt(null),Mn(!1),mn(!1),cn(!1),us(null),wr(!1),l(""),ae(!1),qt(!0),Oe("")},onMyAgents:Rk,onPickSession:B=>{xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),wr(!1),Oe(""),Bu(B)},onDeleteSession:n8,userInfo:Ve,version:Ot,onLogout:qB}),(()=>{const B=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(a1e,{onExit:Ca}),o.jsx(yge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Hh(n):"Agent",value:C,onChange:M,onSubmit:()=>{if(!p&&O==="skill-create"){const Ne=C.trim();if(!Ne||J)return;const Be={id:`pending-${Date.now()}`,prompt:Ne,status:"provisioning",candidates:z_.map(($e,Ge)=>({id:`pending-${Ge}`,model:$e,modelLabel:$e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};fe(!0);const ut=++ee.current;Oe(""),ce(Be),M(""),jbe(Ne,$e=>{ee.current===ut&&ce($e)}).then($e=>{ee.current===ut&&ce($e)}).catch($e=>{ee.current===ut&&(ce(null),M(Ne),Oe($e instanceof Error?$e.message:String($e)))}).finally(()=>{ee.current===ut&&fe(!1)});return}const V=C;if(M(""),p){JB(V);return}const re=Ee,me=xe;ge([]),we(ta()),Sk(V,re,me),p1(re)},disabled:p?!1:!be||O==="temporary"||O==="agent"&&!n,busy:p?y:O==="skill-create"?J:Zs,showMeta:L.length>0&&!p,attachments:p?[]:Ee,skills:p?[]:Rl,agents:p?[]:ju,invocation:p?ta():xe,capabilitiesLoading:!p&&bt,allowAttachments:!p,onInvocationChange:we,onAddFiles:a8,onRemoveAttachment:Ol,newChatMode:p?"agent":O,newChatTask:p?null:A,newChatLayout:!p&&L.length===0&&ne===null,showModeSelector:!1,temporaryEnabled:X&&W.temporaryEnabled,skillCreateEnabled:X&&W.skillCreateEnabled,harnessEnabled:X&&W.harnessEnabled,builtinTools:X?W.builtinTools:[],onModeChange:V=>{if(!(V==="temporary"&&!W.temporaryEnabled||V==="skill-create"&&!W.skillCreateEnabled)){if(V==="temporary"){H(null),D(V),wk();return}if(D(V),V!=="agent"&&H(null),Oe(""),V==="skill-create"){we(ta());const re=a&&Y.length===0&&Ee.length>0?a:"";As(Ee),ge([]),re&&(_t.current="",l(""),Ta(re))}}},onTaskChange:H})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(qK,{appName:n,onAppChange:$u?p8:zh,agentLabel:Hh,agentsSource:hn,localApps:e,currentRuntime:jl,runtimeScope:dt.capabilities.runtimeScope,onBrowseAgents:Rk,title:p?"Codex 智能体":ti?"智能体":Fu?"添加 Agent":Uu?"添加 AgentKit 智能体":$u?Ht?Ht.name:oy?Hh(oy):"智能体详情":void 0,titleLeading:L.length>0&&!p&&O==="agent"&&!Fu&&!Uu&&!Sn&&!ur&&!$u&&!ti&&Is===null&&n?o.jsx("button",{ref:on,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":pt,onClick:()=>Lt(!0),children:o.jsx(Xc,{})}):void 0,crumbs:Sn?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:ur||Uu||Fu||!Is?void 0:Is==="menu"?[{label:_1e,onClick:()=>{xt(null),We(null),ae(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Ph(!0)},{label:k1e[Is]}],rightContent:o.jsxs(o.Fragment,{children:[dt.role==="admin"&&o.jsx(Tbe,{}),o.jsx(B1e,{tasks:ni?z:[],onCancel:Ue})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[rt&&o.jsx("div",{className:"error",children:rt}),Si&&o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 加载会话…"]}),uk&&!$u&&!Fu&&!Uu&&!ur&&!Sn&&Is===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:s8,children:[o.jsx(gv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),ti?o.jsx(Tme,{onCreateAgent:d8,onCreateCodexAgent:wk,onUseAgent:Ik,onViewAgentDetails:f8,connectedRuntimeId:u8,hiddenRuntimeIds:PB}):$u?o.jsx(pme,{agents:Qi?[Qi]:c8,drafts:pn,agentOrder:jn,selectedAgentId:n,agentInfo:Te,agentInfoAgentId:n,loadingAgentInfo:bt,canCreate:ni,canUpdate:ni||Tk,loadingAgents:MB,agentsError:jB,deploymentTasks:z,focusedDeploymentTaskId:gk,focusedAgentId:(Qi==null?void 0:Qi.id)??oy,focusedAgentSection:RB,focusedCaseKind:OB,detailOnly:!!Qi||!!gk,onRetryAgents:()=>void uy(),onAgentOrderChange:$B,onDeleteAgents:HB,onDeleteDrafts:UB,onSelectAgent:zh,onTalkAgent:h8,onOpenFeedbackCase:V=>void r8(V),onFeedbackCasesDeleted:i8,onCreateAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}cn(!1),ae(!0),xt(null),We(null),Ti(null),ay("cn-beijing"),Xt(""),Ut.current=null,$r(""),Cr(""),Oe("")},onUpdateAgent:V=>{if(!Tk&&!ni){Oe("当前账号没有管理 Agent 的权限。");return}if(!(Hr!=null&&Hr.runtimeId)){Oe("仅支持更新已部署的云端智能体。");return}if(!Hr.region){Oe("Runtime 缺少地域信息,无法更新。");return}cn(!1),We(V);const re=`runtime-${Hr.runtimeId}`;Xt(re),Ut.current=pn.find(me=>me.id===re)??null,$r(""),Cr(""),Ti({runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region,currentVersion:Hr.currentVersion}),xt("custom"),Oe("")},onEditDraft:V=>{cn(!1),We(V.draft),Xt(V.id),Ut.current=V,Ti(V.deploymentTarget??null),$r(""),Cr(""),xt("custom"),Oe("")}},(Qi==null?void 0:Qi.id)??"workspace"):Fu?o.jsx(s5,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:C1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{ae(!1),We(null),xt("menu")}},{key:"package",icon:Wz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{ae(!1),We(null),xt("package")}}]}):ur?o.jsx(TK,{userId:be,appId:n,agentInfo:Te,capabilitiesLoading:bt,agentLabel:Hh,onOpenSession:XB}):Uu?o.jsx(qse,{onAdded:V=>{Ll(Ls()),qt(!1),r(V)},onCancel:()=>qt(!1)}):Sn?o.jsx(Gse,{}):Is!==null&&!It?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Is==="menu"?o.jsx(L0e,{onSelect:V=>{We(null),Ti(null),$r(""),Cr(""),Xt(V==="custom"?`draft-${Date.now().toString(36)}`:""),Ut.current=null,xt(V)},onImport:V=>{We(V),Ti(null),$r(""),Cr(""),Xt(`draft-${Date.now().toString(36)}`),Ut.current=null,xt("custom")}}):Is==="intelligent"?o.jsx(oye,{userId:be,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,onDeploymentTaskChange:ye}):Is==="custom"?o.jsx(tbe,{initialDraft:Fe??void 0,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,features:cr,onDeploymentTaskChange:ye,deploymentTarget:Ml??void 0,initialDeployRegion:Dh,onDraftChange:(V,re)=>{jt&&(re?FB(jt,V,Ml??void 0):yk(jt))},onDiscard:jt?()=>{yk(jt),Xt(""),Ut.current=null,We(null),Ti(null),$r(""),Cr(n),xt(null),ae(!1),cn(!0),Oe("")}:void 0,onDeploymentStarted:bk,onDeploymentComplete:Ek},jt||"custom"):Is==="template"?o.jsx(sbe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="workflow"?o.jsx(fbe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="package"?o.jsx(ybe,{onBack:()=>{xt(null),ae(!0)},onAgentAdded:dy,onDeploymentTaskChange:ye,onDeploymentStarted:bk,onDeploymentComplete:Ek,initialDeployRegion:Dh}):L.length===0&&ne?o.jsx(Xbe,{initialJob:ne}):L.length===0&&!X?o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 正在检查 Agent 能力…"]}):L.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(Ea,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":O==="skill-create"?"想创建一个什么 Skill?":lr}),B]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Il?" is-streaming":""}`,ref:Pu,onScroll:zB,onWheel:VB,onTouchMove:KB,children:L.map((V,re)=>{var Ia,Ra,Hn,Zi,rr;const me=re===L.length-1;if(V.role==="user"){const Gn=V.blocks.map(ds=>ds.kind==="text"?ds.text:"").join(""),Jr=V.blocks.flatMap(ds=>ds.kind==="attachment"?ds.files:[]),Ai=V.blocks.find(ds=>ds.kind==="invocation");return o.jsxs(nn.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Ai==null?void 0:Ai.kind)==="invocation"&&o.jsx(F_,{value:Ai.value}),Jr.length>0&&o.jsx($_,{appName:n,items:Jr}),Gn&&o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:Gn})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ia=V.meta)==null?void 0:Ia.ts)&&o.jsx("span",{className:"meta-text",children:AB(V.meta.ts)}),o.jsx(CI,{text:Gn})]})]},re)}const Ne=((Ra=V.meta)==null?void 0:Ra.author)??"",Be=Ne&&mr?Hx(mr,Ne):void 0,ut=!!(Ne&&ko.length>0&&!ko.includes(Ne)),$e=(Be==null?void 0:Be.name)||Ne,Ge=(Be==null?void 0:Be.description)||(ut?"正在执行主 Agent 移交的任务。":"");if(V.blocks.length>0&&V.blocks.every(Gn=>Gn.kind==="agent-transfer"))return null;const tt=V.blocks.length===0,_e=((Zi=(Hn=V.meta)==null?void 0:Hn.feedback)==null?void 0:Zi.rating)??null,st=((rr=V.meta)==null?void 0:rr.eventId)??"",zt=Je.has(st),gr=!!(jl&&st&&AI(V));return o.jsxs(nn.div,{ref:Gn=>{st&&(Gn?fy.current.set(st,Gn):fy.current.delete(st))},className:["turn turn--assistant",ut?"turn--subagent":"",Lh===st?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[ut&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(zz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:$e})]}),o.jsx("p",{className:"subagent-run-description",title:Ge,children:Ge})]}),tt?me&&Js?o.jsx(t5,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(H_,{appName:n,blocks:V.blocks,streaming:me&&(Js||Na),onStreamFrame:me?YB:void 0,onAction:o8,onAuth:l8,onArtifactDownload:(Gn,Jr)=>qM(n,be,a,Gn,Jr),onArtifactPreview:(Gn,Jr)=>QM(n,be,a,Gn,Jr)}),!(me&&Js)&&!L1e(V)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(me&&Js)&&!M1e(V)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[gr&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":_e==="good","aria-busy":zt,title:_e==="good"?"取消点赞":"赞",disabled:zt,onClick:()=>void Ck(V,_e==="good"?null:"good"),children:o.jsx(o1e,{className:"icon",filled:_e==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":_e==="bad","aria-busy":zt,title:_e==="bad"?"取消点踩":"踩",disabled:zt,onClick:()=>void Ck(V,_e==="bad"?null:"bad"),children:o.jsx(l1e,{className:"icon",filled:_e==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>an(!0),children:o.jsx(I1e,{})}),o.jsx(CI,{text:AI(V)})]}),V.meta&&o.jsx("span",{className:"meta-text",children:R1e(V.meta)})]})]})]},re)})}),!p&&o.jsx(Bj,{appName:n,info:Te,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:V=>void Nk(V)}),o.jsx("div",{className:"conversation-composer-slot",children:B})]})]})]})})(),dn&&a&&o.jsx(uB,{appName:n,sessionId:a,onClose:()=>an(!1)}),pt&&L.length>0&&o.jsx(hY,{appName:n,info:Te,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:B=>void Nk(B),onClose:On,returnFocusRef:on}),o.jsx(i1e,{open:x,state:k,error:T,onCancel:QB,onConfirm:()=>void ZB()}),gt&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:gt}),o.jsx(d1e,{open:ue,checking:Ce,error:ot,onLogin:()=>void WB()}),BB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Ph(!1),children:o.jsxs("div",{className:"confirm-box",onClick:B=>B.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Ph(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{We(null),xt("menu"),Ph(!1)},children:"确定返回"})]})]})})]})}const OI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(OI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(OI,String(t))}catch{}window.location.reload()}});(()=>{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})()||m1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(J9,{reducedMotion:"user",children:o.jsx(Oz,{maskOpacity:.9,children:o.jsx(z1e,{})})})}));export{E as A,_0 as B,xs as C,G1e as D,Kd as E,fl as F,T3 as G,K1e as R,Br as V,kt as a,eu as b,x2 as c,q1e as d,Kv as e,xq as f,Mf as g,Mt as h,PQ as i,VQ as j,vq as k,Xf as l,VZ as m,NQ as n,SQ as o,ZZ as p,bZ as q,EZ as r,B3 as s,o as t,it as u,un as v,Tt as w,W1e as x,jQ as y,vs as z}; +`)),m("copied")}catch{m("error")}},F=()=>{var U;h(!1),m("idle"),c(""),d(b.current||((U=N[0])==null?void 0:U.version)||""),s("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`studio-update-trigger is-${r}`,title:r==="submitting"?"正在更新 Studio":r==="published"?"Studio 已更新":`更新 Studio 至 ${t.latestVersion}`,onClick:()=>{var U;r==="published"?window.location.reload():(r==="submitting"||r==="error"||(d(((U=N[0])==null?void 0:U.version)||t.latestVersion),s("confirm")),a(!0))},children:[o.jsx(vI,{className:"studio-update-icon"}),r==="submitting"?o.jsx(Ea,{as:"span",children:"正在更新"}):r==="published"?o.jsx("span",{children:"刷新使用新版"}):r==="error"?o.jsx("span",{children:"更新失败"}):o.jsx("span",{children:"有新版更新"})]}),i&&r!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(vI,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:r==="error"?"Studio 更新失败":r==="submitting"?"正在更新 Studio":r==="published"?"Studio 更新完成":"发现新版本"}),r==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:l}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:_be[t.errorStage]||t.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:t.errorId||"未生成"})]})]}),o.jsx(_I,{lines:I,phase:"error",copyState:p,onCopy:()=>void j()}),t.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:t.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):r==="submitting"||r==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:b.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:r==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:r==="published"?"已完成":kbe(g)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:wI.map((U,C)=>{const M=wI.findIndex(A=>A.id===t.progressStage),O=r==="published"||Cvoid j()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:y,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":f,onClick:()=>h(U=>!U),onKeyDown:U=>{(U.key==="ArrowDown"||U.key==="ArrowUp")&&(U.preventDefault(),h(!0))},children:[o.jsx("span",{children:T}),o.jsx(Tbe,{})]}),f&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:N.map(U=>{const C=U.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":C,className:`studio-update-version-option${C?" is-selected":""}`,onClick:()=>{d(U.version),h(!1)},children:[o.jsx("span",{children:U.version}),C&&o.jsx(Abe,{})]},U.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:t.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((S==null?void 0:S.gitSha)||t.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),S!=null&&S.changelog.length?o.jsx("ul",{children:S.changelog.map(U=>o.jsx("li",{children:U},U))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{a(!1),h(!1),r==="confirm"&&(s("idle"),c(""))},children:r==="submitting"?"后台运行":r==="confirm"?"取消":"关闭"}),r==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void R(),children:"立即更新"}),r==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:F,children:"重新尝试"})]})]})})]})}const Ibe="/web/skill-creator";class ok extends Error{constructor(n,r){super(n);Pk(this,"status");this.name="SkillCreatorApiError",this.status=r}}function Al(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function An(e,...t){for(const n of t){const r=e[n];if(typeof r=="string"&&r)return r}}function kB(e,...t){for(const n of t){const r=e[n];if(typeof r=="number"&&Number.isFinite(r))return r}}async function Oh(e,t){return fetch(Hi(`${Ibe}${e}`),{...t,headers:p0({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function lk(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const s=Al(await e.json(),"错误响应");return An(s,"detail","message","error")??t}return(await e.text()).trim()||t}async function ck(e,t){if(!e.ok)throw new ok(await lk(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Rbe(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 Obe(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Lbe(e){return Array.isArray(e)?e.map((t,n)=>{const r=Al(t,`文件 ${n+1}`),s=An(r,"path");if(!s)throw new Error(`文件 ${n+1} 缺少 path`);const i=kB(r,"size");if(i===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:s,size:i}}):[]}function Mbe(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 jbe(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const r=Al(t,`活动 ${n+1}`),s=An(r,"id"),i=An(r,"kind"),a=An(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=An(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 l=An(r,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:s,kind:i,text:l,status:a}})}function Dbe(e,t){const n=Al(e,`候选方案 ${t+1}`),r=An(n,"id","candidate_id","candidateId"),s=An(n,"model","model_id","modelId");if(!r||!s)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:r,model:s,modelLabel:An(n,"modelLabel","model_label")??s,status:Rbe(n.status),stage:Obe(n.stage),name:An(n,"name","skill_name","skillName"),description:An(n,"description"),skillMd:An(n,"skillMd","skill_md"),files:Lbe(n.files),activities:jbe(n.activities),validation:Mbe(n.validation),durationMs:kB(n,"elapsedMs","elapsed_ms"),error:An(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:An(n,"skill_id","skillId"),version:An(n,"version")}}function Ux(e,t=""){const n=Al(e,"Skill 创建任务"),r=An(n,"id","job_id","jobId");if(!r)throw new Error("Skill 创建任务缺少 id");const s=Array.isArray(n.candidates)?n.candidates.map(Dbe):[],i=An(n,"status")??"running";if(i!=="provisioning"&&i!=="running"&&i!=="completed")throw new Error(`未知的 Skill 任务状态:${i}`);return{id:r,prompt:An(n,"prompt")??t,status:i,candidates:s}}async function Pbe(e,t){const n=await Oh("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new ok(await lk(n,"创建 Skill 任务失败"),n.status);const r=n.headers.get("content-type")??"";if(r.includes("application/json")){const u=Ux(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="",l;const c=u=>{if(!u.trim())return;const d=Al(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(An(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=Ux(d.job,e),t==null||t(l)};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),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function Bbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`);return Ux(await ck(t,"读取 Skill 任务失败"))}async function Fbe(e){const t=await Oh(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await ck(t,"清理 Skill 任务失败")}async function Ube(e,t){var l;const n=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await lk(n,"下载 Skill 失败"));const s=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[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 $be(e,t,n){const r=await Oh(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),s=Al(await ck(r,"添加到 AgentKit 失败"),"发布结果"),i=An(s,"skill_id","skillId","id");if(!i)throw new Error("发布结果缺少 skill_id");return{skillId:i,name:An(s,"name"),version:An(s,"version"),skillSpaceIds:Array.isArray(s.skillSpaceIds)?s.skillSpaceIds.map(String):Array.isArray(s.skill_space_ids)?s.skill_space_ids.map(String):[],message:An(s,"message")}}const Hbe=()=>{};function zbe(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 Vbe({activities:e}){const t=E.useMemo(()=>e.filter(n=>n.kind!=="status").map(zbe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(H_,{blocks:t,onAction:Hbe})})}const kI={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},NI=12e4;function Kbe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function Ybe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function Wbe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function Gbe({candidate:e}){var c,u;const[t,n]=E.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,NI),l=(((u=e.skillMd)==null?void 0:u.length)??0)>NI;return s.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:s.map(d=>o.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"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:i?`${i.path} · ${i.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function qbe({label:e,jobId:t,candidate:n,selected:r,publishing:s,publishDisabled:i,publishError:a,onSelect:l,onPublish:c}){const[u,d]=E.useState("conversation"),[f,h]=E.useState(!1),[p,m]=E.useState(!1),[g,w]=E.useState(""),[y,b]=E.useState(""),[x,_]=E.useState(""),[k,N]=E.useState(""),T=E.useRef(null),S=E.useRef(null),R=n.status==="queued"||n.status==="running",I=n.status==="succeeded",j=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${r?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),r?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(Kbe,{status:n.status})}),R?o.jsx(Ea,{duration:2.2,spread:16,children:kI[n.stage]}):o.jsx("span",{children:kI[n.stage]}),n.durationMs!==void 0&&I?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(Vbe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,I?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var F;return(F=S.current)==null?void 0:F.focus()})},children:[o.jsx(Ybe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:S,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var F;return(F=T.current)==null?void 0:F.focus()})},children:[o.jsx(Wbe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(j==null?void 0:j.valid)===!1?"is-invalid":"is-valid",children:(j==null?void 0:j.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,j&&(j.errors.length>0||j.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...j.errors,...j.warnings].map((F,Y)=>o.jsx("div",{children:F},`${F}-${Y}`))]}):null,o.jsx(Gbe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":r,onClick:l,children:r?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),w(""),Ube(t,n.id).catch(F=>{w(F instanceof Error?F.message:String(F))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.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"})]}),g?o.jsx("div",{className:"skill-candidate__error",children:g}):null,f&&r&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:F=>{F.preventDefault();const Y=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:Y,...x.trim()?{projectName:x.trim()}:{},...k.trim()?{skillId:k.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:F=>b(F.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:x,onChange:F=>_(F.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:k,onChange:F=>N(F.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:s,children:s?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const SI=new Set(["completed"]),Hp=1100,Xbe=3e4;function Qbe(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 Zbe({initialJob:e}){const[t,n]=E.useState(e),[r,s]=E.useState(""),[i,a]=E.useState(!1),[l,c]=E.useState(),[u,d]=E.useState(),[f,h]=E.useState(()=>new Set),[p,m]=E.useState({});E.useEffect(()=>{n(e),s(""),a(!1)},[e]),E.useEffect(()=>{if(SI.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,b;const x=Date.now()+Xbe,_=async()=>{try{const k=await Bbe(e.id);y||(n({...k,prompt:k.prompt||e.prompt}),s(""),SI.has(k.status)||(b=window.setTimeout(_,Hp)))}catch(k){if(!y){const N=k instanceof ok?k:void 0;if((N==null?void 0:N.status)===404&&Date.now(){y=!0,b!==void 0&&window.clearTimeout(b)}},[e.id,e.status]);const g=z_.map((y,b)=>t.candidates.find(x=>x.model===y)??t.candidates[b]??Qbe(y,b));async function w(y,b){d(y.id),m(x=>({...x,[y.id]:""}));try{await $be(t.id,y.id,b),h(x=>new Set(x).add(y.id))}catch(x){m(_=>({..._,[y.id]:x instanceof Error?x.message:String(x)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),r?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",r,"。",i?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:g.map((y,b)=>{const _=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(qbe,{label:`方案 ${b===0?"A":"B"}`,jobId:t.id,candidate:_,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:k=>void w(y,k)},`${y.model}-${y.id}`)})})]})}const c1="/web/sandbox/sessions",Jbe=33e4,e1e=6e5,t1e=15e3;function u1(e){const t=p0(e);return t.set("Accept","application/json"),t}async function d1(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 n1e(e,t){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),r=new TextDecoder;let s="",i="";const a=[],l=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 g=l.get(h.id);g===void 0?(l.set(h.id,a.length),a.push(m)):a[g]=m,c()}function f(h){let p="message";const m=[];for(const w of h.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&m.push(w.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof g.message=="string"&&g.message?g.message:"沙箱对话失败,请稍后重试。");p==="activity"&&d(g),p==="delta"&&typeof g.text=="string"&&u(g.text),p==="done"&&!i&&typeof g.text=="string"&&u(g.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 f1={async startSession(e={}){const t=await fetch(Hi(c1),{method:"POST",headers:u1({"Content-Type":"application/json"}),signal:bi(e.signal,Jbe)});if(!t.ok)throw await d1(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(Hi(`${c1}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:u1({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text}),signal:bi(t.signal,e1e)});if(!n.ok)throw await d1(n,"沙箱对话失败,请稍后重试。");return n1e(n,t.onBlocks)},async closeSession(e,t={}){if(!e)return;const n=await fetch(Hi(`${c1}/${encodeURIComponent(e)}`),{method:"DELETE",headers:u1(),signal:bi(t.signal,t1e)});if(!n.ok&&n.status!==404)throw await d1(n,"无法清理 AgentKit 沙箱会话。")}},r1e=1e4;async function NB(e){const t=await fetch(Hi(e),{headers:p0({Accept:"application/json"}),signal:bi(void 0,r1e)});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 s1e(){return NB("/web/sandbox/capabilities")}async function i1e(){return NB("/web/skill-creator/capabilities")}function a1e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.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"}),o.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"}),o.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 o1e({open:e,state:t,error:n,onCancel:r,onConfirm:s}){const i=E.useRef(null),a=E.useRef(null);if(E.useEffect(()=>{var f;if(!e)return;const u=document.body.style.overflow;document.body.style.overflow="hidden",(f=a.current)==null||f.focus();const d=h=>{var w;if(h.key==="Escape"){h.preventDefault(),r();return}if(h.key!=="Tab")return;const p=(w=i.current)==null?void 0:w.querySelectorAll("button:not(:disabled)");if(!(p!=null&&p.length))return;const m=p[0],g=p[p.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),m.focus())};return window.addEventListener("keydown",d),()=>{document.body.style.overflow=u,window.removeEventListener("keydown",d)}},[r,e]),!e)return null;const l=t==="loading",c=l?"正在初始化沙箱":t==="error"?"启动失败":"启用 Codex 智能体";return vs.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:u=>{u.target===u.currentTarget&&!l&&r()},children:o.jsxs("section",{ref:i,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":"sandbox-dialog-description",children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:l?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(a1e,{})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:c}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:n||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):l?o.jsx("p",{id:"sandbox-dialog-description","aria-live":"polite",children:"正在寻找可用工具并创建内置智能体会话,通常需要一点时间。"}):o.jsx("p",{id:"sandbox-dialog-description",children:"将启动 AgentKit 沙箱与 Codex 智能体,本次对话不会被持久化保存。"})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:a,type:"button",onClick:r,children:l?"取消启动":"取消"}),!l&&o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t==="error"?"重新尝试":"确认开启"})]})]})}),document.body)}function l1e({onExit:e}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-session-warning-copy",children:"当前为 Codex 智能体会话,退出后对话内容消失"}),o.jsx("button",{type:"button",onClick:e,children:"退出内置智能体"})]})}function c1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.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 u1e({filled:e=!1,...t}){return o.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:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.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"})]})}function d1e(e){return e.toLowerCase()==="github"?o.jsx(nV,{className:"icon"}):o.jsx(lV,{className:"icon"})}function f1e({branding:e,onUsername:t}){const[n,r]=E.useState(null),[s,i]=E.useState(""),[a,l]=E.useState(0),[c,u]=E.useState(""),d=E.useRef(null);E.useEffect(()=>{let m=!0;return r(null),i(""),UM().then(g=>{m&&r(g)}).catch(g=>{m&&i(g instanceof Error?g.message:String(g))}),()=>{m=!1}},[a]);const f=n!==null&&n.length===0;E.useEffect(()=>{var m;f&&((m=d.current)==null||m.focus())},[f]);const h=IV.test(c),p=()=>{h&&t(c)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||Bv,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(Ea,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),s?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:s}),o.jsx("button",{type:"button",onClick:()=>l(m=>m+1),children:"重试"})]}):n===null?null:n.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:n.map(m=>o.jsxs("button",{className:"login-btn",onClick:()=>OV(m.loginUrl),children:[d1e(m.id),o.jsxs("span",{children:["使用 ",m.label," 登录"]})]},m.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:m=>{m.preventDefault(),p()},children:[o.jsx("input",{ref:d,className:"login-name-input",value:c,onChange:m=>u(m.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!h,"aria-label":"进入",children:o.jsx(Hd,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:c&&!h?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function h1e({open:e,checking:t,error:n,onLogin:r}){const s=E.useRef(null);return E.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?vs.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(u0,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:s,type:"button",onClick:r,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}function p1e({node:e,ctx:t}){const n=e.variant??"default";return o.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)})}Tl("Button",p1e);function m1e({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Tl("Card",m1e);const g1e={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},y1e={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function SB(e){return g1e[e]??"flex-start"}function TB(e){return y1e[e]??"stretch"}function b1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:SB(e.justify),alignItems:TB(e.align)},children:n.map(r=>t.render(r))})}Tl("Column",b1e);function E1e({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Tl("Divider",E1e);const x1e={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function w1e({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:x1e[t]??"•"})}Tl("Icon",w1e);function v1e({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:SB(e.justify),alignItems:TB(e.align??"center")},children:n.map(r=>t.render(r))})}Tl("Row",v1e);const _1e=new Set(["h1","h2","h3","h4","h5"]);function k1e({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),s=_1e.has(n)?n:"p";return o.jsx(s,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Tl("Text",k1e);async function zp(e){const[t,n,r]=await Promise.allSettled([s1e(),i1e(),Lv(e)]);return{agentId:e,ready:!0,harnessEnabled:r.status==="fulfilled",builtinTools:r.status==="fulfilled"?r.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const N1e="创建 Agent",S1e={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流",package:"代码包部署"},Ri={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},T1e=new Set,A1e=[];function ta(){return{skills:[]}}function $o(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function h1(e){return`${$o(e)}.active`}function $x(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function C1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($o(e))||"[]");return Array.isArray(t)?t:[]}catch{return[]}}function I1e(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem($x(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Hx(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const r=Hx(n,t);if(r)return r}}function AB(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(...AB(n)));return t}function TI(){const e=typeof localStorage<"u"?localStorage.getItem(Ri.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function R1e({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),o.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 O1e(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function CB(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 L1e(e){if(!e)return"";const t=[];return e.ts&&t.push(CB(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function AI(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const M1e="send_a2ui_json_to_client";function j1e(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===M1e&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?Y6(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function D1e(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function P1e(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)},l=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"&&l(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)&&l(d)}catch{}}},500)})}function B1e(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 CI({text:e}){const[t,n]=E.useState(!1);return o.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?o.jsx(Gs,{className:"icon"}):o.jsx(d0,{className:"icon"})})}function F1e(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function U1e({tasks:e,onCancel:t}){const[n,r]=E.useState(!1),[s,i]=E.useState(null),a=e.filter(f=>f.status==="running").length,l=e[0],c=a>0?"running":(l==null?void 0:l.status)??"idle",u=a>0?`${a} 个部署任务进行中`:(l==null?void 0:l.status)==="success"?"最近部署已完成":(l==null?void 0:l.status)==="error"?"最近部署失败":(l==null?void 0:l.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{i(f.id),t(f).finally(()=>i(null))};return o.jsxs("div",{className:"global-deploy-center",children:[o.jsxs("button",{type:"button",className:`global-deploy-task is-${c}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[c==="running"?o.jsx($t,{className:"global-deploy-task-icon spin"}):c==="success"?o.jsx(CM,{className:"global-deploy-task-icon"}):c==="error"?o.jsx(u0,{className:"global-deploy-task-icon"}):c==="cancelled"?o.jsx(TE,{className:"global-deploy-task-icon"}):o.jsx(oV,{className:"global-deploy-task-icon"}),o.jsx("span",{className:"global-deploy-task-detail",children:u}),o.jsx(yv,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),o.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[o.jsxs("header",{className:"global-deploy-popover-head",children:[o.jsx("span",{children:"部署任务"}),o.jsx("span",{children:e.length})]}),o.jsx("div",{className:"global-deploy-list",children:e.length===0?o.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 o.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[o.jsxs("div",{className:"global-deploy-item-head",children:[o.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),o.jsx("span",{className:"global-deploy-status",children:h})]}),o.jsxs("dl",{className:"global-deploy-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime 名称"}),o.jsx("dd",{children:f.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署地域"}),o.jsx("dd",{children:F1e(f.region)})]}),f.runtimeId&&o.jsxs("div",{children:[o.jsx("dt",{children:"Runtime ID"}),o.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?o.jsx(Dg,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?o.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:o.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),o.jsx("div",{className:"global-deploy-item-actions",children:o.jsx("button",{type:"button",disabled:s===f.id,onClick:()=>d(f),children:s===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const II=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],RI=()=>II[Math.floor(Math.random()*II.length)];function p1(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function $1e(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function H1e(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 zx(e){return e.flatMap(t=>t.apps.map(n=>bo(t.id,n)))}function z1e(e,t){var n;return((n=e.find(r=>r.runtimeId&&r.apps.some(s=>bo(r.id,s)===t)))==null?void 0:n.runtimeId)??""}function V1e(e,t,n){return e?t.includes(e)||zx(n).includes(e):!1}function K1e(){const[e,t]=E.useState([]),[n,r]=E.useState(""),[s,i]=E.useState([]),[a,l]=E.useState(""),c=E.useRef(null),[u,d]=E.useState(!1),[f,h]=E.useState([]),[p,m]=E.useState(null),[g,w]=E.useState([]),[y,b]=E.useState(!1),[x,_]=E.useState(!1),[k,N]=E.useState("confirm"),[T,S]=E.useState(""),R=E.useRef(null),I=E.useRef(null),[j,F]=E.useState({}),Y=a?j[a]??[]:f,L=p?g:Y,U=(B,V)=>F(re=>({...re,[B]:typeof V=="function"?V(re[B]??[]):V})),[C,M]=E.useState(""),[O,D]=E.useState("agent"),[A,H]=E.useState(null),[W,P]=E.useState({}),te=E.useRef(new Map),X=W.ready===!0&&W.agentId===n,[ne,ce]=E.useState(null),[J,fe]=E.useState(!1),ee=E.useRef(0),[Ee,ge]=E.useState([]),[xe,we]=E.useState(ta),[Ae,Re]=E.useState(null),[Ye,Le]=E.useState(0),[bt,Ze]=E.useState(!1),[ze,le]=E.useState(null),[ve,ct]=E.useState(!1),[ht,G]=E.useState([]),[Z,he]=E.useState(!1),De=E.useRef(new Set),[qe,nt]=E.useState(()=>new Set),[Kt,Et]=E.useState(()=>new Set),Pt=E.useRef(new Map),Yt=E.useRef(new Map),Nt=(B,V)=>nt(re=>{const me=new Set(re);return V?me.add(B):me.delete(B),me}),rn=B=>{const V=Yt.current.get(B);V!==void 0&&window.clearTimeout(V),Yt.current.delete(B),Et(re=>new Set(re).add(B))},sn=B=>{const V=Yt.current.get(B);V!==void 0&&window.clearTimeout(V);const re=window.setTimeout(()=>{Yt.current.delete(B),Et(me=>{const Ne=new Set(me);return Ne.delete(B),Ne})},2400);Yt.current.set(B,re)},_t=E.useRef(""),[rt,Oe]=E.useState(""),[gt,Se]=E.useState(""),pe=E.useRef(null);E.useEffect(()=>()=>{pe.current!==null&&window.clearTimeout(pe.current)},[]);const[Je,at]=E.useState(()=>new Set),[dn,an]=E.useState(!1),[pt,Lt]=E.useState(!1),on=E.useRef(null),On=E.useCallback(()=>Lt(!1),[]),[lr,fn]=E.useState(RI),[Bt,Kn]=E.useState(null),[ue,Te]=E.useState(!1),[Ce,Qe]=E.useState(!1),[ot,et]=E.useState(""),Ct=E.useRef(!1),[Wt,oe]=E.useState(null),[be,dt]=E.useState(""),[Ve,Ke]=E.useState(),[ft,Gt]=E.useState(null),[cr,Yn]=E.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[hn,Ln]=E.useState("cloud"),[Ht,Jt]=E.useState(Rf),[Ot,kn]=E.useState(""),[Nn,en]=E.useState("chat"),[tr,Wn]=E.useState(!1),[pr,nr]=E.useState(!1),[Si,Xs]=E.useState(!1),[Zr,wr]=E.useState({}),[Ts,Qs]=E.useState({}),[ka,Ur]=E.useState({}),wo=qe.has(a),Na=Kt.has(a),Zs=wo||u,Cl=!!a&&ve,Js=p?y:Zs,Il=Js||!p&&Na,vo=Zr[a]??"",_o=Ts[a]??T1e,Sa=ka[a]??A1e,mr=Ae==null?void 0:Ae.graph,ko=[Ae==null?void 0:Ae.name,mr==null?void 0:mr.name,mr==null?void 0:mr.id].filter(B=>!!B),No=xe.targetAgent&&mr?Hx(mr,xe.targetAgent.name):mr,Rl=(No==null?void 0:No.skills)??(xe.targetAgent?[]:(Ae==null?void 0:Ae.skills)??[]),Du=mr?AB(mr):[];function As(B){p1(B);for(const V of B)V.status==="uploading"?De.current.add(V.id):V.uri&&om(n,V.uri).catch(re=>Oe(String(re)))}function Cs(){ee.current+=1;const B=ne;ce(null),fe(!1),B&&!B.id.startsWith("pending-")&&Fbe(B.id).catch(V=>{Oe(V instanceof Error?V.message:String(V))})}async function Ta(B){try{await OE(n,be,B),await RE(n,be,B),i(V=>V.filter(re=>re.id!==B)),F(V=>{const{[B]:re,...me}=V;return me})}catch(V){Oe(String(V))}}function Ol(B){const V=Ee.find(Ne=>Ne.id===B);if(!V)return;const re=Ee.filter(Ne=>Ne.id!==B);p1([V]),V.status==="uploading"&&De.current.add(B),ge(re),re.length===0&&!C.trim()&&!!a&&L.length===0?(_t.current="",l(""),Ta(a)):V.uri&&om(n,V.uri).catch(Ne=>Oe(String(Ne)))}const So=(B,V)=>{var Be,ut,$e,Ge,tt;const re=V.author&&V.author!=="user"?V.author:void 0;re&&(wr(_e=>({..._e,[B]:re})),Qs(_e=>({..._e,[B]:new Set(_e[B]??[]).add(re)})),Ur(_e=>{var st;return(st=_e[B])!=null&&st.length?_e:{..._e,[B]:[re]}}));const me=((Be=V.actions)==null?void 0:Be.transferToAgent)??((ut=V.actions)==null?void 0:ut.transfer_to_agent);me&&Ur(_e=>{const st=_e[B]??[];return st[st.length-1]===me?_e:{..._e,[B]:[...st,me]}}),((($e=V.actions)==null?void 0:$e.endOfAgent)??((Ge=V.actions)==null?void 0:Ge.end_of_agent)??((tt=V.actions)==null?void 0:tt.escalate))&&Ur(_e=>{const st=_e[B]??[];return st.length<=1?_e:{..._e,[B]:st.slice(0,-1)}})},[ei,xt]=E.useState(TI),[z,se]=E.useState([]),ye=E.useCallback(B=>{se(V=>{const re=V.findIndex(Ne=>Ne.id===B.id);if(re===-1)return[B,...V];const me=[...V];return me[re]={...me[re],...B},me})},[]),Ue=E.useCallback(async B=>{try{await oj(B.id),se(V=>V.map(re=>re.id===B.id?{...re,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:re))}catch(V){const re=V instanceof Error?V.message:String(V);se(me=>me.map(Ne=>Ne.id===B.id?{...Ne,message:`取消失败:${re}`}:Ne))}},[]),[It,Qt]=E.useState(!0),[Sn,Mn]=E.useState(!1),[Ft,qt]=E.useState(!1),[q,ae]=E.useState(!1),[Fe,We]=E.useState(null),[pn,ln]=E.useState([]),[jn,$n]=E.useState([]),[jt,Xt]=E.useState(""),Ut=E.useRef(null),[ur,mn]=E.useState(!1),[qi,cn]=E.useState(!1),[uk,sy]=E.useState(""),[IB,RB]=E.useState("good"),[OB,Pu]=E.useState("basic"),[LB,MB]=E.useState("good"),[Lh,Mh]=E.useState(""),[ti,vr]=E.useState(!1),iy=E.useRef(null),[Xi,Ll]=E.useState(()=>{const B=Ls();return _u(B),B}),[jB,dk]=E.useState(!1),[DB,fk]=E.useState(""),[hk,jh]=E.useState(null),[PB,pk]=E.useState({}),[BB,mk]=E.useState(()=>new Set),[Ml,Ti]=E.useState(null),[Dh,ay]=E.useState("cn-beijing"),[gk,$r]=E.useState(""),[oy,Cr]=E.useState(""),[zt,us]=E.useState(null),[FB,Ph]=E.useState(!1),ly=E.useRef(!1),Bh=E.useRef(!1),Fh=E.useRef(!1),UB=E.useCallback((B,V,re)=>{!B||!be||ln(me=>{const Be=[{id:B,draft:V,updatedAt:Date.now(),deploymentTarget:re},...me.filter(ut=>ut.id!==B)];return localStorage.setItem($o(be),JSON.stringify(Be)),Be})},[be]),cy=E.useCallback(B=>{!B||!be||ln(V=>{const re=V.filter(me=>me.id!==B);return localStorage.setItem($o(be),JSON.stringify(re)),re})},[be]),$B=E.useCallback(B=>{if(!be||B.length===0)return;const V=new Set(B.map(re=>re.id));ln(re=>{const me=re.filter(Ne=>!V.has(Ne.id));return localStorage.setItem($o(be),JSON.stringify(me)),me}),V.has(jt)&&(Xt(""),We(null),Ti(null),Ut.current=null,localStorage.removeItem(h1(be)))},[jt,be]),yk=E.useCallback(B=>{if(!B||!be)return;const V=Ut.current;ln(re=>{const me=re.filter(Be=>Be.id!==B),Ne=(V==null?void 0:V.id)===B?[V,...me]:me;return localStorage.setItem($o(be),JSON.stringify(Ne)),Ne})},[be]);E.useEffect(()=>{if(!be){ln([]),$n([]),Xt(""),Ut.current=null;return}const B=C1e(be);ln(B),$n(I1e(be));const V=localStorage.getItem(h1(be))||"",re=B.find(me=>me.id===V);Ut.current=re??null,ei==="custom"&&re&&(Xt(re.id),We(re.draft),Ti(re.deploymentTarget??null))},[be]),E.useEffect(()=>{if(!be)return;const B=h1(be);ei==="custom"&&jt?localStorage.setItem(B,jt):localStorage.removeItem(B)},[ei,jt,be]);const HB=E.useCallback(B=>{if(!be)return;const V=[...new Set(B.filter(Boolean))];$n(V),localStorage.setItem($x(be),JSON.stringify(V))},[be]),zB=E.useCallback(async B=>{const V=B.filter(Ge=>!!Ge.runtimeId&&Ge.canDelete===!0);if(V.length===0)return;const re=z1e(Xi,n),me=new Set(V.map(Ge=>Ge.runtimeId));mk(Ge=>{const tt=new Set(Ge);for(const _e of me)tt.add(_e);return tt}),PC(me);const Ne=new Set,Be=new Set,ut=new Set,$e=[];for(const Ge of V)try{if(!Ge.region)throw new Error("Runtime 缺少地域信息,无法删除");await pj(Ge.runtimeId,Ge.region),lg(Ge.runtimeId),Ne.add(Ge.runtimeId),Be.add(Ge.id)}catch(tt){const _e=tt instanceof Error?tt.message:String(tt);ut.add(Ge.runtimeId),$e.push(`${Ge.label}: ${_e}`)}if(Ne.size>0&&(PC(Ne),Ll(Ls()),jh(tt=>{if(!tt)return tt;const _e=new Set(tt);for(const st of Ne)_e.delete(st);return _e}),pk(tt=>Object.fromEntries(Object.entries(tt).filter(([_e])=>!Ne.has(_e)))),$n(tt=>{const _e=tt.filter(st=>!Be.has(st));return be&&localStorage.setItem($x(be),JSON.stringify(_e)),_e}),ln(tt=>{const _e=tt.filter(st=>{var Vt;return!((Vt=st.deploymentTarget)!=null&&Vt.runtimeId)||!Ne.has(st.deploymentTarget.runtimeId)});return be&&localStorage.setItem($o(be),JSON.stringify(_e)),_e}),(re?Ne.has(re):V.some(tt=>tt.id===n))&&(vk(),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),vr(!0),Oe("")),zt!=null&&zt.runtime&&Ne.has(zt.runtime.runtimeId)&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),vr(!0),Oe(""))),ut.size>0&&mk(Ge=>{const tt=new Set(Ge);for(const _e of ut)tt.delete(_e);return tt}),$e.length>0){const Ge=$e.slice(0,3).join(";"),tt=$e.length>3?`;另有 ${$e.length-3} 个失败`:"";throw new Error(`${$e.length} 个 Agent 删除失败:${Ge}${tt}`)}},[zt,n,Xi,be]),uy=E.useCallback(async()=>{dk(!0),fk("");try{const B=[];let V="";do{const re=await Ic({scope:"mine",region:"all",pageSize:100,nextToken:V});B.push(...re.runtimes),V=re.nextToken}while(V&&B.length<2e3);jh(new Set(B.map(re=>re.runtimeId))),pk(Object.fromEntries(B.map(re=>[re.runtimeId,{canDelete:re.canDelete}])))}catch(B){fk(B instanceof Error?B.message:String(B))}finally{dk(!1)}},[]);function Uh(B){console.log("create agent draft:",B),xt(null),Ca()}function dy(B,V){console.log("Agent added, navigating to:",B,V),Ll(Ls()),jh(null),cy(jt),Xt(""),Ut.current=null,Ti(null),$r(""),Cr(B),Pu("basic"),xt(null),cn(!0),r(B)}const bk=E.useCallback(B=>{xt(null),ae(!1),us(null),cn(!0),Cr(""),Pu("basic"),$r(B.id),Oe("")},[]),Ek=E.useCallback(async B=>{if(!B.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const V=(Ml==null?void 0:Ml.region)??Dh,re=await og(B.runtimeId,B.agentName,B.region??V,B.version);Ll(Ls()),Le(Ne=>Ne+1);const me=await zp(re);te.current.set(re,me),P(me),jh(Ne=>{const Be=new Set(Ne??[]);return Be.add(B.runtimeId),Be}),Ti(null),cy(jt),Xt(""),Ut.current=null,Cr(re),Pu("basic"),xt(null),cn(!0),r(re)},[jt,Dh,cy,Ml]),Bu=E.useRef(null),fy=E.useRef(new Map),To=E.useRef(!0),Aa=E.useRef(!1),Ao=E.useRef(null),xk=E.useRef({key:"",turnCount:0}),hy=(p==null?void 0:p.id)??a;E.useLayoutEffect(()=>{const B=Bu.current,V=xk.current,re=V.key!==hy,me=!re&&L.length>V.turnCount;if(xk.current={key:hy,turnCount:L.length},!B||L.length===0||!re&&!me)return;To.current=!0,Aa.current=!1,Ao.current!==null&&(window.clearTimeout(Ao.current),Ao.current=null);const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(re||Ne){B.scrollTop=B.scrollHeight;return}Aa.current=!0,B.scrollTo({top:B.scrollHeight,behavior:"smooth"}),Ao.current=window.setTimeout(()=>{Aa.current=!1,Ao.current=null},450)},[hy,L.length]),E.useLayoutEffect(()=>{const B=Bu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[Js,L]),E.useEffect(()=>{if(!Lh||qi||L.length===0)return;const B=fy.current.get(Lh);if(!B)return;To.current=!1,B.scrollIntoView({behavior:"smooth",block:"center"});const V=window.setTimeout(()=>{Mh("")},2600);return()=>window.clearTimeout(V)},[Lh,qi,L]),E.useEffect(()=>()=>{Ao.current!==null&&window.clearTimeout(Ao.current)},[]);const VB=E.useCallback(()=>{const B=Bu.current;!B||Aa.current||(To.current=B.scrollHeight-B.scrollTop-B.clientHeight<32)},[]),KB=E.useCallback(B=>{B.deltaY<0&&(Aa.current=!1,To.current=!1)},[]),YB=E.useCallback(()=>{Aa.current=!1,To.current=!1},[]),WB=E.useCallback(()=>{const B=Bu.current;!B||!To.current||Aa.current||(B.scrollTop=B.scrollHeight)},[]),py=E.useCallback(()=>{oe(null),AE().then(B=>{dt(B.userId),Ke(B.info),nr(!!B.local),Kn(B.status),B.status==="authenticated"&&(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),vr(!0))}).catch(B=>{oe(B instanceof Error?B.message:String(B))})},[]);E.useEffect(()=>{py()},[py]),E.useEffect(()=>{const B=()=>{et(""),Te(!0)};return window.addEventListener(CE,B),UV()&&B(),()=>window.removeEventListener(CE,B)},[]);const GB=E.useCallback(async()=>{if(Ct.current)return;Ct.current=!0;const B=LV();if(!B){Ct.current=!1,et("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}Qe(!0),et("");try{for(;;){await new Promise(V=>window.setTimeout(V,1e3));try{const V=await AE();if(V.status==="authenticated"){dt(V.userId),Ke(V.info),nr(!!V.local),Kn(V.status),Te(!1),$V(),B.close();return}}catch{}if(B.closed){et("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{Ct.current=!1,Qe(!1)}},[]);E.useEffect(()=>{pr&&be&&mT(be)},[pr,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be||!n){P({});return}const B=te.current.get(n);if(B){P(B);return}let V=!1;return P({}),zp(n).then(re=>{V||(te.current.set(n,re),P(re))}),()=>{V=!0}},[n,Bt,be]),E.useEffect(()=>{if(Bt!=="authenticated"||!be){Gt(null);return}let B=!1;return Gt(null),uj().then(V=>{B||Gt(V)}).catch(V=>{console.warn("[app] /web/access failed; using ordinary-user access:",V),B||Gt(cj)}),()=>{B=!0}},[Bt,be]),E.useEffect(()=>{lj().then(B=>{Yn(B.features),Ln(B.agentsSource),Jt(B.branding),kn(B.version),en(B.defaultView),Wn(!0)})},[]),E.useEffect(()=>{!ft||!tr||Bh.current||ti||(Bh.current=!0,Nn==="addAgent"&&ft.capabilities.createAgents&&(xt(null),Mn(!1),mn(!1),cn(!1),qt(!1),ae(!0)))},[ft,Nn,ti,tr]),E.useEffect(()=>{ft&&(ft.capabilities.createAgents||(xt(null),We(null),qt(!1),ae(!1),se([])),ft.capabilities.manageAgents||cn(!1))},[ft]),E.useEffect(()=>{Bt!=="authenticated"||hn!=="cloud"||!tr||!qi||zt||uy()},[zt,hn,Bt,qi,uy,tr]),E.useEffect(()=>{document.title=Ht.title;let B=document.querySelector('link[rel~="icon"]');B||(B=document.createElement("link"),B.rel="icon",document.head.appendChild(B)),B.removeAttribute("type"),B.href=Ht.logoUrl||Bv},[Ht]),E.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(B=>B.ok?B.json():null).then(B=>{B&&Qt(!!B.credentials)}).catch(B=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",B)})},[]);function qB(B){mT(B),ly.current=!0,Bh.current=!1,Gt(null),xt(null),We(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),Ca(),vr(!0),dt(B),Ke({name:B}),nr(!0),Kn("authenticated")}function XB(){Bh.current=!1,Gt(null),pr?(RV(),dt(""),Ke(void 0),Kn("unauthenticated")):jV()}E.useEffect(()=>{if(Bt==="authenticated"){if(hn==="cloud"){const B=localStorage.getItem(Ri.app),V=zx(Xi);r(re=>re&&V.includes(re)?re:re?(Fh.current=!0,localStorage.removeItem(Ri.app),""):Fh.current?"":B&&V.includes(B)?B:"");return}VM().then(B=>{t(B);const V=localStorage.getItem(Ri.app),re=zx(Xi),me=V&&(B.includes(V)||re.includes(V)),Ne=["web_search_agent","web_demo"].find(Be=>B.includes(Be))??B.find(Be=>!/^\d/.test(Be))??B[0];r(me?V:Ne||"")}).catch(B=>Oe(String(B)))}},[Bt,hn,Xi]),E.useEffect(()=>{n?(Fh.current=!1,localStorage.setItem(Ri.app,n)):localStorage.removeItem(Ri.app)},[n]),E.useEffect(()=>{let B=!1;if(le(null),G([]),ti||zt||!n||!be||!a){ct(!1);return}return ct(!0),LE(n,be,a).then(V=>{B||(le(V),Lv(n).then(re=>{B||G(re)}).catch(()=>{B||G([])}))}).catch(()=>{B||le(null)}).finally(()=>{B||ct(!1)}),()=>{B=!0}},[zt,n,ti,be,a]),E.useEffect(()=>{let B=!1;if(Re(null),we(ta()),Bt!=="authenticated"||ti||zt||!n){Ze(!1);return}return Ze(!0),Mv(n).then(V=>{B||Re(V)}).catch(()=>{B||Re(null)}).finally(()=>{B||Ze(!1)}),()=>{B=!0}},[zt,n,Ye,Bt,ti]),E.useEffect(()=>{ft&&localStorage.setItem(Ri.view,ft.capabilities.createAgents?ei??"chat":"chat")},[ft,ei]),E.useEffect(()=>{localStorage.setItem(Ri.session,a),_t.current=a},[a]),E.useEffect(()=>()=>Pt.current.forEach(B=>B.abort()),[]),E.useEffect(()=>()=>Yt.current.forEach(B=>{window.clearTimeout(B)}),[]),E.useEffect(()=>()=>{var B,V;(B=R.current)==null||B.abort(),(V=I.current)==null||V.abort()},[]),E.useEffect(()=>{if(ti||zt||p||!n||!be)return;let B=!1;return(async()=>{const V=await $h(n);if(!B){if(!ly.current){ly.current=!0;const re=localStorage.getItem(Ri.session)||"";if(TI()===null&&re&&V.some(me=>me.id===re)){Fu(re);return}}Ca()}})(),()=>{B=!0}},[zt,n,ti,p,be]),E.useEffect(()=>{const B=iy.current;B&&B.app===n&&(iy.current=null,Fu(B.sid))},[n]);function QB(B,V){mn(!1),B===n?Fu(V):(iy.current={app:B,sid:V},r(B))}async function $h(B){try{const V=await Iv(B,be),re=await Promise.all(V.map(me=>{var Ne;return(Ne=me.events)!=null&&Ne.length?Promise.resolve(me):ig(B,be,me.id)}));return i(re),re}catch(V){return Oe(String(V)),[]}}function wk(){p||(Oe(""),S(""),N("confirm"),_(!0))}function ZB(){var B;(B=R.current)==null||B.abort(),R.current=null,_(!1),N("confirm"),S(""),!p&&O==="temporary"&&D("agent")}async function JB(){var V;(V=R.current)==null||V.abort();const B=new AbortController;R.current=B,N("loading"),S("");try{const re=await f1.startSession({signal:B.signal});if(R.current!==B)return;_t.current="",l(""),h([]),M(""),we(ta()),D("temporary"),Cs(),fe(!1),As(Ee),ge([]),w([]),m(re),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),vr(!1),_(!1),N("confirm")}catch(re){if((re==null?void 0:re.name)==="AbortError"||R.current!==B)return;S(re instanceof Error?re.message:String(re)),N("error")}finally{R.current===B&&(R.current=null)}}function Co(){var V;(V=I.current)==null||V.abort(),I.current=null,b(!1),w([]),M(""),Oe(""),D("agent");const B=p;m(null),B&&f1.closeSession(B.id).catch(re=>Oe(String(re)))}async function e8(B){var Ne;const V=p;if(!V||y||!B.trim())return;Oe("");const re=new AbortController;(Ne=I.current)==null||Ne.abort(),I.current=re;const me=[{role:"user",blocks:[{kind:"text",text:B}],meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];w(Be=>[...Be,...me]),b(!0);try{const Be=await f1.sendMessage({sessionId:V.id,text:B},{signal:re.signal,onBlocks:ut=>{I.current===re&&w($e=>{const Ge=$e.slice(),tt=Ge[Ge.length-1];return(tt==null?void 0:tt.role)==="assistant"&&(Ge[Ge.length-1]={...tt,blocks:ut}),Ge})}});if(I.current!==re)return;w(ut=>{const $e=ut.slice(),Ge=$e[$e.length-1];return(Ge==null?void 0:Ge.role)==="assistant"&&($e[$e.length-1]={...Ge,blocks:Be.blocks,meta:{ts:Date.now()/1e3}}),$e})}catch(Be){if((Be==null?void 0:Be.name)==="AbortError"||I.current!==re)return;w(ut=>ut.slice(0,-2)),M(B),Oe(`内置智能体发送失败:${Be instanceof Error?Be.message:String(Be)}`)}finally{I.current===re&&(I.current=null,b(!1))}}function Ca(){Co(),Oe(""),Lt(!1),fn(RI()),D("agent"),H(null),Cs(),fe(!1);const B=a&&Y.length===0&&Ee.length>0?a:"";_t.current="",l(""),le(null),G([]),d(!1),h([]),we(ta()),As(Ee),ge([]),B&&Ta(B)}function vk(){var B;Fh.current=!0,localStorage.removeItem(Ri.app),a&&((B=Pt.current.get(a))==null||B.abort()),c.current=null,Ca(),r(""),P({}),Re(null)}function t8(B){pe.current!==null&&window.clearTimeout(pe.current),Se(B),pe.current=window.setTimeout(()=>{Se(""),pe.current=null},3e3)}function n8(){if(xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),!p&&!V1e(n,e,Xi)){n&&vk(),vr(!0),t8("请先选择 Agent 后再开始新会话");return}vr(!1),Ca()}async function r8(B){var V;try{(V=Pt.current.get(B))==null||V.abort(),await OE(n,be,B),await RE(n,be,B);const re=Yt.current.get(B);re!==void 0&&window.clearTimeout(re),Yt.current.delete(B),Et(me=>{if(!me.has(B))return me;const Ne=new Set(me);return Ne.delete(B),Ne}),F(me=>{const{[B]:Ne,...Be}=me;return Be}),B===a&&Ca(),await $h(n)}catch(re){Oe(String(re))}}async function Fu(B){if(p&&Co(),B!==a&&(_t.current=B,Oe(""),d(!1),h([]),D("agent"),H(null),Cs(),we(ta()),le(null),G([]),l(B),j[B]===void 0)){Xs(!0);try{const V=await ig(n,be,B);U(B,mK(V.events??[],V.state))}catch(V){Oe(String(V))}finally{Xs(!1)}}}async function s8(B){if(!B.sessionId||!B.messageId){Oe("这条案例缺少会话定位信息,无法跳转。");return}mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),cn(!1),sy(n),RB(B.kind),Mh(B.messageId),await Fu(B.sessionId)}function i8(){const B=uk||n;mn(!1),xt(null),qt(!1),ae(!1),Mn(!1),$r(""),Cr(B),Pu("evaluations"),MB(IB),cn(!0),sy(""),Mh("")}function a8(B){const V=new Map,re=new Map;for(const me of B){if(!me.sessionId||!me.messageId)continue;const Ne=V.get(me.sessionId)??new Set;if(Ne.add(me.messageId),V.set(me.sessionId,Ne),me.runtimeId&&me.userId){const Be=[me.runtimeId,n,me.userId,me.sessionId].join(":"),ut=re.get(Be)??{runtimeId:me.runtimeId,appName:n,userId:me.userId,sessionId:me.sessionId,eventIds:new Set};ut.eventIds.add(me.messageId),re.set(Be,ut)}}if(V.size!==0){F(me=>{const Ne={...me};for(const[Be,ut]of V){const $e=Ne[Be];$e&&(Ne[Be]=$e.map(Ge=>{var tt;return(tt=Ge.meta)!=null&&tt.eventId&&ut.has(Ge.meta.eventId)?{...Ge,meta:{...Ge.meta,feedback:void 0}}:Ge}))}return Ne}),i(me=>me.map(Ne=>{const Be=V.get(Ne.id);if(!Be||!Ne.state)return Ne;const ut={...Ne.state};for(const $e of Be)delete ut[`veadk_feedback:${$e}`];return{...Ne,state:ut}})),at(me=>{const Ne=new Set(me);for(const Be of V.values())for(const ut of Be)Ne.delete(ut);return Ne});for(const me of re.values())$M({runtimeId:me.runtimeId,appName:me.appName,userId:me.userId,sessionId:me.sessionId,eventIds:[...me.eventIds]})}}async function _k(B=!0){if(a)return a;c.current||(c.current=sg(n,be));const V=c.current;try{const re=await V;B&&l(re);const me=Date.now()/1e3,Ne={id:re,lastUpdateTime:me,events:[]};return i(Be=>[Ne,...Be.filter(ut=>ut.id!==re)]),re}finally{c.current===V&&(c.current=null)}}async function kk(B){if(!n||!be||!a||!ze)return!1;he(!0),Oe("");try{const V=await ME(n,be,a,B,ze.revision);return le(V),!0}catch(V){return Oe(String(V)),!1}finally{he(!1)}}async function Nk(B){if(!(!n||!be||!a||!ze)){he(!0),Oe("");try{const V=await rj(n,be,a,B,ze.revision);le(V)}catch(V){Oe(String(V))}finally{he(!1)}}}async function o8(B){Oe("");let V;try{V=await _k()}catch(me){Oe(String(me));return}const re=Array.from(B).map(me=>({file:me,attachment:{id:$1e(),mimeType:H1e(me),name:me.name,sizeBytes:me.size,status:"uploading"}}));ge(me=>[...me,...re.map(Ne=>Ne.attachment)]),await Promise.all(re.map(async({file:me,attachment:Ne})=>{try{const Be=await ZM(n,be,V,me);if(De.current.delete(Ne.id)){Be.uri&&await om(n,Be.uri);return}ge(ut=>ut.map($e=>$e.id===Ne.id?Be:$e))}catch(Be){if(De.current.delete(Ne.id))return;const ut=Be instanceof Error?Be.message:String(Be);ge($e=>$e.map(Ge=>Ge.id===Ne.id?{...Ge,status:"error",error:ut}:Ge)),Oe(ut)}}))}async function Sk(B,V=[],re=ta()){if(!B.trim()&&V.length===0||Zs||Cl||!n||!be)return;Oe("");const me=[];(re.skills.length>0||re.targetAgent)&&me.push({kind:"invocation",value:re}),V.length&&me.push({kind:"attachment",files:V.map(_e=>({id:_e.id,mimeType:_e.mimeType,data:_e.data,uri:_e.uri,name:_e.name,sizeBytes:_e.sizeBytes}))}),B.trim()&&me.push({kind:"text",text:B});const Ne=[{role:"user",blocks:me,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],Be=!a;Be&&(h(Ne),d(!0));const ut=A;let $e;try{$e=await _k(!Be)}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(String(_e));return}let Ge=ze!==null;if(ut)try{let _e=await LE(n,be,$e);const st=hge[ut].filter(Vt=>{var gr;return(gr=W.builtinTools)==null?void 0:gr.includes(Vt)});for(const Vt of[...r5[ut],...st])_e.tools.some(gr=>gr.name===Vt)||(_e=await ME(n,be,$e,{kind:"tool",name:Vt},_e.revision));le(_e),Ge=!0}catch(_e){Be&&(h([]),d(!1),M(B),we(re)),Oe(`任务能力挂载失败:${String(_e)}`);return}U($e,_e=>Be?Ne:[..._e,...Ne]),Be&&(_t.current=$e,l($e),h([]),d(!1));const tt=new AbortController;Pt.current.set($e,tt),Nt($e,!0),rn($e),_t.current=$e,wr(_e=>({..._e,[$e]:""})),Qs(_e=>({..._e,[$e]:new Set})),Ur(_e=>({..._e,[$e]:[]}));try{let _e=hi(),st="",Vt=0,gr=Date.now()/1e3,Ia="",Ra="";for await(const Hn of If({appName:n,userId:be,sessionId:$e,text:B,attachments:V,invocation:re,signal:tt.signal,sessionCapabilities:Ge})){if(tt.signal.aborted)break;const Zi=Hn.error??Hn.errorMessage??Hn.error_message;if(typeof Zi=="string"&&Zi){_t.current===$e&&Oe(Zi);break}So($e,Hn);const rr=Hn.author&&Hn.author!=="user"?Hn.author:"";rr&&rr!==st&&(st=rr,_e=hi()),_e=Xc(_e,Hn);const Gn=Hn.usageMetadata??Hn.usage_metadata;Gn!=null&&Gn.totalTokenCount&&(Vt=Gn.totalTokenCount),Hn.timestamp&&(gr=Hn.timestamp),Hn.id&&(Ia=Hn.id);const Jr=Hn.invocationId??Hn.invocation_id;Jr&&(Ra=Jr);const Ai=_e.blocks,ds={author:st||void 0,tokens:Vt||void 0,ts:gr,eventId:Ia||void 0,invocationId:Ra||void 0};U($e,gy=>{var Vu;const fs=gy.slice(),xn=fs[fs.length-1];return(xn==null?void 0:xn.role)==="assistant"&&(!((Vu=xn.meta)!=null&&Vu.author)||xn.meta.author===st)?fs[fs.length-1]={...xn,blocks:Ai,meta:ds}:fs.push({role:"assistant",blocks:Ai,meta:ds}),fs})}$h(n)}catch(_e){(_e==null?void 0:_e.name)!=="AbortError"&&!tt.signal.aborted&&_t.current===$e&&Oe(String(_e))}finally{Pt.current.get($e)===tt&&Pt.current.delete($e),Nt($e,!1),sn($e),wr(_e=>({..._e,[$e]:""})),Ur(_e=>({..._e,[$e]:[]}))}}function l8(B,V){var Ne,Be;const re=((Ne=B==null?void 0:B.event)==null?void 0:Ne.name)??V.id,me=((Be=B==null?void 0:B.event)==null?void 0:Be.context)??{};Sk(`[ui-action] ${re}: ${JSON.stringify(me)}`)}async function c8(B){var Ge,tt,_e;if(!B.authUri)throw new Error("事件中没有授权地址。");if(!n||!be||!a)throw new Error("会话尚未就绪。");const V=a,re=await P1e(B.authUri),me=B1e(B.authConfig,re),Ne=st=>st.map(Vt=>Vt.kind==="auth"&&!Vt.done?{...Vt,done:!0}:Vt);U(V,st=>{const Vt=st.slice(),gr=Vt[Vt.length-1];return(gr==null?void 0:gr.role)==="assistant"&&(Vt[Vt.length-1]={...gr,blocks:Ne(gr.blocks)}),Vt});const Be=L[L.length-1],ut=Ne(Be&&Be.role==="assistant"?Be.blocks:[]),$e=new AbortController;Pt.current.set(V,$e),Nt(V,!0),rn(V);try{let st=hi(),Vt=((Ge=Be==null?void 0:Be.meta)==null?void 0:Ge.author)??"",gr=ut,Ia=0,Ra=Date.now()/1e3,Hn=((tt=Be==null?void 0:Be.meta)==null?void 0:tt.eventId)??"",Zi=((_e=Be==null?void 0:Be.meta)==null?void 0:_e.invocationId)??"";for await(const rr of If({appName:n,userId:be,sessionId:a,text:"",functionResponses:[{id:B.callId,name:"adk_request_credential",response:me}],signal:$e.signal,sessionCapabilities:ze!==null})){if($e.signal.aborted)break;So(V,rr);const Gn=rr.author&&rr.author!=="user"?rr.author:"";Gn&&Gn!==Vt&&(Vt=Gn,gr=[],st=hi()),st=Xc(st,rr);const Jr=rr.usageMetadata??rr.usage_metadata;Jr!=null&&Jr.totalTokenCount&&(Ia=Jr.totalTokenCount),rr.timestamp&&(Ra=rr.timestamp),rr.id&&(Hn=rr.id);const Ai=rr.invocationId??rr.invocation_id;Ai&&(Zi=Ai);const ds=[...gr,...st.blocks];U(V,gy=>{var Ok,Lk,Mk,jk,Dk;const fs=gy.slice(),xn=fs[fs.length-1],Vu={author:Vt||((Ok=xn==null?void 0:xn.meta)==null?void 0:Ok.author),tokens:Ia||((Lk=xn==null?void 0:xn.meta)==null?void 0:Lk.tokens),ts:Ra,eventId:Hn||((Mk=xn==null?void 0:xn.meta)==null?void 0:Mk.eventId),invocationId:Zi||((jk=xn==null?void 0:xn.meta)==null?void 0:jk.invocationId)};return(xn==null?void 0:xn.role)==="assistant"&&(!((Dk=xn.meta)!=null&&Dk.author)||xn.meta.author===Vt)?fs[fs.length-1]={...xn,blocks:ds,meta:Vu}:fs.push({role:"assistant",blocks:ds,meta:Vu}),fs})}$h(n)}catch(st){(st==null?void 0:st.name)!=="AbortError"&&!$e.signal.aborted&&_t.current===V&&Oe(String(st))}finally{Pt.current.get(V)===$e&&Pt.current.delete(V),Nt(V,!1),sn(V),wr(st=>({...st,[V]:""})),Ur(st=>({...st,[V]:[]}))}}if(Wt)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:Wt}),o.jsx("button",{type:"button",onClick:py,children:"重试"})]});if(Bt===null)return o.jsx("div",{className:"boot"});if(Bt==="unauthenticated")return o.jsx(f1e,{branding:Ht,onUsername:qB});if(!ft)return o.jsx("div",{className:"boot"});const ni=ft.capabilities.createAgents,Tk=ft.capabilities.manageAgents,Is=ni?ei:null,Uu=ni&&q,$u=ni&&Ft,Hu=qi,Ak=Sj(e,Xi),zu=Ak.filter(B=>B.runtimeId&&(hk===null||hk.has(B.runtimeId))).map(B=>{var V;return{...B,canDelete:B.runtimeId?((V=PB[B.runtimeId])==null?void 0:V.canDelete)===!0:!1}}),u8=(()=>{if(zu.length===0)return zu;const B=new Map(jn.map((V,re)=>[V,re]));return[...zu].sort((V,re)=>{const me=B.get(V.id),Ne=B.get(re.id);return me!=null&&Ne!=null?me-Ne:me!=null?-1:Ne!=null?1:zu.indexOf(V)-zu.indexOf(re)})})(),Hh=B=>{var V;return((V=Ak.find(re=>re.id===B))==null?void 0:V.label)??B},Hr=Xi.find(B=>B.runtimeId&&B.apps.some(V=>bo(B.id,V)===n)),jl=Hr&&Hr.runtimeId&&Hr.region?{runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region}:void 0,d8=(jl==null?void 0:jl.runtimeId)??"",Ck=async(B,V)=>{var ut,$e;const re=(ut=B.meta)==null?void 0:ut.eventId,me=a;if(!re||!me||!jl)return;const Ne=($e=B.meta)==null?void 0:$e.feedback,Be={...Ne,rating:V,syncStatus:"syncing",updatedAt:Date.now()/1e3};U(me,Ge=>Ge.map(tt=>{var _e;return((_e=tt.meta)==null?void 0:_e.eventId)===re?{...tt,meta:{...tt.meta,feedback:Be}}:tt})),at(Ge=>new Set(Ge).add(re));try{const Ge=await YM({appName:n,userId:be,sessionId:me,eventId:re,rating:V});U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ge}}:_e})),i(tt=>tt.map(_e=>_e.id===me?{..._e,state:{..._e.state??{},[`veadk_feedback:${re}`]:Ge}}:_e))}catch(Ge){U(me,tt=>tt.map(_e=>{var st;return((st=_e.meta)==null?void 0:st.eventId)===re?{..._e,meta:{..._e.meta,feedback:Ne}}:_e})),_t.current===me&&Oe(Ge instanceof Error?Ge.message:String(Ge))}finally{at(Ge=>{const tt=new Set(Ge);return tt.delete(re),tt})}},zh=async B=>{Ll(Ls());let V=te.current.get(B);V||(V=await zp(B),te.current.set(B,V)),P(V),B===n&&Le(re=>re+1),_t.current="",l(""),vr(!1),r(B)},f8=B=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}vr(!1),cn(!1),ay(B),We(null),xt(null),ae(!0),Oe("")},Ik=async B=>{if(B.runtime)try{const V=await og(B.runtime.runtimeId,B.name,B.runtime.region,B.runtime.currentVersion);Ll(Ls()),Le(me=>me+1);const re=await zp(V);te.current.set(V,re),P(re),us(null),vr(!1),cn(!1),Ca(),r(V)}catch(V){Oe(V instanceof Error?V.message:String(V))}},h8=B=>{B.runtime&&(us(B),$r(""),Cr(""),vr(!1),cn(!0),Oe(""))},Rk=()=>{p&&Co(),_t.current="",l(""),xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),$r(""),Cr(""),vr(!0),Oe("")},p8=B=>{if(sy(""),Mh(""),zt){Ik(zt);return}$r(""),Cr(""),cn(!1),zh(B)},m8=B=>($r(""),Cr(B),Pu("basic"),zh(B)),my=zt!=null&&zt.runtime?Xi.find(B=>{var V;return B.runtimeId===((V=zt.runtime)==null?void 0:V.runtimeId)}):void 0,Qi=zt!=null&&zt.runtime?{id:`detail:${zt.runtime.runtimeId}`,label:zt.name,app:zt.name,remote:!0,runtimeApp:my==null?void 0:my.apps[0],runtimeId:zt.runtime.runtimeId,region:zt.runtime.region,currentVersion:zt.runtime.currentVersion,canDelete:zt.runtime.canDelete}:null;return o.jsxs("div",{className:"layout",children:[o.jsx(jK,{branding:Ht,access:ft,features:cr,sessions:s,currentSessionId:a,streamingSids:qe,onNewChat:n8,onSearch:()=>{p&&Co(),xt(null),Mn(!1),qt(!1),ae(!1),cn(!1),us(null),vr(!1),mn(!0),Oe("")},onQuickCreate:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",l(""),Mn(!1),qt(!1),mn(!1),cn(!1),us(null),vr(!1),xt(null),We(null),ay("cn-beijing"),ae(!0),Oe("")},onSkillCenter:()=>{p&&Co(),xt(null),qt(!1),ae(!1),mn(!1),cn(!1),us(null),vr(!1),Mn(!0),Oe("")},onAddAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}p&&Co(),_t.current="",xt(null),Mn(!1),mn(!1),cn(!1),us(null),vr(!1),l(""),ae(!1),qt(!0),Oe("")},onMyAgents:Rk,onPickSession:B=>{xt(null),Mn(!1),qt(!1),ae(!1),mn(!1),cn(!1),us(null),vr(!1),Oe(""),Fu(B)},onDeleteSession:r8,userInfo:Ve,version:Ot,onLogout:XB}),(()=>{const B=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(l1e,{onExit:Ca}),o.jsx(bge,{sessionId:p?p.id:a,sessionInitializing:!p&&u,appName:n,agentName:p?"AgentKit 沙箱":n?Hh(n):"Agent",value:C,onChange:M,onSubmit:()=>{if(!p&&O==="skill-create"){const Ne=C.trim();if(!Ne||J)return;const Be={id:`pending-${Date.now()}`,prompt:Ne,status:"provisioning",candidates:z_.map(($e,Ge)=>({id:`pending-${Ge}`,model:$e,modelLabel:$e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};fe(!0);const ut=++ee.current;Oe(""),ce(Be),M(""),Pbe(Ne,$e=>{ee.current===ut&&ce($e)}).then($e=>{ee.current===ut&&ce($e)}).catch($e=>{ee.current===ut&&(ce(null),M(Ne),Oe($e instanceof Error?$e.message:String($e)))}).finally(()=>{ee.current===ut&&fe(!1)});return}const V=C;if(M(""),p){e8(V);return}const re=Ee,me=xe;ge([]),we(ta()),Sk(V,re,me),p1(re)},disabled:p?!1:!be||O==="temporary"||O==="agent"&&!n,busy:p?y:O==="skill-create"?J:Zs,showMeta:L.length>0&&!p,attachments:p?[]:Ee,skills:p?[]:Rl,agents:p?[]:Du,invocation:p?ta():xe,capabilitiesLoading:!p&&bt,allowAttachments:!p,onInvocationChange:we,onAddFiles:o8,onRemoveAttachment:Ol,newChatMode:p?"agent":O,newChatTask:p?null:A,newChatLayout:!p&&L.length===0&&ne===null,showModeSelector:!1,temporaryEnabled:X&&W.temporaryEnabled,skillCreateEnabled:X&&W.skillCreateEnabled,harnessEnabled:X&&W.harnessEnabled,builtinTools:X?W.builtinTools:[],onModeChange:V=>{if(!(V==="temporary"&&!W.temporaryEnabled||V==="skill-create"&&!W.skillCreateEnabled)){if(V==="temporary"){H(null),D(V),wk();return}if(D(V),V!=="agent"&&H(null),Oe(""),V==="skill-create"){we(ta());const re=a&&Y.length===0&&Ee.length>0?a:"";As(Ee),ge([]),re&&(_t.current="",l(""),Ta(re))}}},onTaskChange:H})]});return o.jsxs("section",{className:"main-shell",children:[o.jsx(XK,{appName:n,onAppChange:Hu?m8:zh,agentLabel:Hh,agentsSource:hn,localApps:e,currentRuntime:jl,runtimeScope:ft.capabilities.runtimeScope,onBrowseAgents:Rk,title:p?"Codex 智能体":ti?"智能体":Uu?"添加 Agent":$u?"添加 AgentKit 智能体":Hu?zt?zt.name:oy?Hh(oy):"智能体详情":void 0,titleLeading:L.length>0&&!p&&O==="agent"&&!Uu&&!$u&&!Sn&&!ur&&!Hu&&!ti&&Is===null&&n?o.jsx("button",{ref:on,type:"button",className:"agent-info-trigger","aria-label":"查看 Agent 信息",title:"Agent 信息","aria-expanded":pt,onClick:()=>Lt(!0),children:o.jsx(Qc,{})}):void 0,crumbs:Sn?[{label:"技能中心"},{label:"AgentKit Skill 空间"}]:ur||$u||Uu||!Is?void 0:Is==="menu"?[{label:N1e,onClick:()=>{xt(null),We(null),ae(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Ph(!0)},{label:S1e[Is]}],rightContent:o.jsxs(o.Fragment,{children:[ft.role==="admin"&&o.jsx(Cbe,{}),o.jsx(U1e,{tasks:ni?z:[],onCancel:Ue})]})}),o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[rt&&o.jsx("div",{className:"error",children:rt}),Si&&o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 加载会话…"]}),uk&&!Hu&&!Uu&&!$u&&!ur&&!Sn&&Is===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:i8,children:[o.jsx(gv,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),ti?o.jsx(Ame,{onCreateAgent:f8,onCreateCodexAgent:wk,onUseAgent:Ik,onViewAgentDetails:h8,connectedRuntimeId:d8,hiddenRuntimeIds:BB}):Hu?o.jsx(mme,{agents:Qi?[Qi]:u8,drafts:pn,agentOrder:jn,selectedAgentId:n,agentInfo:Ae,agentInfoAgentId:n,loadingAgentInfo:bt,canCreate:ni,canUpdate:ni||Tk,loadingAgents:jB,agentsError:DB,deploymentTasks:z,focusedDeploymentTaskId:gk,focusedAgentId:(Qi==null?void 0:Qi.id)??oy,focusedAgentSection:OB,focusedCaseKind:LB,detailOnly:!!Qi||!!gk,onRetryAgents:()=>void uy(),onAgentOrderChange:HB,onDeleteAgents:zB,onDeleteDrafts:$B,onSelectAgent:zh,onTalkAgent:p8,onOpenFeedbackCase:V=>void s8(V),onFeedbackCasesDeleted:a8,onCreateAgent:()=>{if(!ni){Oe("当前账号没有添加 Agent 的权限。");return}cn(!1),ae(!0),xt(null),We(null),Ti(null),ay("cn-beijing"),Xt(""),Ut.current=null,$r(""),Cr(""),Oe("")},onUpdateAgent:V=>{if(!Tk&&!ni){Oe("当前账号没有管理 Agent 的权限。");return}if(!(Hr!=null&&Hr.runtimeId)){Oe("仅支持更新已部署的云端智能体。");return}if(!Hr.region){Oe("Runtime 缺少地域信息,无法更新。");return}cn(!1),We(V);const re=`runtime-${Hr.runtimeId}`;Xt(re),Ut.current=pn.find(me=>me.id===re)??null,$r(""),Cr(""),Ti({runtimeId:Hr.runtimeId,name:Hr.name,region:Hr.region,currentVersion:Hr.currentVersion}),xt("custom"),Oe("")},onEditDraft:V=>{cn(!1),We(V.draft),Xt(V.id),Ut.current=V,Ti(V.deploymentTarget??null),$r(""),Cr(""),xt("custom"),Oe("")}},(Qi==null?void 0:Qi.id)??"workspace"):Uu?o.jsx(s5,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:R1e,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{ae(!1),We(null),xt("menu")}},{key:"package",icon:Gz,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{ae(!1),We(null),xt("package")}}]}):ur?o.jsx(AK,{userId:be,appId:n,agentInfo:Ae,capabilitiesLoading:bt,agentLabel:Hh,onOpenSession:QB}):$u?o.jsx(Xse,{onAdded:V=>{Ll(Ls()),qt(!1),r(V)},onCancel:()=>qt(!1)}):Sn?o.jsx(qse,{}):Is!==null&&!It?o.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:[o.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",o.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):Is==="menu"?o.jsx(M0e,{onSelect:V=>{We(null),Ti(null),$r(""),Cr(""),Xt(V==="custom"?`draft-${Date.now().toString(36)}`:""),Ut.current=null,xt(V)},onImport:V=>{We(V),Ti(null),$r(""),Cr(""),Xt(`draft-${Date.now().toString(36)}`),Ut.current=null,xt("custom")}}):Is==="intelligent"?o.jsx(lye,{userId:be,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,onDeploymentTaskChange:ye}):Is==="custom"?o.jsx(rbe,{initialDraft:Fe??void 0,onBack:()=>xt("menu"),onCreate:Uh,onAgentAdded:dy,features:cr,onDeploymentTaskChange:ye,deploymentTarget:Ml??void 0,initialDeployRegion:Dh,onDraftChange:(V,re)=>{jt&&(re?UB(jt,V,Ml??void 0):yk(jt))},onDiscard:jt?()=>{yk(jt),Xt(""),Ut.current=null,We(null),Ti(null),$r(""),Cr(n),xt(null),ae(!1),cn(!0),Oe("")}:void 0,onDeploymentStarted:bk,onDeploymentComplete:Ek},jt||"custom"):Is==="template"?o.jsx(abe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="workflow"?o.jsx(pbe,{onBack:()=>xt("menu"),onCreate:Uh}):Is==="package"?o.jsx(Ebe,{onBack:()=>{xt(null),ae(!0)},onAgentAdded:dy,onDeploymentTaskChange:ye,onDeploymentStarted:bk,onDeploymentComplete:Ek,initialDeployRegion:Dh}):L.length===0&&ne?o.jsx(Zbe,{initialJob:ne}):L.length===0&&!X?o.jsxs("div",{className:"session-loading",children:[o.jsx($t,{className:"icon spin"})," 正在检查 Agent 能力…"]}):L.length===0?o.jsxs("div",{className:"welcome",children:[o.jsx(Ea,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:p?"让灵感在临时空间里自由生长":O==="skill-create"?"想创建一个什么 Skill?":lr}),B]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${Il?" is-streaming":""}`,ref:Bu,onScroll:VB,onWheel:KB,onTouchMove:YB,children:L.map((V,re)=>{var Ia,Ra,Hn,Zi,rr;const me=re===L.length-1;if(V.role==="user"){const Gn=V.blocks.map(ds=>ds.kind==="text"?ds.text:"").join(""),Jr=V.blocks.flatMap(ds=>ds.kind==="attachment"?ds.files:[]),Ai=V.blocks.find(ds=>ds.kind==="invocation");return o.jsxs(nn.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Ai==null?void 0:Ai.kind)==="invocation"&&o.jsx(F_,{value:Ai.value}),Jr.length>0&&o.jsx($_,{appName:n,items:Jr}),Gn&&o.jsx("div",{className:"bubble",children:o.jsx(yh,{text:Gn})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ia=V.meta)==null?void 0:Ia.ts)&&o.jsx("span",{className:"meta-text",children:CB(V.meta.ts)}),o.jsx(CI,{text:Gn})]})]},re)}const Ne=((Ra=V.meta)==null?void 0:Ra.author)??"",Be=Ne&&mr?Hx(mr,Ne):void 0,ut=!!(Ne&&ko.length>0&&!ko.includes(Ne)),$e=(Be==null?void 0:Be.name)||Ne,Ge=(Be==null?void 0:Be.description)||(ut?"正在执行主 Agent 移交的任务。":"");if(V.blocks.length>0&&V.blocks.every(Gn=>Gn.kind==="agent-transfer"))return null;const tt=V.blocks.length===0,_e=((Zi=(Hn=V.meta)==null?void 0:Hn.feedback)==null?void 0:Zi.rating)??null,st=((rr=V.meta)==null?void 0:rr.eventId)??"",Vt=Je.has(st),gr=!!(jl&&st&&AI(V));return o.jsxs(nn.div,{ref:Gn=>{st&&(Gn?fy.current.set(st,Gn):fy.current.delete(st))},className:["turn turn--assistant",ut?"turn--subagent":"",Lh===st?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[ut&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(Vz,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:$e})]}),o.jsx("p",{className:"subagent-run-description",title:Ge,children:Ge})]}),tt?me&&Js?o.jsx(t5,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(H_,{appName:n,blocks:V.blocks,streaming:me&&(Js||Na),onStreamFrame:me?WB:void 0,onAction:l8,onAuth:c8,onArtifactDownload:(Gn,Jr)=>qM(n,be,a,Gn,Jr),onArtifactPreview:(Gn,Jr)=>QM(n,be,a,Gn,Jr)}),!(me&&Js)&&!j1e(V)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(me&&Js)&&!D1e(V)&&o.jsxs("div",{className:"turn-meta",children:[o.jsxs("div",{className:"turn-actions",children:[gr&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":_e==="good","aria-busy":Vt,title:_e==="good"?"取消点赞":"赞",disabled:Vt,onClick:()=>void Ck(V,_e==="good"?null:"good"),children:o.jsx(c1e,{className:"icon",filled:_e==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${_e==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":_e==="bad","aria-busy":Vt,title:_e==="bad"?"取消点踩":"踩",disabled:Vt,onClick:()=>void Ck(V,_e==="bad"?null:"bad"),children:o.jsx(u1e,{className:"icon",filled:_e==="bad"})})]}),!p&&o.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>an(!0),children:o.jsx(O1e,{})}),o.jsx(CI,{text:AI(V)})]}),V.meta&&o.jsx("span",{className:"meta-text",children:L1e(V.meta)})]})]})]},re)})}),!p&&o.jsx(Bj,{appName:n,info:Ae,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:V=>void Nk(V)}),o.jsx("div",{className:"conversation-composer-slot",children:B})]})]})]})})(),dn&&a&&o.jsx(dB,{appName:n,sessionId:a,onClose:()=>an(!1)}),pt&&L.length>0&&o.jsx(pY,{appName:n,info:Ae,loading:bt,activeAgent:vo,seenAgents:_o,execPath:Sa,capabilities:ze,capabilityLoading:ve,capabilityMutating:Z,builtinTools:ht,onAddCapability:kk,onRemoveCapability:B=>void Nk(B),onClose:On,returnFocusRef:on}),o.jsx(o1e,{open:x,state:k,error:T,onCancel:ZB,onConfirm:()=>void JB()}),gt&&o.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:gt}),o.jsx(h1e,{open:ue,checking:Ce,error:ot,onLogin:()=>void GB()}),FB&&o.jsx("div",{className:"confirm-scrim",onClick:()=>Ph(!1),children:o.jsxs("div",{className:"confirm-box",onClick:B=>B.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>Ph(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{We(null),xt("menu"),Ph(!1)},children:"确定返回"})]})]})})]})}const OI="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(OI)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(OI,String(t))}catch{}window.location.reload()}});(()=>{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})()||m1.createRoot(document.getElementById("root")).render(o.jsx(kt.StrictMode,{children:o.jsx(eU,{reducedMotion:"user",children:o.jsx(Lz,{maskOpacity:.9,children:o.jsx(K1e,{})})})}));export{E as A,_0 as B,xs as C,X1e as D,Kd as E,fl as F,T3 as G,W1e as R,Br as V,kt as a,tu as b,x2 as c,Q1e as d,Kv as e,wq as f,Mf as g,Mt as h,BQ as i,KQ as j,_q as k,Xf as l,KZ as m,SQ as n,TQ as o,JZ as p,EZ as q,xZ as r,B3 as s,o as t,it as u,un as v,Tt as w,q1e as x,DQ as y,vs as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index 05e07b03..1d4d030c 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ VeADK Studio - - + +